@speakableio/core 1.0.2 → 1.0.4

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.
@@ -446,6 +446,7 @@ interface Assignment {
446
446
  };
447
447
  aiEnabled?: boolean;
448
448
  chat_experience?: boolean;
449
+ showScores?: boolean;
449
450
  }
450
451
  interface AssignmentWithId extends Assignment {
451
452
  id: string;
@@ -631,6 +632,7 @@ declare const createAssignmentRepo: () => {
631
632
  types?: { [key in ActivityPageType]?: number; };
632
633
  aiEnabled?: boolean;
633
634
  chat_experience?: boolean;
635
+ showScores?: boolean;
634
636
  } | null>;
635
637
  attachScoresAssignment: (args_0: {
636
638
  assignments: AssignmentWithId[];
@@ -681,6 +683,7 @@ declare const createAssignmentRepo: () => {
681
683
  types?: { [key in ActivityPageType]?: number; };
682
684
  aiEnabled?: boolean;
683
685
  chat_experience?: boolean;
686
+ showScores?: boolean;
684
687
  }[]>;
685
688
  getAssignmentScores: (args_0: {
686
689
  assignmentId: string;
@@ -750,6 +753,7 @@ declare function useAssignment({ assignmentId, enabled, analyticType, userId, }:
750
753
  types?: { [key in ActivityPageType]?: number; };
751
754
  aiEnabled?: boolean;
752
755
  chat_experience?: boolean;
756
+ showScores?: boolean;
753
757
  } | null, Error>;
754
758
 
755
759
  declare const scoreQueryKeys: {
@@ -828,7 +832,7 @@ declare function useSubmitAssignmentScore({ onAssignmentSubmitted, studentName,
828
832
  cardIds: string[];
829
833
  weights: Record<string, number>;
830
834
  scores: Score;
831
- status: "FINALIZED" | "IN_PROGRESS" | "PENDING_REVIEW";
835
+ status: Score["status"];
832
836
  }, unknown>;
833
837
  isLoading: boolean;
834
838
  };
@@ -1012,6 +1016,7 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1012
1016
  types?: { [key in ActivityPageType]?: number; };
1013
1017
  aiEnabled?: boolean;
1014
1018
  chat_experience?: boolean;
1019
+ showScores?: boolean;
1015
1020
  } | null>;
1016
1021
  attachScoresAssignment: (args_0: {
1017
1022
  assignments: AssignmentWithId[];
@@ -1062,6 +1067,7 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1062
1067
  types?: { [key in ActivityPageType]?: number; };
1063
1068
  aiEnabled?: boolean;
1064
1069
  chat_experience?: boolean;
1070
+ showScores?: boolean;
1065
1071
  }[]>;
1066
1072
  getAssignmentScores: (args_0: {
1067
1073
  assignmentId: string;
@@ -1374,6 +1380,7 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1374
1380
  types?: { [key in ActivityPageType]?: number; };
1375
1381
  aiEnabled?: boolean;
1376
1382
  chat_experience?: boolean;
1383
+ showScores?: boolean;
1377
1384
  } | null | undefined;
1378
1385
  query: _tanstack_react_query.UseQueryResult<AssignmentWithId | {
1379
1386
  scores: any;
@@ -1419,6 +1426,7 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1419
1426
  types?: { [key in ActivityPageType]?: number; };
1420
1427
  aiEnabled?: boolean;
1421
1428
  chat_experience?: boolean;
1429
+ showScores?: boolean;
1422
1430
  } | null, Error>;
1423
1431
  };
1424
1432
  scores: {
@@ -2688,6 +2696,7 @@ declare const createFsClientWeb: ({ db, httpsCallable, logEvent }: FsClientParam
2688
2696
  types?: { [key in ActivityPageType]?: number; };
2689
2697
  aiEnabled?: boolean;
2690
2698
  chat_experience?: boolean;
2699
+ showScores?: boolean;
2691
2700
  } | null>;
2692
2701
  attachScoresAssignment: (args_0: {
2693
2702
  assignments: AssignmentWithId[];
@@ -2738,6 +2747,7 @@ declare const createFsClientWeb: ({ db, httpsCallable, logEvent }: FsClientParam
2738
2747
  types?: { [key in ActivityPageType]?: number; };
2739
2748
  aiEnabled?: boolean;
2740
2749
  chat_experience?: boolean;
2750
+ showScores?: boolean;
2741
2751
  }[]>;
2742
2752
  getAssignmentScores: (args_0: {
2743
2753
  assignmentId: string;
package/dist/index.web.js CHANGED
@@ -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
  });