@speakableio/core 1.0.34 → 1.0.36

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.
@@ -157,6 +157,8 @@ interface PageActivity {
157
157
  limit_attempts?: boolean;
158
158
  max_attempts?: number;
159
159
  rich_text?: string;
160
+ feedbackOff?: boolean;
161
+ correct_answer_exact_match?: boolean;
160
162
  }
161
163
  declare const enum ActivityPageType {
162
164
  READ_REPEAT = "READ_REPEAT",
@@ -259,6 +261,8 @@ declare function useCards({ cardIds, enabled, asObject, }: {
259
261
  limit_attempts?: boolean;
260
262
  max_attempts?: number;
261
263
  rich_text?: string;
264
+ feedbackOff?: boolean;
265
+ correct_answer_exact_match?: boolean;
262
266
  } | null, Error>[];
263
267
  };
264
268
  declare function useCreateCard(): {
@@ -340,6 +344,8 @@ declare function useCreateCards(): {
340
344
  limit_attempts?: boolean;
341
345
  max_attempts?: number;
342
346
  rich_text?: string;
347
+ feedbackOff?: boolean;
348
+ correct_answer_exact_match?: boolean;
343
349
  }[], Error, {
344
350
  cards: PageActivity[];
345
351
  }, unknown>;
@@ -427,6 +433,8 @@ declare function useGetCard({ cardId, enabled }: {
427
433
  limit_attempts?: boolean;
428
434
  max_attempts?: number;
429
435
  rich_text?: string;
436
+ feedbackOff?: boolean;
437
+ correct_answer_exact_match?: boolean;
430
438
  } | null, Error>;
431
439
 
432
440
  declare const createCardRepo: () => {
@@ -508,6 +516,8 @@ declare const createCardRepo: () => {
508
516
  limit_attempts?: boolean;
509
517
  max_attempts?: number;
510
518
  rich_text?: string;
519
+ feedbackOff?: boolean;
520
+ correct_answer_exact_match?: boolean;
511
521
  }[]>;
512
522
  getCard: (params: {
513
523
  cardId: string;
@@ -582,6 +592,8 @@ declare const createCardRepo: () => {
582
592
  limit_attempts?: boolean;
583
593
  max_attempts?: number;
584
594
  rich_text?: string;
595
+ feedbackOff?: boolean;
596
+ correct_answer_exact_match?: boolean;
585
597
  } | null>;
586
598
  };
587
599
 
@@ -617,6 +629,18 @@ declare const getLabelPage: (pageType: ActivityPageType | undefined) => {
617
629
  long: string;
618
630
  };
619
631
 
632
+ /**
633
+ * Get the media data for a page
634
+ * @param page - The page to get the media data for
635
+ * @returns The media data for the page
636
+
637
+ * - direction: The direction of the media area
638
+ * - mode: The mode of the media area
639
+ * - singleMedia: The single media data for the page
640
+ * - isMediaPage: Whether the page is a media page
641
+ * - hasMediaData: Whether the page has some kind of media data
642
+ * - mediaAreaId: The id of the media area
643
+ */
620
644
  declare function getPageMediaData(page: PageActivityWithId): {
621
645
  direction: "left" | "right";
622
646
  mode: "single" | "media_area" | "none" | null;
@@ -629,7 +653,9 @@ declare function getPageMediaData(page: PageActivityWithId): {
629
653
  content: string;
630
654
  } | undefined;
631
655
  isMediaPage: boolean;
632
- hasMediaData: string | boolean;
656
+ hasMediaData: boolean;
657
+ mediaAreaId: string | undefined;
658
+ shouldRenderMediaArea: boolean;
633
659
  };
634
660
  declare function getSingleMediaPageData(page: PageActivityWithId): {
635
661
  rawObject: {
@@ -1435,6 +1461,8 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1435
1461
  limit_attempts?: boolean;
1436
1462
  max_attempts?: number;
1437
1463
  rich_text?: string;
1464
+ feedbackOff?: boolean;
1465
+ correct_answer_exact_match?: boolean;
1438
1466
  }[]>;
1439
1467
  getCard: (params: {
1440
1468
  cardId: string;
@@ -1509,6 +1537,8 @@ declare function createFsClientBase({ db, helpers, httpsCallable, logEvent, }: {
1509
1537
  limit_attempts?: boolean;
1510
1538
  max_attempts?: number;
1511
1539
  rich_text?: string;
1540
+ feedbackOff?: boolean;
1541
+ correct_answer_exact_match?: boolean;
1512
1542
  } | null>;
1513
1543
  };
1514
1544
  };
@@ -1767,6 +1797,8 @@ declare function useActivity({ id, isAssignment, onAssignmentSubmitted, ltiData,
1767
1797
  limit_attempts?: boolean;
1768
1798
  max_attempts?: number;
1769
1799
  rich_text?: string;
1800
+ feedbackOff?: boolean;
1801
+ correct_answer_exact_match?: boolean;
1770
1802
  } | null, Error>[];
1771
1803
  cardsArray: PageActivityWithId[];
1772
1804
  };
@@ -3314,6 +3346,8 @@ declare const createFsClientWeb: ({ db, httpsCallable, logEvent }: FsClientParam
3314
3346
  limit_attempts?: boolean;
3315
3347
  max_attempts?: number;
3316
3348
  rich_text?: string;
3349
+ feedbackOff?: boolean;
3350
+ correct_answer_exact_match?: boolean;
3317
3351
  }[]>;
3318
3352
  getCard: (params: {
3319
3353
  cardId: string;
@@ -3388,6 +3422,8 @@ declare const createFsClientWeb: ({ db, httpsCallable, logEvent }: FsClientParam
3388
3422
  limit_attempts?: boolean;
3389
3423
  max_attempts?: number;
3390
3424
  rich_text?: string;
3425
+ feedbackOff?: boolean;
3426
+ correct_answer_exact_match?: boolean;
3391
3427
  } | null>;
3392
3428
  };
3393
3429
  };
package/dist/index.web.js CHANGED
@@ -923,6 +923,24 @@ var refsScoresPractice = {
923
923
  };
924
924
 
925
925
  // src/domains/assignment/services/create-score.service.ts
926
+ var _updateAssignmentGradebookStatus = async ({
927
+ assignmentId,
928
+ userId,
929
+ status,
930
+ score
931
+ }) => {
932
+ var _a, _b, _c;
933
+ await ((_c = (_b = (_a = api).httpsCallable) == null ? void 0 : _b.call(_a, "updateAssignmentGradebookStatus")) == null ? void 0 : _c({
934
+ assignmentId,
935
+ userId,
936
+ status,
937
+ score
938
+ }));
939
+ };
940
+ var updateAssignmentGradebookStatus = withErrorHandler(
941
+ _updateAssignmentGradebookStatus,
942
+ "updateAssignmentGradebookStatus"
943
+ );
926
944
  async function _createScore(params) {
927
945
  var _a, _b, _c;
928
946
  if (params.isAssignment) {
@@ -937,6 +955,12 @@ async function _createScore(params) {
937
955
  score: null
938
956
  }));
939
957
  await api.setDoc(ref, params.scoreData, { merge: true });
958
+ await updateAssignmentGradebookStatus({
959
+ assignmentId: params.activityId,
960
+ userId: params.userId,
961
+ status: "IN_PROGRESS",
962
+ score: null
963
+ });
940
964
  return {
941
965
  id: params.userId
942
966
  };
@@ -2085,18 +2109,22 @@ var getLabelPage = (pageType) => {
2085
2109
 
2086
2110
  // src/domains/cards/utils/get-page-media-data.ts
2087
2111
  function getPageMediaData(page) {
2088
- var _a, _b;
2112
+ var _a, _b, _c, _d;
2089
2113
  const direction = (_a = page.media_area_layout) != null ? _a : "left";
2090
2114
  const { isMediaPage } = checkTypePageActivity(page.type);
2091
2115
  const mode = (_b = page.media_mode) != null ? _b : page.media_area_id ? "media_area" : null;
2092
2116
  const singleMedia = getSingleMediaPageData(page);
2093
- const hasMediaData = !!page.media_area_id || page.media_area_context_ref || singleMedia !== void 0;
2117
+ const mediaAreaId = (_d = (_c = page.media_area_id) != null ? _c : page.media_area_context_ref) != null ? _d : void 0;
2118
+ const shouldRenderMediaArea = isMediaPage || mode === "media_area" || !(page == null ? void 0 : page.media_mode) && mediaAreaId != null;
2119
+ const hasMediaData = !!page.media_area_id || !!page.media_area_context_ref || singleMedia !== void 0;
2094
2120
  return {
2095
2121
  direction,
2096
2122
  mode,
2097
2123
  singleMedia,
2098
2124
  isMediaPage,
2099
- hasMediaData
2125
+ hasMediaData,
2126
+ mediaAreaId,
2127
+ shouldRenderMediaArea
2100
2128
  };
2101
2129
  }
2102
2130
  function getSingleMediaPageData(page) {