@speakableio/core 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -846,7 +846,21 @@ var ANALYTICS_EVENT_TYPES = {
846
846
  MC_FAIL: "multiple_choice_fail",
847
847
  MC_ERROR: "multiple_choice_error",
848
848
  ACTFL_LEVEL: "actfl_level",
849
- WIDA_LEVEL: "wida_level"
849
+ WIDA_LEVEL: "wida_level",
850
+ // New events
851
+ VIEW_SCORES_MODAL: "view_scores_modal",
852
+ SHORT_ANSWER_SUCCESS: "short_answer_success",
853
+ SHORT_ANSWER_FAIL: "short_answer_fail",
854
+ SHORT_ANSWER_ERROR: "short_answer_error",
855
+ RETRY: "retry",
856
+ MESSAGE_SENT: "message_sent",
857
+ MESSAGE_ERROR: "message_error",
858
+ VIEW_DETAILS_CLICK: "view_details_click",
859
+ TABS_CLICK: "tabs_click",
860
+ VIEW_MEDIA: "view_media",
861
+ VIEW_SCORES: "view_scores",
862
+ VIEW_GRADING_METHOD: "view_grading_method",
863
+ VIEW_FEEDBACK: "view_feedback"
850
864
  };
851
865
 
852
866
  // src/lib/firebase/firebase-analytics/assignment.ts
@@ -2430,42 +2444,39 @@ function useActivity({
2430
2444
  });
2431
2445
  };
2432
2446
  const onSubmitScore = async () => {
2433
- var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
2447
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
2434
2448
  try {
2435
2449
  let results;
2436
2450
  if (isAssignment) {
2437
- const cardScores = ((_a2 = scoreQuery.data) == null ? void 0 : _a2.cards) || {};
2438
- const hasPendingReview = Object.values(cardScores).some(
2439
- (cardScore) => cardScore.status === "pending_review"
2440
- );
2451
+ const someCardIsManualGraded = cards.some((page) => page.grading_method === "manual");
2441
2452
  results = await submitAssignmentScore2({
2442
2453
  assignment: {
2443
- id: (_c = (_b2 = assignmentQuery.data) == null ? void 0 : _b2.id) != null ? _c : "",
2444
- name: (_e = (_d = assignmentQuery.data) == null ? void 0 : _d.name) != null ? _e : "",
2445
- owners: (_g = (_f = assignmentQuery.data) == null ? void 0 : _f.owners) != null ? _g : [],
2446
- courseId: (_i = (_h = assignmentQuery.data) == null ? void 0 : _h.courseId) != null ? _i : "",
2447
- courseWorkId: (_k = (_j = assignmentQuery.data) == null ? void 0 : _j.courseWorkId) != null ? _k : "",
2448
- isAssessment: (_m = (_l = assignmentQuery.data) == null ? void 0 : _l.isAssessment) != null ? _m : false,
2449
- maxPoints: (_o = (_n = assignmentQuery.data) == null ? void 0 : _n.maxPoints) != null ? _o : 0
2454
+ id: (_b2 = (_a2 = assignmentQuery.data) == null ? void 0 : _a2.id) != null ? _b2 : "",
2455
+ name: (_d = (_c = assignmentQuery.data) == null ? void 0 : _c.name) != null ? _d : "",
2456
+ owners: (_f = (_e = assignmentQuery.data) == null ? void 0 : _e.owners) != null ? _f : [],
2457
+ courseId: (_h = (_g = assignmentQuery.data) == null ? void 0 : _g.courseId) != null ? _h : "",
2458
+ courseWorkId: (_j = (_i = assignmentQuery.data) == null ? void 0 : _i.courseWorkId) != null ? _j : "",
2459
+ isAssessment: (_l = (_k = assignmentQuery.data) == null ? void 0 : _k.isAssessment) != null ? _l : false,
2460
+ maxPoints: (_n = (_m = assignmentQuery.data) == null ? void 0 : _m.maxPoints) != null ? _n : 0
2450
2461
  },
2451
2462
  userId,
2452
2463
  cardIds: contentCardsToUse != null ? contentCardsToUse : [],
2453
2464
  scores: scoreQuery.data,
2454
2465
  weights: weightsToUse != null ? weightsToUse : {},
2455
- status: hasPendingReview ? "PENDING_REVIEW" : "FINALIZED"
2466
+ status: someCardIsManualGraded ? "PENDING_REVIEW" : "SUBMITTED"
2456
2467
  });
2457
- if ((_p = assignmentQuery.data) == null ? void 0 : _p.ltiDeeplink) {
2468
+ if ((_o = assignmentQuery.data) == null ? void 0 : _o.ltiDeeplink) {
2458
2469
  submitLTIScore({
2459
- maxPoints: (_q = assignmentQuery.data) == null ? void 0 : _q.maxPoints,
2460
- score: (_s = (_r = scoreQuery.data) == null ? void 0 : _r.score) != null ? _s : 0,
2461
- SERVICE_KEY: (_t = ltiData == null ? void 0 : ltiData.serviceKey) != null ? _t : "",
2462
- lineItemId: (_u = ltiData == null ? void 0 : ltiData.lineItemId) != null ? _u : "",
2463
- lti_id: (_v = ltiData == null ? void 0 : ltiData.lti_id) != null ? _v : ""
2470
+ maxPoints: (_p = assignmentQuery.data) == null ? void 0 : _p.maxPoints,
2471
+ score: (_r = (_q = scoreQuery.data) == null ? void 0 : _q.score) != null ? _r : 0,
2472
+ SERVICE_KEY: (_s = ltiData == null ? void 0 : ltiData.serviceKey) != null ? _s : "",
2473
+ lineItemId: (_t = ltiData == null ? void 0 : ltiData.lineItemId) != null ? _t : "",
2474
+ lti_id: (_u = ltiData == null ? void 0 : ltiData.lti_id) != null ? _u : ""
2464
2475
  });
2465
2476
  }
2466
2477
  } else {
2467
2478
  results = await submitPracticeScore2({
2468
- setId: (_x = (_w = querySet.data) == null ? void 0 : _w.id) != null ? _x : "",
2479
+ setId: (_w = (_v = querySet.data) == null ? void 0 : _v.id) != null ? _w : "",
2469
2480
  userId,
2470
2481
  scores: scoreQuery.data
2471
2482
  });