@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 createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
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 createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
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;
@@ -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 createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
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 createFsClientNative: ({ db, httpsCallable, logEvent }: FsClientPa
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;
@@ -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
  });