@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.
@@ -2444,42 +2444,39 @@ function useActivity({
2444
2444
  });
2445
2445
  };
2446
2446
  const onSubmitScore = async () => {
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, _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;
2448
2448
  try {
2449
2449
  let results;
2450
2450
  if (isAssignment) {
2451
- const cardScores = ((_a2 = scoreQuery.data) == null ? void 0 : _a2.cards) || {};
2452
- const hasPendingReview = Object.values(cardScores).some(
2453
- (cardScore) => cardScore.status === "pending_review"
2454
- );
2451
+ const someCardIsManualGraded = cards.some((page) => page.grading_method === "manual");
2455
2452
  results = await submitAssignmentScore2({
2456
2453
  assignment: {
2457
- id: (_c = (_b2 = assignmentQuery.data) == null ? void 0 : _b2.id) != null ? _c : "",
2458
- name: (_e = (_d = assignmentQuery.data) == null ? void 0 : _d.name) != null ? _e : "",
2459
- owners: (_g = (_f = assignmentQuery.data) == null ? void 0 : _f.owners) != null ? _g : [],
2460
- courseId: (_i = (_h = assignmentQuery.data) == null ? void 0 : _h.courseId) != null ? _i : "",
2461
- courseWorkId: (_k = (_j = assignmentQuery.data) == null ? void 0 : _j.courseWorkId) != null ? _k : "",
2462
- isAssessment: (_m = (_l = assignmentQuery.data) == null ? void 0 : _l.isAssessment) != null ? _m : false,
2463
- 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
2464
2461
  },
2465
2462
  userId,
2466
2463
  cardIds: contentCardsToUse != null ? contentCardsToUse : [],
2467
2464
  scores: scoreQuery.data,
2468
2465
  weights: weightsToUse != null ? weightsToUse : {},
2469
- status: hasPendingReview ? "PENDING_REVIEW" : "FINALIZED"
2466
+ status: someCardIsManualGraded ? "PENDING_REVIEW" : "SUBMITTED"
2470
2467
  });
2471
- if ((_p = assignmentQuery.data) == null ? void 0 : _p.ltiDeeplink) {
2468
+ if ((_o = assignmentQuery.data) == null ? void 0 : _o.ltiDeeplink) {
2472
2469
  submitLTIScore({
2473
- maxPoints: (_q = assignmentQuery.data) == null ? void 0 : _q.maxPoints,
2474
- score: (_s = (_r = scoreQuery.data) == null ? void 0 : _r.score) != null ? _s : 0,
2475
- SERVICE_KEY: (_t = ltiData == null ? void 0 : ltiData.serviceKey) != null ? _t : "",
2476
- lineItemId: (_u = ltiData == null ? void 0 : ltiData.lineItemId) != null ? _u : "",
2477
- 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 : ""
2478
2475
  });
2479
2476
  }
2480
2477
  } else {
2481
2478
  results = await submitPracticeScore2({
2482
- 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 : "",
2483
2480
  userId,
2484
2481
  scores: scoreQuery.data
2485
2482
  });