@cuemath/leap 3.5.64 → 3.5.66-link0

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.
Files changed (176) hide show
  1. package/dist/features/cue-canvas/bottombar/homework-controls.js.map +1 -1
  2. package/dist/features/cue-canvas/sidebar/sidebar.js +4 -4
  3. package/dist/features/cue-canvas/sidebar/sidebar.js.map +1 -1
  4. package/dist/features/cue-canvas/toolbar/toolbar.js +21 -17
  5. package/dist/features/cue-canvas/toolbar/toolbar.js.map +1 -1
  6. package/dist/features/cue-canvas/toolbar/whiteboard-toolbar.js +23 -13
  7. package/dist/features/cue-canvas/toolbar/whiteboard-toolbar.js.map +1 -1
  8. package/dist/features/milestone/create/api/milestone-config.js.map +1 -1
  9. package/dist/features/parent-dashboard/modals/trial-report/trial-report.js +1 -1
  10. package/dist/features/parent-dashboard/modals/trial-report/trial-report.js.map +1 -1
  11. package/dist/features/sheets/constants/sheet.js +1 -0
  12. package/dist/features/sheets/constants/sheet.js.map +1 -1
  13. package/dist/features/timeline/daily-timeline/daily-timeline.js +40 -40
  14. package/dist/features/timeline/daily-timeline/daily-timeline.js.map +1 -1
  15. package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-types.js +1 -1
  16. package/dist/features/timeline/monthly-timeline/monthly-report/monthly-report-types.js.map +1 -1
  17. package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js +8 -5
  18. package/dist/features/timeline/monthly-timeline/monthly-timeline-styled.js.map +1 -1
  19. package/dist/features/timeline/monthly-timeline/monthly-timeline.js +35 -35
  20. package/dist/features/timeline/monthly-timeline/monthly-timeline.js.map +1 -1
  21. package/dist/features/trial-session/api/trial-home.js +10 -16
  22. package/dist/features/trial-session/api/trial-home.js.map +1 -1
  23. package/dist/features/trial-session/api/trial-session-report.js +16 -0
  24. package/dist/features/trial-session/api/trial-session-report.js.map +1 -0
  25. package/dist/features/trial-session/api/trial-topics.js +9 -0
  26. package/dist/features/trial-session/api/trial-topics.js.map +1 -0
  27. package/dist/features/trial-session/comps/background-grid/background-grid-utils.js +62 -50
  28. package/dist/features/trial-session/comps/background-grid/background-grid-utils.js.map +1 -1
  29. package/dist/features/trial-session/comps/class-preference/class-preference-styled.js +5 -14
  30. package/dist/features/trial-session/comps/class-preference/class-preference-styled.js.map +1 -1
  31. package/dist/features/trial-session/comps/class-preference/class-preference.js +55 -53
  32. package/dist/features/trial-session/comps/class-preference/class-preference.js.map +1 -1
  33. package/dist/features/trial-session/comps/communication-slide/communication-slide-constants.js +3 -2
  34. package/dist/features/trial-session/comps/communication-slide/communication-slide-constants.js.map +1 -1
  35. package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js +27 -27
  36. package/dist/features/trial-session/comps/confirmation-modal/hooks/use-confirmation-modal.js.map +1 -1
  37. package/dist/features/trial-session/comps/learning-session/learning-session-styled.js +19 -18
  38. package/dist/features/trial-session/comps/learning-session/learning-session-styled.js.map +1 -1
  39. package/dist/features/trial-session/comps/learning-session/learning-session.js +34 -43
  40. package/dist/features/trial-session/comps/learning-session/learning-session.js.map +1 -1
  41. package/dist/features/trial-session/comps/navigation-bar/index.js +56 -58
  42. package/dist/features/trial-session/comps/navigation-bar/index.js.map +1 -1
  43. package/dist/features/trial-session/comps/offering-information/offering-information-constants.js +29 -6
  44. package/dist/features/trial-session/comps/offering-information/offering-information-constants.js.map +1 -1
  45. package/dist/features/trial-session/comps/offering-information/offering-information.js +74 -64
  46. package/dist/features/trial-session/comps/offering-information/offering-information.js.map +1 -1
  47. package/dist/features/trial-session/comps/school-goals/school-goals-styled.js +10 -9
  48. package/dist/features/trial-session/comps/school-goals/school-goals-styled.js.map +1 -1
  49. package/dist/features/trial-session/comps/school-goals/school-goals-view.js +40 -39
  50. package/dist/features/trial-session/comps/school-goals/school-goals-view.js.map +1 -1
  51. package/dist/features/trial-session/comps/school-goals/school-goals.js +39 -37
  52. package/dist/features/trial-session/comps/school-goals/school-goals.js.map +1 -1
  53. package/dist/features/trial-session/comps/session-insights/session-insights-styled.js +12 -20
  54. package/dist/features/trial-session/comps/session-insights/session-insights-styled.js.map +1 -1
  55. package/dist/features/trial-session/comps/session-insights/session-insights.js +64 -63
  56. package/dist/features/trial-session/comps/session-insights/session-insights.js.map +1 -1
  57. package/dist/features/trial-session/comps/session-overview/session-overview-styled.js +13 -13
  58. package/dist/features/trial-session/comps/session-overview/session-overview-styled.js.map +1 -1
  59. package/dist/features/trial-session/comps/session-overview/session-overview-utils.js +23 -4
  60. package/dist/features/trial-session/comps/session-overview/session-overview-utils.js.map +1 -1
  61. package/dist/features/trial-session/comps/session-overview/session-overview.js +20 -20
  62. package/dist/features/trial-session/comps/session-overview/session-overview.js.map +1 -1
  63. package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-styled.js +61 -0
  64. package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-styled.js.map +1 -0
  65. package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-types.js +5 -0
  66. package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-types.js.map +1 -0
  67. package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-view.js +135 -0
  68. package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary-view.js.map +1 -0
  69. package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary.js +53 -0
  70. package/dist/features/trial-session/comps/session-progress-summary/session-progress-summary.js.map +1 -0
  71. package/dist/features/trial-session/comps/session-report/report-404/report-404.js +15 -16
  72. package/dist/features/trial-session/comps/session-report/report-404/report-404.js.map +1 -1
  73. package/dist/features/trial-session/comps/session-report/session-report.js +35 -33
  74. package/dist/features/trial-session/comps/session-report/session-report.js.map +1 -1
  75. package/dist/features/trial-session/comps/student-enrichment/student-enrichment-styled.js +9 -16
  76. package/dist/features/trial-session/comps/student-enrichment/student-enrichment-styled.js.map +1 -1
  77. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js +39 -37
  78. package/dist/features/trial-session/comps/student-enrichment/student-enrichment.js.map +1 -1
  79. package/dist/features/trial-session/comps/student-feedback/student-feedback-styled.js +10 -9
  80. package/dist/features/trial-session/comps/student-feedback/student-feedback-styled.js.map +1 -1
  81. package/dist/features/trial-session/comps/student-info/student-info-constants.js +35 -0
  82. package/dist/features/trial-session/comps/student-info/student-info-constants.js.map +1 -0
  83. package/dist/features/trial-session/comps/student-info/student-info-helpers.js +12 -0
  84. package/dist/features/trial-session/comps/student-info/student-info-helpers.js.map +1 -0
  85. package/dist/features/trial-session/comps/student-info/student-info-styled.js +26 -11
  86. package/dist/features/trial-session/comps/student-info/student-info-styled.js.map +1 -1
  87. package/dist/features/trial-session/comps/student-info/student-info.js +113 -78
  88. package/dist/features/trial-session/comps/student-info/student-info.js.map +1 -1
  89. package/dist/features/trial-session/comps/student-personalization/student-personalization-styled.js +3 -12
  90. package/dist/features/trial-session/comps/student-personalization/student-personalization-styled.js.map +1 -1
  91. package/dist/features/trial-session/comps/student-personalization/student-personalization.js +34 -33
  92. package/dist/features/trial-session/comps/student-personalization/student-personalization.js.map +1 -1
  93. package/dist/features/trial-session/comps/student-profile/student-profile.js +45 -44
  94. package/dist/features/trial-session/comps/student-profile/student-profile.js.map +1 -1
  95. package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +9 -8
  96. package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
  97. package/dist/features/trial-session/comps/test-prep/test-prep-styled.js +11 -19
  98. package/dist/features/trial-session/comps/test-prep/test-prep-styled.js.map +1 -1
  99. package/dist/features/trial-session/comps/test-prep/test-prep.js +31 -29
  100. package/dist/features/trial-session/comps/test-prep/test-prep.js.map +1 -1
  101. package/dist/features/trial-session/comps/topic-selection/topic-selection-styled.js +42 -0
  102. package/dist/features/trial-session/comps/topic-selection/topic-selection-styled.js.map +1 -0
  103. package/dist/features/trial-session/comps/topic-selection/topic-selection.js +84 -0
  104. package/dist/features/trial-session/comps/topic-selection/topic-selection.js.map +1 -0
  105. package/dist/features/trial-session/comps/whiteboard/whiteboard-styled.js +21 -0
  106. package/dist/features/trial-session/comps/whiteboard/whiteboard-styled.js.map +1 -0
  107. package/dist/features/trial-session/comps/whiteboard/whiteboard.js +99 -0
  108. package/dist/features/trial-session/comps/whiteboard/whiteboard.js.map +1 -0
  109. package/dist/features/trial-session/comps/worksheet/worksheet.js +35 -33
  110. package/dist/features/trial-session/comps/worksheet/worksheet.js.map +1 -1
  111. package/dist/features/trial-session/context/trial-session-context.js +2 -0
  112. package/dist/features/trial-session/context/trial-session-context.js.map +1 -1
  113. package/dist/features/trial-session/helper.js +70 -64
  114. package/dist/features/trial-session/helper.js.map +1 -1
  115. package/dist/features/trial-session/hooks/use-trial-session-navigation.js +190 -158
  116. package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
  117. package/dist/features/trial-session/right-panel/right-panel-styled.js +8 -8
  118. package/dist/features/trial-session/right-panel/right-panel-styled.js.map +1 -1
  119. package/dist/features/trial-session/right-panel/slide-components-map.js +42 -36
  120. package/dist/features/trial-session/right-panel/slide-components-map.js.map +1 -1
  121. package/dist/features/trial-session/trial-session-constants.js +22 -18
  122. package/dist/features/trial-session/trial-session-constants.js.map +1 -1
  123. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  124. package/dist/features/trial-session/trial-session-view.js +82 -77
  125. package/dist/features/trial-session/trial-session-view.js.map +1 -1
  126. package/dist/features/trial-session/trial-session.js +38 -38
  127. package/dist/features/trial-session/trial-session.js.map +1 -1
  128. package/dist/features/ui/inputs/checkbox-input/checkbox-input.js +21 -21
  129. package/dist/features/ui/inputs/checkbox-input/checkbox-input.js.map +1 -1
  130. package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js +12 -12
  131. package/dist/features/ui/inputs/checkbox-input-list/checkbox-input-list.js.map +1 -1
  132. package/dist/features/ui/theme/clrs.js +1 -0
  133. package/dist/features/ui/theme/clrs.js.map +1 -1
  134. package/dist/features/worksheet/worksheet/mocks/activity.js +6 -0
  135. package/dist/features/worksheet/worksheet/mocks/activity.js.map +1 -0
  136. package/dist/features/worksheet/worksheet/mocks/signed-requests.js +5 -0
  137. package/dist/features/worksheet/worksheet/mocks/signed-requests.js.map +1 -0
  138. package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js +57 -0
  139. package/dist/features/worksheet/worksheet/stories/use-canvas-sync-broker-story.js.map +1 -0
  140. package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js +263 -0
  141. package/dist/features/worksheet/worksheet/stories/worksheet-story-container.js.map +1 -0
  142. package/dist/features/worksheet/worksheet/stories/worksheet-student.js +177 -0
  143. package/dist/features/worksheet/worksheet/stories/worksheet-student.js.map +1 -0
  144. package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js +268 -0
  145. package/dist/features/worksheet/worksheet/stories/worksheet-teacher.js.map +1 -0
  146. package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js +51 -32
  147. package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js.map +1 -1
  148. package/dist/features/worksheet/worksheet/worksheet-helpers.js +38 -37
  149. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  150. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-computed-properties.js +36 -35
  151. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-computed-properties.js.map +1 -1
  152. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-questions-from-items.js +61 -58
  153. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-questions-from-items.js.map +1 -1
  154. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  155. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +32 -30
  156. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
  157. package/dist/index.d.ts +12 -6
  158. package/dist/index.js +148 -150
  159. package/dist/index.js.map +1 -1
  160. package/dist/node_modules/uuid/dist/esm-browser/regex.js +5 -0
  161. package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +1 -0
  162. package/dist/node_modules/uuid/dist/esm-browser/rng.js +2 -3
  163. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
  164. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +10 -6
  165. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
  166. package/dist/node_modules/uuid/dist/esm-browser/v4.js +9 -12
  167. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
  168. package/dist/node_modules/uuid/dist/esm-browser/validate.js +8 -0
  169. package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +1 -0
  170. package/dist/types/models/worksheet.js +1 -1
  171. package/dist/types/models/worksheet.js.map +1 -1
  172. package/package.json +1 -1
  173. package/dist/features/sheets/utils/is-v3-worksheet.js +0 -55
  174. package/dist/features/sheets/utils/is-v3-worksheet.js.map +0 -1
  175. package/dist/node_modules/uuid/dist/esm-browser/native.js +0 -7
  176. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"get-questions-from-items.js","sources":["../../../../../../src/features/worksheet/worksheet/worksheet-store/helpers/get-questions-from-items.ts"],"sourcesContent":["import { EWorksheetActivity, type TNodeTypes } from '../../../../../types/models/worksheet';\nimport { OPTIONAL_ITEM_TYPES } from '../../constants';\nimport { isConceptIntroWidget } from '../../worksheet-helpers';\nimport {\n QUESTION_TAGS,\n type ILearnosityItem,\n type IWorksheetProps,\n type IWorksheetQuestion,\n type TItemType,\n type TSectionName,\n} from '../../worksheet-types';\n\ninterface IGetSectionNameFromItemType {\n (itemType?: TItemType): TSectionName | undefined;\n}\n\nconst getSectionNameFromItemType: IGetSectionNameFromItemType = itemType => {\n switch (itemType) {\n case 'overview':\n return 'overview';\n case 'learning':\n case 'learning-we-do':\n case 'learning-your-turn':\n case 'learning-explore':\n return 'learning';\n case 'practice':\n return 'practice';\n case 'practice-basic':\n case 'practice-basic-optional':\n return 'practice-basic';\n case 'practice-regular':\n case 'practice-regular-optional':\n return 'practice-regular';\n case 'exit-ticket':\n return 'exit-ticket';\n case 'advanced-explore':\n case 'advanced-we-do':\n case 'advanced-your-turn':\n case 'advanced-practice':\n return 'advanced';\n default:\n return undefined;\n }\n};\n\nconst getTagsMap = (tags: string[]): Record<string, string> => {\n return tags.reduce((acc, tag) => {\n const [key, value] = tag.split(':');\n const trimmedKey = key?.trim();\n const trimmedValue = value?.trim();\n\n if (!trimmedKey || !trimmedValue) {\n return acc;\n }\n\n return {\n ...acc,\n [trimmedKey.toLowerCase()]: trimmedValue,\n };\n }, {});\n};\n\ninterface IGetQuestionsFromItems {\n (\n items: ILearnosityItem[],\n options: {\n nodeType: TNodeTypes;\n activityType: IWorksheetProps['activityType'];\n },\n ): IWorksheetQuestion[];\n}\nconst getQuestionsFromItems: IGetQuestionsFromItems = (items, { nodeType, activityType }) => {\n const questionsMap: Record<string, IWorksheetQuestion> = (() => {\n return items.reduce(\n (acc, item, itemIndex) =>\n item.questions.reduce((accInner, question, questionIndex) => {\n accInner[question.response_id] = {\n ...question,\n // Some questions are set to limited number of attempts which can show feedback which is causing the question to be stuck in the errored state\n feedback_attempts: undefined,\n item_reference: item.reference,\n item_number: itemIndex,\n item_display_number: itemIndex + 1,\n item_tags: item.tags ?? [],\n item_tags_map: getTagsMap(item.tags ?? []),\n question_number: questionIndex,\n total_questions: item.questions.length,\n can_scribble: true,\n };\n\n return accInner;\n }, acc),\n {} as Record<string, IWorksheetQuestion>,\n );\n })();\n\n if (\n nodeType === 'LEARNING' &&\n (activityType === EWorksheetActivity.LESSON_V3 ||\n activityType == EWorksheetActivity.LESSON_V3_1)\n ) {\n return items.reduce((acc, item, itemIndex) => {\n let hasIntroWidget = false;\n let conceptIntroStimulus: string | undefined;\n const { content, itemType } = item;\n const sectionName = getSectionNameFromItemType(itemType);\n const prevItem = acc[acc.length - 1];\n const itemDisplayNumber =\n sectionName === prevItem?.section_name && prevItem?.item_display_number\n ? prevItem.item_display_number + 1\n : 1;\n const orderedQuestionIds = content.match(/question-[^\"]*/g);\n const orderedQuestions = orderedQuestionIds?.reduce(\n (accQuestions, responseId, widgetIndex) => {\n const question = questionsMap[responseId.replace('question-', '')];\n\n if (!question) {\n throw new Error(`Question not found for the response id: ${responseId}`);\n }\n\n const isConceptIntro = isConceptIntroWidget(question.instructor_stimulus);\n\n hasIntroWidget = hasIntroWidget || isConceptIntro;\n\n if (isConceptIntro && activityType === EWorksheetActivity.LESSON_V3_1) {\n conceptIntroStimulus = question.stimulus;\n\n return accQuestions;\n }\n\n accQuestions.push({\n ...question,\n concept_intro_stimulus: conceptIntroStimulus,\n is_non_question:\n activityType === EWorksheetActivity.LESSON_V3_1 && itemType === 'overview',\n item_display_number: itemDisplayNumber,\n section_name: sectionName,\n item_type: itemType,\n is_optional: itemType ? OPTIONAL_ITEM_TYPES.includes(itemType) : false,\n question_number: widgetIndex - (hasIntroWidget ? 1 : 0),\n total_questions: orderedQuestionIds.length,\n can_scribble: !(itemType === 'overview' || isConceptIntro),\n } as IWorksheetQuestion);\n\n if (conceptIntroStimulus) conceptIntroStimulus = undefined;\n\n return accQuestions;\n },\n [] as IWorksheetQuestion[],\n );\n\n hasIntroWidget = false;\n\n if (orderedQuestions?.[0] && itemIndex > 0 && items.length > 0) {\n const prevItemType = items[itemIndex - 1]?.itemType;\n const itemTypeDerived = itemType?.startsWith('advanced-') ? 'advanced' : itemType;\n const prevItemTypeDerived = prevItemType?.startsWith('advanced-')\n ? 'advanced'\n : prevItemType;\n\n if (\n (itemTypeDerived === 'practice' ||\n itemTypeDerived === 'practice-basic' ||\n itemTypeDerived === 'practice-regular' ||\n itemTypeDerived === 'exit-ticket' ||\n itemTypeDerived === 'advanced') &&\n itemTypeDerived !== prevItemTypeDerived\n ) {\n return [\n ...acc,\n {\n ...orderedQuestions[0],\n metadata: {\n ...orderedQuestions[0].metadata,\n teacher_tips: undefined,\n hints: undefined,\n solution: undefined,\n },\n instructor_stimulus: 'SystemIntro',\n response_id: `${itemType}-system-intro`,\n is_optional: itemType?.startsWith('advanced-'),\n is_non_question: activityType === EWorksheetActivity.LESSON_V3_1,\n can_scribble: false,\n },\n ...(orderedQuestions ?? []),\n ];\n }\n }\n\n return [...acc, ...(orderedQuestions ?? [])];\n }, [] as IWorksheetQuestion[]);\n }\n\n const finalQuestions = items.reduce((acc, item) => {\n const { content } = item;\n const orderedQuestionIds = content.match(/question-[^\"]*/g);\n const orderedQuestions = orderedQuestionIds?.map<IWorksheetQuestion>(\n (responseId, widgetIndex) => {\n const question = questionsMap[responseId.replace('question-', '')];\n\n if (!question) {\n throw new Error(`Question not found for the response id: ${responseId}`);\n }\n\n return {\n ...question,\n question_number: widgetIndex,\n total_questions: orderedQuestionIds.length,\n };\n },\n );\n\n return [...acc, ...(orderedQuestions ?? [])];\n }, [] as IWorksheetQuestion[]);\n\n if (nodeType === 'TRIAL_DIAGNOSTIC') {\n const topics: string[] = [];\n const topicsOrder: Record<string, number> = {};\n\n return finalQuestions\n .sort((a, b) => {\n const aTopic = a.item_tags_map[QUESTION_TAGS.TRIAL_TOPIC];\n const bTopic = b.item_tags_map[QUESTION_TAGS.TRIAL_TOPIC];\n\n if (aTopic && topicsOrder[aTopic] === undefined) {\n topicsOrder[aTopic] = topics.length;\n topics.push(aTopic);\n }\n\n if (bTopic && topicsOrder[bTopic] === undefined) {\n topicsOrder[bTopic] = topics.length;\n topics.push(bTopic);\n }\n\n if (!aTopic || !bTopic) {\n return 0;\n }\n\n const aSortKey = `${topicsOrder[aTopic]}-${\n a.item_tags_map[QUESTION_TAGS.QUESTION_CODE]?.length ?? 0\n }`;\n const bSortKey = `${topicsOrder[bTopic]}-${\n b.item_tags_map[QUESTION_TAGS.QUESTION_CODE]?.length ?? 0\n }`;\n\n return aSortKey > bSortKey ? 1 : -1;\n })\n .map(question => {\n const topicOrder =\n topicsOrder[question.item_tags_map[QUESTION_TAGS.TRIAL_TOPIC] ?? ''] ?? 0;\n const questionCode = question.item_tags_map[QUESTION_TAGS.QUESTION_CODE] ?? '';\n\n return {\n ...question,\n item_display_number: topicOrder * 3 + questionCode.length,\n };\n });\n }\n\n return finalQuestions;\n};\n\nexport { getQuestionsFromItems };\n"],"names":["getSectionNameFromItemType","itemType","getTagsMap","tags","acc","tag","key","value","trimmedKey","trimmedValue","getQuestionsFromItems","items","nodeType","activityType","questionsMap","item","itemIndex","accInner","question","questionIndex","EWorksheetActivity","hasIntroWidget","conceptIntroStimulus","content","sectionName","prevItem","itemDisplayNumber","orderedQuestionIds","orderedQuestions","accQuestions","responseId","widgetIndex","isConceptIntro","isConceptIntroWidget","OPTIONAL_ITEM_TYPES","prevItemType","_a","itemTypeDerived","prevItemTypeDerived","finalQuestions","topics","topicsOrder","a","b","aTopic","QUESTION_TAGS","bTopic","aSortKey","bSortKey","_b","topicOrder","questionCode"],"mappings":";;;;AAgBA,MAAMA,IAA0D,CAAYC,MAAA;AAC1E,UAAQA,GAAU;AAAA,IAChB,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT;AACS;AAAA,EACX;AACF,GAEMC,IAAa,CAACC,MACXA,EAAK,OAAO,CAACC,GAAKC,MAAQ;AAC/B,QAAM,CAACC,GAAKC,CAAK,IAAIF,EAAI,MAAM,GAAG,GAC5BG,IAAaF,KAAA,gBAAAA,EAAK,QAClBG,IAAeF,KAAA,gBAAAA,EAAO;AAExB,SAAA,CAACC,KAAc,CAACC,IACXL,IAGF;AAAA,IACL,GAAGA;AAAA,IACH,CAACI,EAAW,YAAY,CAAC,GAAGC;AAAA,EAAA;AAEhC,GAAG,CAAE,CAAA,GAYDC,IA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IACMY,IAAW,GAAGP,EAAYK,CAAM,CAAC,MACrCG,IAAAN,EAAE,cAAcE,EAAc,aAAa,MAA3C,gBAAAI,EAA8C,WAAU,CAC1D;AAEO,aAAAF,IAAWC,IAAW,IAAI;AAAA,IAAA,CAClC,EACA,IAAI,CAAY9B,MAAA;AACT,YAAAgC,IACJT,EAAYvB,EAAS,cAAc2B,EAAc,WAAW,KAAK,EAAE,KAAK,GACpEM,IAAejC,EAAS,cAAc2B,EAAc,aAAa,KAAK;AAErE,aAAA;AAAA,QACL,GAAG3B;AAAA,QACH,qBAAqBgC,IAAa,IAAIC,EAAa;AAAA,MAAA;AAAA,IACrD,CACD;AAAA,EACL;AAEO,SAAAZ;AACT;"}
1
+ {"version":3,"file":"get-questions-from-items.js","sources":["../../../../../../src/features/worksheet/worksheet/worksheet-store/helpers/get-questions-from-items.ts"],"sourcesContent":["import { EWorksheetActivity, type TNodeTypes } from '../../../../../types/models/worksheet';\nimport { OPTIONAL_ITEM_TYPES } from '../../constants';\nimport { isConceptIntroWidget } from '../../worksheet-helpers';\nimport {\n QUESTION_TAGS,\n type ILearnosityItem,\n type IWorksheetProps,\n type IWorksheetQuestion,\n type TItemType,\n type TSectionName,\n} from '../../worksheet-types';\n\ninterface IGetSectionNameFromItemType {\n (itemType?: TItemType): TSectionName | undefined;\n}\n\nconst getSectionNameFromItemType: IGetSectionNameFromItemType = itemType => {\n switch (itemType) {\n case 'overview':\n return 'overview';\n case 'learning':\n case 'learning-we-do':\n case 'learning-your-turn':\n case 'learning-explore':\n return 'learning';\n case 'practice':\n return 'practice';\n case 'practice-basic':\n case 'practice-basic-optional':\n return 'practice-basic';\n case 'practice-regular':\n case 'practice-regular-optional':\n return 'practice-regular';\n case 'exit-ticket':\n return 'exit-ticket';\n case 'advanced-explore':\n case 'advanced-we-do':\n case 'advanced-your-turn':\n case 'advanced-practice':\n return 'advanced';\n default:\n return undefined;\n }\n};\n\nconst getTagsMap = (tags: string[]): Record<string, string> => {\n return tags.reduce((acc, tag) => {\n const [key, value] = tag.split(':');\n const trimmedKey = key?.trim();\n const trimmedValue = value?.trim();\n\n if (!trimmedKey || !trimmedValue) {\n return acc;\n }\n\n return {\n ...acc,\n [trimmedKey.toLowerCase()]: trimmedValue,\n };\n }, {});\n};\n\ninterface IGetQuestionsFromItems {\n (\n items: ILearnosityItem[],\n options: {\n nodeType: TNodeTypes;\n activityType: IWorksheetProps['activityType'];\n selectedTopics?: IWorksheetProps['selectedTopics'];\n },\n ): IWorksheetQuestion[];\n}\nconst getQuestionsFromItems: IGetQuestionsFromItems = (\n items,\n { nodeType, activityType, selectedTopics },\n) => {\n const filteredItems =\n selectedTopics && selectedTopics.length > 0\n ? items.filter(item => {\n const itemTagsMap = getTagsMap(item.tags ?? []);\n\n return selectedTopics.includes(itemTagsMap['trial-topic'] ?? '');\n })\n : items;\n\n const questionsMap: Record<string, IWorksheetQuestion> = (() => {\n return filteredItems.reduce(\n (acc, item, itemIndex) =>\n item.questions.reduce((accInner, question, questionIndex) => {\n accInner[question.response_id] = {\n ...question,\n // Some questions are set to limited number of attempts which can show feedback which is causing the question to be stuck in the errored state\n feedback_attempts: undefined,\n item_reference: item.reference,\n item_number: itemIndex,\n item_display_number: itemIndex + 1,\n item_tags: item.tags ?? [],\n item_tags_map: getTagsMap(item.tags ?? []),\n question_number: questionIndex,\n total_questions: item.questions.length,\n can_scribble: true,\n };\n\n return accInner;\n }, acc),\n {} as Record<string, IWorksheetQuestion>,\n );\n })();\n\n if (\n nodeType === 'LEARNING' &&\n (activityType === EWorksheetActivity.LESSON_V3 ||\n activityType == EWorksheetActivity.LESSON_V3_1)\n ) {\n return items.reduce((acc, item, itemIndex) => {\n let hasIntroWidget = false;\n let conceptIntroStimulus: string | undefined;\n const { content, itemType } = item;\n const sectionName = getSectionNameFromItemType(itemType);\n const prevItem = acc[acc.length - 1];\n const itemDisplayNumber =\n sectionName === prevItem?.section_name && prevItem?.item_display_number\n ? prevItem.item_display_number + 1\n : 1;\n const orderedQuestionIds = content.match(/question-[^\"]*/g);\n const orderedQuestions = orderedQuestionIds?.reduce(\n (accQuestions, responseId, widgetIndex) => {\n const question = questionsMap[responseId.replace('question-', '')];\n\n if (!question) {\n throw new Error(`Question not found for the response id: ${responseId}`);\n }\n\n const isConceptIntro = isConceptIntroWidget(question.instructor_stimulus);\n\n hasIntroWidget = hasIntroWidget || isConceptIntro;\n\n if (isConceptIntro && activityType === EWorksheetActivity.LESSON_V3_1) {\n conceptIntroStimulus = question.stimulus;\n\n return accQuestions;\n }\n\n accQuestions.push({\n ...question,\n concept_intro_stimulus: conceptIntroStimulus,\n is_non_question:\n activityType === EWorksheetActivity.LESSON_V3_1 && itemType === 'overview',\n item_display_number: itemDisplayNumber,\n section_name: sectionName,\n item_type: itemType,\n is_optional: itemType ? OPTIONAL_ITEM_TYPES.includes(itemType) : false,\n question_number: widgetIndex - (hasIntroWidget ? 1 : 0),\n total_questions: orderedQuestionIds.length,\n can_scribble: !(itemType === 'overview' || isConceptIntro),\n } as IWorksheetQuestion);\n\n if (conceptIntroStimulus) conceptIntroStimulus = undefined;\n\n return accQuestions;\n },\n [] as IWorksheetQuestion[],\n );\n\n hasIntroWidget = false;\n\n if (orderedQuestions?.[0] && itemIndex > 0 && items.length > 0) {\n const prevItemType = items[itemIndex - 1]?.itemType;\n const itemTypeDerived = itemType?.startsWith('advanced-') ? 'advanced' : itemType;\n const prevItemTypeDerived = prevItemType?.startsWith('advanced-')\n ? 'advanced'\n : prevItemType;\n\n if (\n (itemTypeDerived === 'practice' ||\n itemTypeDerived === 'practice-basic' ||\n itemTypeDerived === 'practice-regular' ||\n itemTypeDerived === 'exit-ticket' ||\n itemTypeDerived === 'advanced') &&\n itemTypeDerived !== prevItemTypeDerived\n ) {\n return [\n ...acc,\n {\n ...orderedQuestions[0],\n metadata: {\n ...orderedQuestions[0].metadata,\n teacher_tips: undefined,\n hints: undefined,\n solution: undefined,\n },\n instructor_stimulus: 'SystemIntro',\n response_id: `${itemType}-system-intro`,\n is_optional: itemType?.startsWith('advanced-'),\n is_non_question: activityType === EWorksheetActivity.LESSON_V3_1,\n can_scribble: false,\n },\n ...(orderedQuestions ?? []),\n ];\n }\n }\n\n return [...acc, ...(orderedQuestions ?? [])];\n }, [] as IWorksheetQuestion[]);\n }\n\n const finalQuestions = filteredItems.reduce((acc, item) => {\n const { content } = item;\n const orderedQuestionIds = content.match(/question-[^\"]*/g);\n const orderedQuestions = orderedQuestionIds?.map<IWorksheetQuestion>(\n (responseId, widgetIndex) => {\n const question = questionsMap[responseId.replace('question-', '')];\n\n if (!question) {\n throw new Error(`Question not found for the response id: ${responseId}`);\n }\n\n return {\n ...question,\n question_number: widgetIndex,\n total_questions: orderedQuestionIds.length,\n };\n },\n );\n\n return [...acc, ...(orderedQuestions ?? [])];\n }, [] as IWorksheetQuestion[]);\n\n if (nodeType === 'TRIAL_DIAGNOSTIC') {\n const topics: string[] = [];\n const topicsOrder: Record<string, number> = {};\n\n return finalQuestions\n .sort((a, b) => {\n const aTopic = a.item_tags_map[QUESTION_TAGS.TRIAL_TOPIC];\n const bTopic = b.item_tags_map[QUESTION_TAGS.TRIAL_TOPIC];\n\n if (aTopic && topicsOrder[aTopic] === undefined) {\n topicsOrder[aTopic] = topics.length;\n topics.push(aTopic);\n }\n\n if (bTopic && topicsOrder[bTopic] === undefined) {\n topicsOrder[bTopic] = topics.length;\n topics.push(bTopic);\n }\n\n if (!aTopic || !bTopic) {\n return 0;\n }\n\n const aSortKey = `${topicsOrder[aTopic]}-${\n a.item_tags_map[QUESTION_TAGS.QUESTION_CODE]?.length ?? 0\n }`;\n const bSortKey = `${topicsOrder[bTopic]}-${\n b.item_tags_map[QUESTION_TAGS.QUESTION_CODE]?.length ?? 0\n }`;\n\n return aSortKey > bSortKey ? 1 : -1;\n })\n .map(question => {\n const topicOrder =\n topicsOrder[question.item_tags_map[QUESTION_TAGS.TRIAL_TOPIC] ?? ''] ?? 0;\n const questionCode = question.item_tags_map[QUESTION_TAGS.QUESTION_CODE] ?? '';\n\n return {\n ...question,\n item_display_number: topicOrder * 3 + questionCode.length,\n };\n });\n }\n\n return finalQuestions;\n};\n\nexport { getQuestionsFromItems };\n"],"names":["getSectionNameFromItemType","itemType","getTagsMap","tags","acc","tag","key","value","trimmedKey","trimmedValue","getQuestionsFromItems","items","nodeType","activityType","selectedTopics","filteredItems","item","itemTagsMap","questionsMap","itemIndex","accInner","question","questionIndex","EWorksheetActivity","hasIntroWidget","conceptIntroStimulus","content","sectionName","prevItem","itemDisplayNumber","orderedQuestionIds","orderedQuestions","accQuestions","responseId","widgetIndex","isConceptIntro","isConceptIntroWidget","OPTIONAL_ITEM_TYPES","prevItemType","_a","itemTypeDerived","prevItemTypeDerived","finalQuestions","topics","topicsOrder","a","b","aTopic","QUESTION_TAGS","bTopic","aSortKey","bSortKey","_b","topicOrder","questionCode"],"mappings":";;;;AAgBA,MAAMA,IAA0D,CAAYC,MAAA;AAC1E,UAAQA,GAAU;AAAA,IAChB,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,IACT;AACS;AAAA,EACX;AACF,GAEMC,IAAa,CAACC,MACXA,EAAK,OAAO,CAACC,GAAKC,MAAQ;AAC/B,QAAM,CAACC,GAAKC,CAAK,IAAIF,EAAI,MAAM,GAAG,GAC5BG,IAAaF,KAAA,gBAAAA,EAAK,QAClBG,IAAeF,KAAA,gBAAAA,EAAO;AAExB,SAAA,CAACC,KAAc,CAACC,IACXL,IAGF;AAAA,IACL,GAAGA;AAAA,IACH,CAACI,EAAW,YAAY,CAAC,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,IAGhBE,KAAUL,EAAYK,CAAM,MAAM,WACxBL,EAAAK,CAAM,IAAIN,EAAO,QAC7BA,EAAO,KAAKM,CAAM,IAGhB,CAACF,KAAU,CAACE;AACP,eAAA;AAGT,YAAMC,IAAW,GAAGN,EAAYG,CAAM,CAAC,MACrCR,IAAAM,EAAE,cAAcG,EAAc,aAAa,MAA3C,gBAAAT,EAA8C,WAAU,CAC1D,IACMY,IAAW,GAAGP,EAAYK,CAAM,CAAC,MACrCG,IAAAN,EAAE,cAAcE,EAAc,aAAa,MAA3C,gBAAAI,EAA8C,WAAU,CAC1D;AAEO,aAAAF,IAAWC,IAAW,IAAI;AAAA,IAAA,CAClC,EACA,IAAI,CAAY9B,MAAA;AACT,YAAAgC,IACJT,EAAYvB,EAAS,cAAc2B,EAAc,WAAW,KAAK,EAAE,KAAK,GACpEM,IAAejC,EAAS,cAAc2B,EAAc,aAAa,KAAK;AAErE,aAAA;AAAA,QACL,GAAG3B;AAAA,QACH,qBAAqBgC,IAAa,IAAIC,EAAa;AAAA,MAAA;AAAA,IACrD,CACD;AAAA,EACL;AAEO,SAAAZ;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement, ReactNode } from 'react';\n\nimport type { EWorksheetActivity, TNodeTypes } from '../../../types/models/worksheet';\nimport type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\nimport type { TWorksheetBlocker } from './worksheet-blocker/worksheet-blocker-types';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n acknowledgements?: string;\n sample_answer?: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\n\nexport type TItemType =\n | 'overview'\n | 'learning'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\ninterface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n /**\n * If true, the question is not a question, but a content only item\n * e.g. Intro, Overview, Instruction etc.\n */\n is_non_question?: boolean;\n concept_intro_stimulus?: string; // Content for concept intro widget\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n /**\n * if true, scribbler button will be shown on the question\n */\n can_scribble: boolean; // If true, the question can be scribbled on\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\ninterface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n /**\n * For non question questions, when user click on start, responseGiven will be true\n */\n responseGiven?: boolean;\n retryEnabled?: boolean;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n discussionQuestionOffset?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, after the question is system validated, teacher discussion button will be shown when the question has discussion points.\n */\n teacherDiscussionEnabled?: boolean;\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * This needs teacherValidationEnabled to be true\n * TODO: Consider changing to accept validation type: 'system' | 'teacher' | undefined instead of boolean\n */\n canTeacherValidate: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, solution wont be shown to the user.\n */\n solutionHidden?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n\n /**\n * After attemptsAfterTeacherInterventionNeeded incorrect attempts, retry button will be disabled in class, move ahead button will show ouside class.\n */\n attemptsAfterTeacherInterventionNeeded?: number;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n\n // If true, canvas is enabled and user can use canvas to scribble on the worksheet by toggling the scribble button\n canvasEnabled?: boolean;\n\n // If true, the user can scribble on workheet\n canScribble?: boolean;\n}\n\nexport type TWORKSHEET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onAllowRetry?: (questionId: string) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (\n responses: Record<string, IWorksheetResponse>,\n questions: IWorksheetQuestion[],\n ) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n onResolveDoubt?: (responseId: string) => void;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\ninterface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\ninterface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\ninterface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n background?: 'none' | 'paper';\n questionPadding: number;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n initialResponseId?: string;\n initialItemIndex?: number;\n layout: IWorksheetLayout;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n canResolveDoubt?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n activityType: EWorksheetActivity | null;\n isDesmosEnabled?: boolean; // If true, the worksheet can show desmos calculator\n nodeType: TNodeTypes; // NodeType of the worksheet\n mode: 'resume' | 'review' | 'preview'; // mode of the worksheet\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\ninterface IWorksheetPlugins {\n plugins?: {\n stickers?: ReactNode;\n };\n}\n\ninterface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\ninterface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n allowRetry: (responseId: string) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n\nexport type TWorksheetStoreProps = Omit<\n IBaseWorksheetProps,\n 'studentName' | 'itemsSignedRequest' | 'mode'\n> &\n Required<Pick<IBaseWorksheetProps, 'studentName'>> &\n Omit<IWorksheetCallbackProps, 'onLoaded' | 'onErrored'> &\n ICueCanvasProps &\n ICueCanvasCallbackProps &\n IPointerSyncCallbackProps &\n IWorksheetPlugins & {\n behavior: IWorksheetBehavior;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n };\n\nexport enum EActiveQuestionTool {\n TEACHING_TOOLS = 'TEACHING_TOOLS',\n SOLUTION = 'SOLUTION',\n DISCUSSION = 'DISCUSSION',\n}\n\nexport interface IWorksheetStoreState {\n questions: IWorksheetQuestion[];\n renderableQuestions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n lastUnlockedQuestionIndex: number;\n initialQuestionId: string;\n activeQuestionId: string;\n activeQuestionIndex: number;\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n summaryVisible: boolean;\n calculatorVisible: boolean;\n scribblingEnabled: boolean;\n activeQuestionTool?: EActiveQuestionTool;\n blocker?: TWorksheetBlocker;\n scrolledToInitialQuestion: boolean;\n}\n\n// Actions interface - contains all the methods\ninterface IWorksheetStoreActions {\n mergeWorksheetProps: (data: TWorksheetStoreProps) => void;\n setResponses: (\n responses:\n | IWorksheetStore['responses']\n | ((prevResponses: IWorksheetStore['responses']) => IWorksheetStore['responses']),\n ) => void;\n showSummary: () => void;\n hideSummary: () => void;\n toggleSummary: () => void;\n toggleCalculator: () => void;\n toggleScribble: () => void;\n setBlocker: (blocker?: TWorksheetBlocker) => void;\n /**\n *\n * @param scrollToLastUnlockedQuestion - If true, scrolls to the last unlocked question after removing the blocker. Default is true.\n * @returns\n */\n removeBlocker: (scrollToLastUnlockedQuestion?: boolean) => void;\n updateResponse: (options: {\n responseId: string;\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n timeSpent: number;\n answerChecked?: boolean;\n }) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n setDiscussionQuestionOffset: (responseId: string, offset: number) => void;\n markForReview: (responseId: string, markedForReview: boolean) => void;\n changeQuestion: (questionId: string, shouldScroll?: boolean, scrollDelay?: number) => void;\n setActiveQuestionTool: (tool: EActiveQuestionTool) => void;\n unsetActiveQuestionTool: () => void;\n destroy: () => void;\n}\n\n// Combined store interface\nexport interface IWorksheetStore\n extends IWorksheetStoreState,\n TWorksheetStoreProps,\n IWorksheetStoreActions {}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING","EActiveQuestionTool"],"mappings":"AASY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA,GAsjBAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,WAAW,YACXA,EAAA,aAAa,cAHHA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement, ReactNode } from 'react';\n\nimport type { EWorksheetActivity, TNodeTypes } from '../../../types/models/worksheet';\nimport type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\nimport type { TWorksheetBlocker } from './worksheet-blocker/worksheet-blocker-types';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n acknowledgements?: string;\n sample_answer?: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\n\nexport type TItemType =\n | 'overview'\n | 'learning'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\ninterface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n /**\n * If true, the question is not a question, but a content only item\n * e.g. Intro, Overview, Instruction etc.\n */\n is_non_question?: boolean;\n concept_intro_stimulus?: string; // Content for concept intro widget\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n /**\n * if true, scribbler button will be shown on the question\n */\n can_scribble: boolean; // If true, the question can be scribbled on\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\ninterface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n /**\n * For non question questions, when user click on start, responseGiven will be true\n */\n responseGiven?: boolean;\n retryEnabled?: boolean;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n discussionQuestionOffset?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, after the question is system validated, teacher discussion button will be shown when the question has discussion points.\n */\n teacherDiscussionEnabled?: boolean;\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * This needs teacherValidationEnabled to be true\n * TODO: Consider changing to accept validation type: 'system' | 'teacher' | undefined instead of boolean\n */\n canTeacherValidate: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, solution wont be shown to the user.\n */\n solutionHidden?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n\n /**\n * After attemptsAfterTeacherInterventionNeeded incorrect attempts, retry button will be disabled in class, move ahead button will show ouside class.\n */\n attemptsAfterTeacherInterventionNeeded?: number;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n\n // If true, canvas is enabled and user can use canvas to scribble on the worksheet by toggling the scribble button\n canvasEnabled?: boolean;\n\n // If true, the user can scribble on workheet\n canScribble?: boolean;\n}\n\nexport type TWORKSHEET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onAllowRetry?: (questionId: string) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (\n responses: Record<string, IWorksheetResponse>,\n questions: IWorksheetQuestion[],\n ) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n onResolveDoubt?: (responseId: string) => void;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\ninterface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\ninterface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\ninterface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n background?: 'none' | 'paper';\n questionPadding: number;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n initialResponseId?: string;\n initialItemIndex?: number;\n layout: IWorksheetLayout;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n canResolveDoubt?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n selectedTopics?: string[];\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n activityType: EWorksheetActivity | null;\n isDesmosEnabled?: boolean; // If true, the worksheet can show desmos calculator\n nodeType: TNodeTypes; // NodeType of the worksheet\n mode: 'resume' | 'review' | 'preview'; // mode of the worksheet\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\ninterface IWorksheetPlugins {\n plugins?: {\n stickers?: ReactNode;\n };\n}\n\ninterface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\ninterface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n allowRetry: (responseId: string) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n\nexport type TWorksheetStoreProps = Omit<\n IBaseWorksheetProps,\n 'studentName' | 'itemsSignedRequest' | 'mode'\n> &\n Required<Pick<IBaseWorksheetProps, 'studentName'>> &\n Omit<IWorksheetCallbackProps, 'onLoaded' | 'onErrored'> &\n ICueCanvasProps &\n ICueCanvasCallbackProps &\n IPointerSyncCallbackProps &\n IWorksheetPlugins & {\n behavior: IWorksheetBehavior;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n };\n\nexport enum EActiveQuestionTool {\n TEACHING_TOOLS = 'TEACHING_TOOLS',\n SOLUTION = 'SOLUTION',\n DISCUSSION = 'DISCUSSION',\n}\n\nexport interface IWorksheetStoreState {\n questions: IWorksheetQuestion[];\n renderableQuestions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n lastUnlockedQuestionIndex: number;\n initialQuestionId: string;\n activeQuestionId: string;\n activeQuestionIndex: number;\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n summaryVisible: boolean;\n calculatorVisible: boolean;\n scribblingEnabled: boolean;\n activeQuestionTool?: EActiveQuestionTool;\n blocker?: TWorksheetBlocker;\n scrolledToInitialQuestion: boolean;\n}\n\n// Actions interface - contains all the methods\ninterface IWorksheetStoreActions {\n mergeWorksheetProps: (data: TWorksheetStoreProps) => void;\n setResponses: (\n responses:\n | IWorksheetStore['responses']\n | ((prevResponses: IWorksheetStore['responses']) => IWorksheetStore['responses']),\n ) => void;\n showSummary: () => void;\n hideSummary: () => void;\n toggleSummary: () => void;\n toggleCalculator: () => void;\n toggleScribble: () => void;\n setBlocker: (blocker?: TWorksheetBlocker) => void;\n /**\n *\n * @param scrollToLastUnlockedQuestion - If true, scrolls to the last unlocked question after removing the blocker. Default is true.\n * @returns\n */\n removeBlocker: (scrollToLastUnlockedQuestion?: boolean) => void;\n updateResponse: (options: {\n responseId: string;\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n timeSpent: number;\n answerChecked?: boolean;\n }) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n setDiscussionQuestionOffset: (responseId: string, offset: number) => void;\n markForReview: (responseId: string, markedForReview: boolean) => void;\n changeQuestion: (questionId: string, shouldScroll?: boolean, scrollDelay?: number) => void;\n setActiveQuestionTool: (tool: EActiveQuestionTool) => void;\n unsetActiveQuestionTool: () => void;\n destroy: () => void;\n}\n\n// Combined store interface\nexport interface IWorksheetStore\n extends IWorksheetStoreState,\n TWorksheetStoreProps,\n IWorksheetStoreActions {}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING","EActiveQuestionTool"],"mappings":"AASY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA,GAujBAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,WAAW,YACXA,EAAA,aAAa,cAHHA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,18 +1,20 @@
1
- import { useMemo as i } from "react";
2
- import { QUESTIONS_GAP as L, WORKSHEET_NUDGE_BANNER_HEIGHT as N, TOP_NAVIGATION_HEIGHT as D } from "../../worksheet/constants.js";
3
- const e = ({
4
- userType: c,
5
- nodeType: t,
1
+ import { useMemo as R } from "react";
2
+ import { QUESTIONS_GAP as N, WORKSHEET_NUDGE_BANNER_HEIGHT as d, TOP_NAVIGATION_HEIGHT as h } from "../../worksheet/constants.js";
3
+ import { TRIAL_V3_NODE_TYPES as H } from "../../worksheet/worksheet-behavior-helper.js";
4
+ const L = ({
5
+ userType: n,
6
+ nodeType: r,
6
7
  isSATAssessment: o,
7
- showNudgeBanner: A,
8
+ showNudgeBanner: l,
8
9
  topOffset: a,
9
- imageHue: n
10
+ imageHue: i
10
11
  }) => {
11
- const r = t === "PUZZLE_CARD", I = i(() => {
12
+ const t = r === "PUZZLE_CARD", c = R(() => {
12
13
  if (o) return "bottom";
13
- switch (t) {
14
+ switch (r) {
14
15
  case "PUZZLE_CARD":
15
16
  case "TRIAL_DIAGNOSTIC":
17
+ case "TRIAL":
16
18
  case "TRIAL_BASIC":
17
19
  case "TRIAL_INTERMEDIATE":
18
20
  case "TRIAL_ADVANCED":
@@ -20,39 +22,39 @@ const e = ({
20
22
  default:
21
23
  return "top";
22
24
  }
23
- }, [o, t]), E = I === "top" ? D : 0, R = `calc(100vh - ${a + E}px)`, _ = `calc(100vh - ${a + E}px)`, u = A ? a + N : a;
24
- return i(
25
+ }, [o, r]), E = c === "top" ? h : 0, u = `calc(100vh - ${a + E}px)`, I = `calc(100vh - ${a + E}px)`, _ = l ? a + d : a, e = H.includes(r);
26
+ return R(
25
27
  () => ({
26
- containerStyle: o || r ? "none" : "card",
28
+ containerStyle: o || t ? "none" : "card",
27
29
  //* The width of the container is set based on the user type and whether it is a SAT assessment
28
30
  //* For Puzzle sheets, on student side we are showing a header with 800px fixed width.
29
- containerWidth: o ? "1024px" : c === "TEACHER" ? "100%" : "800px",
31
+ containerWidth: o ? "1024px" : n === "TEACHER" ? "100%" : "800px",
30
32
  actionBar: "bottom",
31
- topOffset: u,
32
- navigationBar: I,
33
- questionsScrollable: !(o || t === "TRIAL_DIAGNOSTIC" || t === "TRIAL_BASIC" || t === "TRIAL_INTERMEDIATE" || t === "TRIAL_ADVANCED"),
34
- minQuestionHeight: R,
35
- minSummaryHeight: _,
36
- renderSideBar: c === "TEACHER" && !o,
37
- renderQuestionHeader: !r,
38
- imageHue: n,
39
- background: o || r ? "none" : "paper",
40
- questionPadding: r ? 0 : L
33
+ topOffset: _,
34
+ navigationBar: c,
35
+ questionsScrollable: !(o || e),
36
+ minQuestionHeight: u,
37
+ minSummaryHeight: I,
38
+ renderSideBar: n === "TEACHER" && !o,
39
+ renderQuestionHeader: !t,
40
+ imageHue: i,
41
+ background: o || t ? "none" : "paper",
42
+ questionPadding: t || e ? 0 : N
41
43
  }),
42
44
  [
43
45
  o,
44
- r,
46
+ t,
47
+ n,
48
+ _,
45
49
  c,
50
+ e,
46
51
  u,
47
52
  I,
48
- t,
49
- R,
50
- _,
51
- n
53
+ i
52
54
  ]
53
55
  );
54
- }, H = e;
56
+ }, T = L;
55
57
  export {
56
- H as default
58
+ T as default
57
59
  };
58
60
  //# sourceMappingURL=use-worksheet-layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-worksheet-layout.js","sources":["../../../../../src/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { THueNames, TUserTypes } from '../../../ui/types';\nimport {\n QUESTIONS_GAP,\n TOP_NAVIGATION_HEIGHT,\n WORKSHEET_NUDGE_BANNER_HEIGHT,\n} from '../../worksheet/constants';\nimport type { IWorksheetLayout } from '../../worksheet/worksheet-types';\n\ninterface IUseWorksheetLayout {\n (options: {\n userType: TUserTypes;\n nodeType: IResumeWorksheetModel['node_type'];\n isSATAssessment: boolean;\n showNudgeBanner?: boolean;\n topOffset: number;\n imageHue?: THueNames;\n }): IWorksheetLayout;\n}\n\nconst useWorksheetLayout: IUseWorksheetLayout = ({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset,\n imageHue,\n}) => {\n const isPuzzleSheet = nodeType === 'PUZZLE_CARD';\n\n const navigationBar = useMemo<IWorksheetLayout['navigationBar']>(() => {\n if (isSATAssessment) return 'bottom';\n\n switch (nodeType) {\n case 'PUZZLE_CARD':\n case 'TRIAL_DIAGNOSTIC':\n case 'TRIAL_BASIC':\n case 'TRIAL_INTERMEDIATE':\n case 'TRIAL_ADVANCED':\n return 'none';\n default:\n return 'top';\n }\n }, [isSATAssessment, nodeType]);\n\n const navHeight = navigationBar === 'top' ? TOP_NAVIGATION_HEIGHT : 0;\n const minQuestionHeight = `calc(100vh - ${topOffset + navHeight}px)`;\n const minSummaryHeight = `calc(100vh - ${topOffset + navHeight}px)`;\n const tOffset = showNudgeBanner ? topOffset + WORKSHEET_NUDGE_BANNER_HEIGHT : topOffset;\n\n return useMemo<IWorksheetLayout>(\n () => ({\n containerStyle: isSATAssessment || isPuzzleSheet ? 'none' : 'card',\n //* The width of the container is set based on the user type and whether it is a SAT assessment\n //* For Puzzle sheets, on student side we are showing a header with 800px fixed width.\n containerWidth: isSATAssessment ? '1024px' : userType === 'TEACHER' ? '100%' : '800px',\n actionBar: 'bottom',\n topOffset: tOffset,\n navigationBar,\n questionsScrollable: !(\n isSATAssessment ||\n nodeType === 'TRIAL_DIAGNOSTIC' ||\n nodeType === 'TRIAL_BASIC' ||\n nodeType === 'TRIAL_INTERMEDIATE' ||\n nodeType === 'TRIAL_ADVANCED'\n ),\n minQuestionHeight,\n minSummaryHeight,\n renderSideBar: userType === 'TEACHER' && !isSATAssessment,\n renderQuestionHeader: !isPuzzleSheet,\n imageHue,\n background: isSATAssessment || isPuzzleSheet ? 'none' : 'paper',\n questionPadding: isPuzzleSheet ? 0 : QUESTIONS_GAP,\n }),\n [\n isSATAssessment,\n isPuzzleSheet,\n userType,\n tOffset,\n navigationBar,\n nodeType,\n minQuestionHeight,\n minSummaryHeight,\n imageHue,\n ],\n );\n};\n\nexport default useWorksheetLayout;\n"],"names":["useWorksheetLayout","userType","nodeType","isSATAssessment","showNudgeBanner","topOffset","imageHue","isPuzzleSheet","navigationBar","useMemo","navHeight","TOP_NAVIGATION_HEIGHT","minQuestionHeight","minSummaryHeight","tOffset","WORKSHEET_NUDGE_BANNER_HEIGHT","QUESTIONS_GAP","useWorksheetLayout$1"],"mappings":";;AAsBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAgBL,MAAa,eAE7BM,IAAgBC,EAA2C,MAAM;AACrE,QAAIN,EAAwB,QAAA;AAE5B,YAAQD,GAAU;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACI,eAAA;AAAA,MACT;AACS,eAAA;AAAA,IACX;AAAA,EAAA,GACC,CAACC,GAAiBD,CAAQ,CAAC,GAExBQ,IAAYF,MAAkB,QAAQG,IAAwB,GAC9DC,IAAoB,gBAAgBP,IAAYK,CAAS,OACzDG,IAAmB,gBAAgBR,IAAYK,CAAS,OACxDI,IAAUV,IAAkBC,IAAYU,IAAgCV;AAEvE,SAAAI;AAAA,IACL,OAAO;AAAA,MACL,gBAAgBN,KAAmBI,IAAgB,SAAS;AAAA;AAAA;AAAA,MAG5D,gBAAgBJ,IAAkB,WAAWF,MAAa,YAAY,SAAS;AAAA,MAC/E,WAAW;AAAA,MACX,WAAWa;AAAA,MACX,eAAAN;AAAA,MACA,qBAAqB,EACnBL,KACAD,MAAa,sBACbA,MAAa,iBACbA,MAAa,wBACbA,MAAa;AAAA,MAEf,mBAAAU;AAAA,MACA,kBAAAC;AAAA,MACA,eAAeZ,MAAa,aAAa,CAACE;AAAA,MAC1C,sBAAsB,CAACI;AAAA,MACvB,UAAAD;AAAA,MACA,YAAYH,KAAmBI,IAAgB,SAAS;AAAA,MACxD,iBAAiBA,IAAgB,IAAIS;AAAA,IAAA;AAAA,IAEvC;AAAA,MACEb;AAAA,MACAI;AAAA,MACAN;AAAA,MACAa;AAAA,MACAN;AAAA,MACAN;AAAA,MACAU;AAAA,MACAC;AAAA,MACAP;AAAA,IACF;AAAA,EAAA;AAEJ,GAEAW,IAAejB;"}
1
+ {"version":3,"file":"use-worksheet-layout.js","sources":["../../../../../src/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { IResumeWorksheetModel } from '../../../../types/models/worksheet';\nimport type { THueNames, TUserTypes } from '../../../ui/types';\nimport {\n QUESTIONS_GAP,\n TOP_NAVIGATION_HEIGHT,\n WORKSHEET_NUDGE_BANNER_HEIGHT,\n} from '../../worksheet/constants';\nimport type { IWorksheetLayout } from '../../worksheet/worksheet-types';\nimport { TRIAL_V3_NODE_TYPES } from '../../worksheet/worksheet-behavior-helper';\n\ninterface IUseWorksheetLayout {\n (options: {\n userType: TUserTypes;\n nodeType: IResumeWorksheetModel['node_type'];\n isSATAssessment: boolean;\n showNudgeBanner?: boolean;\n topOffset: number;\n imageHue?: THueNames;\n }): IWorksheetLayout;\n}\n\nconst useWorksheetLayout: IUseWorksheetLayout = ({\n userType,\n nodeType,\n isSATAssessment,\n showNudgeBanner,\n topOffset,\n imageHue,\n}) => {\n const isPuzzleSheet = nodeType === 'PUZZLE_CARD';\n\n const navigationBar = useMemo<IWorksheetLayout['navigationBar']>(() => {\n if (isSATAssessment) return 'bottom';\n\n switch (nodeType) {\n case 'PUZZLE_CARD':\n case 'TRIAL_DIAGNOSTIC':\n case 'TRIAL':\n case 'TRIAL_BASIC':\n case 'TRIAL_INTERMEDIATE':\n case 'TRIAL_ADVANCED':\n return 'none';\n default:\n return 'top';\n }\n }, [isSATAssessment, nodeType]);\n\n const navHeight = navigationBar === 'top' ? TOP_NAVIGATION_HEIGHT : 0;\n const minQuestionHeight = `calc(100vh - ${topOffset + navHeight}px)`;\n const minSummaryHeight = `calc(100vh - ${topOffset + navHeight}px)`;\n const tOffset = showNudgeBanner ? topOffset + WORKSHEET_NUDGE_BANNER_HEIGHT : topOffset;\n const isTrialSessionNodes = TRIAL_V3_NODE_TYPES.includes(nodeType);\n\n return useMemo<IWorksheetLayout>(\n () => ({\n containerStyle: isSATAssessment || isPuzzleSheet ? 'none' : 'card',\n //* The width of the container is set based on the user type and whether it is a SAT assessment\n //* For Puzzle sheets, on student side we are showing a header with 800px fixed width.\n containerWidth: isSATAssessment ? '1024px' : userType === 'TEACHER' ? '100%' : '800px',\n actionBar: 'bottom',\n topOffset: tOffset,\n navigationBar,\n questionsScrollable: !(isSATAssessment || isTrialSessionNodes),\n minQuestionHeight,\n minSummaryHeight,\n renderSideBar: userType === 'TEACHER' && !isSATAssessment,\n renderQuestionHeader: !isPuzzleSheet,\n imageHue,\n background: isSATAssessment || isPuzzleSheet ? 'none' : 'paper',\n questionPadding: isPuzzleSheet || isTrialSessionNodes ? 0 : QUESTIONS_GAP,\n }),\n [\n isSATAssessment,\n isPuzzleSheet,\n userType,\n tOffset,\n navigationBar,\n isTrialSessionNodes,\n minQuestionHeight,\n minSummaryHeight,\n imageHue,\n ],\n );\n};\n\nexport default useWorksheetLayout;\n"],"names":["useWorksheetLayout","userType","nodeType","isSATAssessment","showNudgeBanner","topOffset","imageHue","isPuzzleSheet","navigationBar","useMemo","navHeight","TOP_NAVIGATION_HEIGHT","minQuestionHeight","minSummaryHeight","tOffset","WORKSHEET_NUDGE_BANNER_HEIGHT","isTrialSessionNodes","TRIAL_V3_NODE_TYPES","QUESTIONS_GAP","useWorksheetLayout$1"],"mappings":";;;AAuBA,MAAMA,IAA0C,CAAC;AAAA,EAC/C,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,MAAM;AACJ,QAAMC,IAAgBL,MAAa,eAE7BM,IAAgBC,EAA2C,MAAM;AACrE,QAAIN,EAAwB,QAAA;AAE5B,YAAQD,GAAU;AAAA,MAChB,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AAAA,MACL,KAAK;AACI,eAAA;AAAA,MACT;AACS,eAAA;AAAA,IACX;AAAA,EAAA,GACC,CAACC,GAAiBD,CAAQ,CAAC,GAExBQ,IAAYF,MAAkB,QAAQG,IAAwB,GAC9DC,IAAoB,gBAAgBP,IAAYK,CAAS,OACzDG,IAAmB,gBAAgBR,IAAYK,CAAS,OACxDI,IAAUV,IAAkBC,IAAYU,IAAgCV,GACxEW,IAAsBC,EAAoB,SAASf,CAAQ;AAE1D,SAAAO;AAAA,IACL,OAAO;AAAA,MACL,gBAAgBN,KAAmBI,IAAgB,SAAS;AAAA;AAAA;AAAA,MAG5D,gBAAgBJ,IAAkB,WAAWF,MAAa,YAAY,SAAS;AAAA,MAC/E,WAAW;AAAA,MACX,WAAWa;AAAA,MACX,eAAAN;AAAA,MACA,qBAAqB,EAAEL,KAAmBa;AAAA,MAC1C,mBAAAJ;AAAA,MACA,kBAAAC;AAAA,MACA,eAAeZ,MAAa,aAAa,CAACE;AAAA,MAC1C,sBAAsB,CAACI;AAAA,MACvB,UAAAD;AAAA,MACA,YAAYH,KAAmBI,IAAgB,SAAS;AAAA,MACxD,iBAAiBA,KAAiBS,IAAsB,IAAIE;AAAA,IAAA;AAAA,IAE9D;AAAA,MACEf;AAAA,MACAI;AAAA,MACAN;AAAA,MACAa;AAAA,MACAN;AAAA,MACAQ;AAAA,MACAJ;AAAA,MACAC;AAAA,MACAP;AAAA,IACF;AAAA,EAAA;AAEJ,GAEAa,IAAenB;"}
package/dist/index.d.ts CHANGED
@@ -275,6 +275,7 @@ declare enum CARD_TYPE {
275
275
  'monthly_mastery_test' = "monthly_mastery_test",
276
276
  'supplementary_mastery_test' = "supplementary_mastery_test",
277
277
  'trial_diagnostic' = "trial_diagnostic",
278
+ 'trial' = "trial",
278
279
  'trial_basic' = "trial_basic",
279
280
  'trial_intermediate' = "trial_intermediate",
280
281
  'trial_advanced' = "trial_advanced",
@@ -1122,6 +1123,7 @@ declare interface IBaseWorksheetProps {
1122
1123
  questionsSignedRequest: string;
1123
1124
  summaryDescription?: ReactElement | null;
1124
1125
  canSubmitWorksheet?: boolean;
1126
+ selectedTopics?: string[];
1125
1127
  subjectiveProps?: ISubjectiveSheetProps;
1126
1128
  inClass?: boolean;
1127
1129
  activityType: EWorksheetActivity | null;
@@ -4711,6 +4713,7 @@ export declare interface ITodaysContentTimeStamps {
4711
4713
  declare interface IToolbarProps {
4712
4714
  userType: TUserTypes;
4713
4715
  renderAs: TRenderAs_2;
4716
+ withGutter?: boolean;
4714
4717
  }
4715
4718
 
4716
4719
  export declare interface ITrackEvent {
@@ -4722,6 +4725,7 @@ export declare interface ITrialSessionFormFields {
4722
4725
  id: string;
4723
4726
  name?: string;
4724
4727
  grade?: string;
4728
+ course?: string;
4725
4729
  curriculum?: string;
4726
4730
  goals?: TGoals[];
4727
4731
  studentProfile?: {
@@ -4753,6 +4757,7 @@ export declare interface ITrialSessionFormFields {
4753
4757
  numberInNameError?: boolean;
4754
4758
  confirmationModalActive?: boolean;
4755
4759
  resetAttempt: boolean;
4760
+ selectedTopics?: string[];
4756
4761
  }
4757
4762
 
4758
4763
  declare interface ITrialSessionMetadata {
@@ -4761,6 +4766,7 @@ declare interface ITrialSessionMetadata {
4761
4766
 
4762
4767
  declare interface ITrialSessionProps {
4763
4768
  classStartedOn?: Date;
4769
+ demoType: string;
4764
4770
  height?: string | number;
4765
4771
  userType: TUserTypes;
4766
4772
  studentId: string;
@@ -5757,6 +5763,7 @@ export declare const NODE_TYPE: {
5757
5763
  readonly MASTERY: "MASTERY";
5758
5764
  readonly TRIAL_DIAGNOSTIC: "TRIAL_DIAGNOSTIC";
5759
5765
  readonly PDF: "PDF";
5766
+ readonly TRIAL: "TRIAL";
5760
5767
  readonly TRIAL_BASIC: "TRIAL_BASIC";
5761
5768
  readonly TRIAL_INTERMEDIATE: "TRIAL_INTERMEDIATE";
5762
5769
  readonly TRIAL_ADVANCED: "TRIAL_ADVANCED";
@@ -5788,6 +5795,7 @@ export declare enum NODE_TYPES {
5788
5795
  'CHAPTER_ASSESSMENT' = "CHAPTER_ASSESSMENT",
5789
5796
  'ASSESSMENT' = "ASSESSMENT",
5790
5797
  'TRIAL_DIAGNOSTIC' = "TRIAL_DIAGNOSTIC",
5798
+ 'TRIAL' = "TRIAL",
5791
5799
  'TRIAL_BASIC' = "TRIAL_BASIC",
5792
5800
  'TRIAL_INTERMEDIATE' = "TRIAL_INTERMEDIATE",
5793
5801
  'TRIAL_ADVANCED' = "TRIAL_ADVANCED",
@@ -6515,7 +6523,7 @@ export declare type TCheckboxVariants = 'black' | 'black-dark';
6515
6523
  */
6516
6524
  export declare type TCoachmarkJourneyProps = Omit<ICoachmarkProps, 'isActive'>;
6517
6525
 
6518
- export declare type TColorNames = `${THueNames}_${'1' | '2' | '3' | '4' | '5' | '6'}` | `${'BLACK' | 'WHITE'}_${'1' | '2' | '3' | '4' | '5'}` | `${'GREY'}_${'1' | '2' | '3' | '4'}` | `${'BLACK_T'}_${'02' | '04' | '08' | '15' | '20' | '38' | '60' | '87'}` | `${'WHITE_T'}_${'03' | '05' | '10' | '15' | '38' | '60' | '87'}` | 'BLACK' | `${'BLACK'}_${'50' | '65' | '75' | '10'}` | 'REAL_BLACK' | `${'REAL_BLACK'}_${'10' | '15' | '30' | '50' | '60'}` | 'WHITE' | `${'WHITE'}_${'10' | '20' | '30' | '70'}` | 'RED' | 'TRANSPARENT' | 'FLOWER' | `${'GREEN' | 'PURPLE'}_20`;
6526
+ export declare type TColorNames = `${THueNames}_${'1' | '2' | '3' | '4' | '5' | '6'}` | `${'BLACK' | 'WHITE'}_${'1' | '2' | '3' | '4' | '5'}` | `${'GREY'}_${'1' | '2' | '3' | '4'}` | `${'BLACK_T'}_${'02' | '04' | '08' | '15' | '20' | '38' | '60' | '87'}` | `${'WHITE_T'}_${'03' | '05' | '10' | '15' | '38' | '60' | '87'}` | 'BLACK' | `${'BLACK'}_${'50' | '65' | '75' | '10'}` | 'REAL_BLACK' | `${'REAL_BLACK'}_${'10' | '15' | '30' | '50' | '60'}` | 'WHITE' | `${'WHITE'}_${'10' | '20' | '30' | '70'}` | 'RED' | `${'RED'}_${'4'}` | 'TRANSPARENT' | 'FLOWER' | `${'GREEN' | 'PURPLE'}_20`;
6519
6527
 
6520
6528
  export declare type TColorsMap = Record<TColorNames, string>;
6521
6529
 
@@ -7219,7 +7227,7 @@ declare type TNodeSubGroupProps = keyof typeof NODE_SUB_GROUP;
7219
7227
 
7220
7228
  declare type TNodeTypeProps = keyof typeof NODE_TYPE | keyof typeof PYTHON_NODE_TYPES | keyof typeof SAT_NODE_TYPE;
7221
7229
 
7222
- export declare type TNodeTypes = 'LEGACY' | 'LEARNING' | 'REMEDIAL' | 'GENERAL' | 'SAT_MATH_RECAP' | 'SAT_MATH_LEARNING' | 'SAT_MATH_ASSESSMENT' | 'SAT_ENGLISH_RECAP' | 'SAT_ENGLISH_LEARNING' | 'SAT_ENGLISH_ASSESSMENT' | 'LEVEL3' | 'RECAP' | 'REVISION' | 'LEVEL2' | 'TARGET_PRACTICE' | 'PRACTICE' | 'EXTRA_PRACTICE' | 'PUZZLE_EASY' | 'PUZZLE_MEDIUM' | 'PUZZLE_HARD' | 'CHAPTER_ASSESSMENT' | 'ASSESSMENT' | 'TRIAL_DIAGNOSTIC' | 'TRIAL_BASIC' | 'TRIAL_INTERMEDIATE' | 'TRIAL_ADVANCED' | 'MASTERY' | 'DYNAMIC' | 'TURING_ASSESSMENT' | 'TURING_SUBJECTIVE' | 'TURING_PRACTICE' | 'DIAGNOSTIC' | 'SUBJECTIVE' | 'VIDEO' | 'PUZZLE_CARD';
7230
+ export declare type TNodeTypes = 'LEGACY' | 'LEARNING' | 'REMEDIAL' | 'GENERAL' | 'SAT_MATH_RECAP' | 'SAT_MATH_LEARNING' | 'SAT_MATH_ASSESSMENT' | 'SAT_ENGLISH_RECAP' | 'SAT_ENGLISH_LEARNING' | 'SAT_ENGLISH_ASSESSMENT' | 'LEVEL3' | 'RECAP' | 'REVISION' | 'LEVEL2' | 'TARGET_PRACTICE' | 'PRACTICE' | 'EXTRA_PRACTICE' | 'PUZZLE_EASY' | 'PUZZLE_MEDIUM' | 'PUZZLE_HARD' | 'CHAPTER_ASSESSMENT' | 'ASSESSMENT' | 'TRIAL_DIAGNOSTIC' | 'TRIAL' | 'TRIAL_BASIC' | 'TRIAL_INTERMEDIATE' | 'TRIAL_ADVANCED' | 'MASTERY' | 'DYNAMIC' | 'TURING_ASSESSMENT' | 'TURING_SUBJECTIVE' | 'TURING_PRACTICE' | 'DIAGNOSTIC' | 'SUBJECTIVE' | 'VIDEO' | 'PUZZLE_CARD';
7223
7231
 
7224
7232
  declare type TNodeTypes_2 = keyof typeof NODE_TYPE | keyof typeof PYTHON_NODE_TYPES | keyof typeof SAT_NODE_TYPE;
7225
7233
 
@@ -7741,10 +7749,10 @@ export declare const useGetLeaderboardDal: (userId: string) => Omit<ReturnType<t
7741
7749
  };
7742
7750
 
7743
7751
  export declare const useGetMileStoneConfig: (initialId?: string, initialQuery?: {
7744
- demo_type?: "TRIAL_V3";
7752
+ demo_type?: string;
7745
7753
  } | undefined) => {
7746
7754
  get: (id: string, query: {
7747
- demo_type?: "TRIAL_V3";
7755
+ demo_type?: string;
7748
7756
  } | undefined, meta: void) => Promise<void>;
7749
7757
  resource: ResourceModel<IMilestoneConfig> | undefined;
7750
7758
  data: IMilestoneConfig | undefined;
@@ -8050,8 +8058,6 @@ export declare const WORKSHEET_QUESTIONS_GAP = 16;
8050
8058
 
8051
8059
  export declare const WORKSHEET_TOP_NAVIGATION_HEIGHT = 48;
8052
8060
 
8053
- export declare const WORKSHEET_V3_NODE_TYPES: TNodeTypeProps[];
8054
-
8055
8061
  declare type XOR<T, U> = (T & Without<U, keyof T>) | (U & Without<T, keyof U>);
8056
8062
 
8057
8063
  declare const ZINDEX: {