@speakableio/core 1.0.2 → 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.
@@ -828,7 +828,7 @@ declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName,
828
828
  cardIds: string[];
829
829
  weights: Record<string, number>;
830
830
  scores: Score;
831
- status: "FINALIZED" | "IN_PROGRESS" | "PENDING_REVIEW";
831
+ status: Score["status"];
832
832
  }, unknown>;
833
833
  isLoading: boolean;
834
834
  };
@@ -828,7 +828,7 @@ declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName,
828
828
  cardIds: string[];
829
829
  weights: Record<string, number>;
830
830
  scores: Score;
831
- status: "FINALIZED" | "IN_PROGRESS" | "PENDING_REVIEW";
831
+ status: Score["status"];
832
832
  }, unknown>;
833
833
  isLoading: boolean;
834
834
  };
@@ -2549,42 +2549,39 @@ function useActivity({
2549
2549
  });
2550
2550
  };
2551
2551
  const onSubmitScore = async () => {
2552
- 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;
2552
+ var _a2, _b2, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
2553
2553
  try {
2554
2554
  let results;
2555
2555
  if (isAssignment) {
2556
- const cardScores = ((_a2 = scoreQuery.data) == null ? void 0 : _a2.cards) || {};
2557
- const hasPendingReview = Object.values(cardScores).some(
2558
- (cardScore) => cardScore.status === "pending_review"
2559
- );
2556
+ const someCardIsManualGraded = cards.some((page) => page.grading_method === "manual");
2560
2557
  results = await submitAssignmentScore2({
2561
2558
  assignment: {
2562
- id: (_c = (_b2 = assignmentQuery.data) == null ? void 0 : _b2.id) != null ? _c : "",
2563
- name: (_e = (_d = assignmentQuery.data) == null ? void 0 : _d.name) != null ? _e : "",
2564
- owners: (_g = (_f = assignmentQuery.data) == null ? void 0 : _f.owners) != null ? _g : [],
2565
- courseId: (_i = (_h = assignmentQuery.data) == null ? void 0 : _h.courseId) != null ? _i : "",
2566
- courseWorkId: (_k = (_j = assignmentQuery.data) == null ? void 0 : _j.courseWorkId) != null ? _k : "",
2567
- isAssessment: (_m = (_l = assignmentQuery.data) == null ? void 0 : _l.isAssessment) != null ? _m : false,
2568
- maxPoints: (_o = (_n = assignmentQuery.data) == null ? void 0 : _n.maxPoints) != null ? _o : 0
2559
+ id: (_b2 = (_a2 = assignmentQuery.data) == null ? void 0 : _a2.id) != null ? _b2 : "",
2560
+ name: (_d = (_c = assignmentQuery.data) == null ? void 0 : _c.name) != null ? _d : "",
2561
+ owners: (_f = (_e = assignmentQuery.data) == null ? void 0 : _e.owners) != null ? _f : [],
2562
+ courseId: (_h = (_g = assignmentQuery.data) == null ? void 0 : _g.courseId) != null ? _h : "",
2563
+ courseWorkId: (_j = (_i = assignmentQuery.data) == null ? void 0 : _i.courseWorkId) != null ? _j : "",
2564
+ isAssessment: (_l = (_k = assignmentQuery.data) == null ? void 0 : _k.isAssessment) != null ? _l : false,
2565
+ maxPoints: (_n = (_m = assignmentQuery.data) == null ? void 0 : _m.maxPoints) != null ? _n : 0
2569
2566
  },
2570
2567
  userId,
2571
2568
  cardIds: contentCardsToUse != null ? contentCardsToUse : [],
2572
2569
  scores: scoreQuery.data,
2573
2570
  weights: weightsToUse != null ? weightsToUse : {},
2574
- status: hasPendingReview ? "PENDING_REVIEW" : "FINALIZED"
2571
+ status: someCardIsManualGraded ? "PENDING_REVIEW" : "SUBMITTED"
2575
2572
  });
2576
- if ((_p = assignmentQuery.data) == null ? void 0 : _p.ltiDeeplink) {
2573
+ if ((_o = assignmentQuery.data) == null ? void 0 : _o.ltiDeeplink) {
2577
2574
  submitLTIScore({
2578
- maxPoints: (_q = assignmentQuery.data) == null ? void 0 : _q.maxPoints,
2579
- score: (_s = (_r = scoreQuery.data) == null ? void 0 : _r.score) != null ? _s : 0,
2580
- SERVICE_KEY: (_t = ltiData == null ? void 0 : ltiData.serviceKey) != null ? _t : "",
2581
- lineItemId: (_u = ltiData == null ? void 0 : ltiData.lineItemId) != null ? _u : "",
2582
- lti_id: (_v = ltiData == null ? void 0 : ltiData.lti_id) != null ? _v : ""
2575
+ maxPoints: (_p = assignmentQuery.data) == null ? void 0 : _p.maxPoints,
2576
+ score: (_r = (_q = scoreQuery.data) == null ? void 0 : _q.score) != null ? _r : 0,
2577
+ SERVICE_KEY: (_s = ltiData == null ? void 0 : ltiData.serviceKey) != null ? _s : "",
2578
+ lineItemId: (_t = ltiData == null ? void 0 : ltiData.lineItemId) != null ? _t : "",
2579
+ lti_id: (_u = ltiData == null ? void 0 : ltiData.lti_id) != null ? _u : ""
2583
2580
  });
2584
2581
  }
2585
2582
  } else {
2586
2583
  results = await submitPracticeScore2({
2587
- setId: (_x = (_w = querySet.data) == null ? void 0 : _w.id) != null ? _x : "",
2584
+ setId: (_w = (_v = querySet.data) == null ? void 0 : _v.id) != null ? _w : "",
2588
2585
  userId,
2589
2586
  scores: scoreQuery.data
2590
2587
  });