@cuemath/leap 3.5.48-gg1 → 3.5.48-j2

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 (249) hide show
  1. package/dist/assets/illustrations/illustrations.js +0 -3
  2. package/dist/assets/illustrations/illustrations.js.map +1 -1
  3. package/dist/assets/line-icons/icons/bulb.js +10 -10
  4. package/dist/assets/line-icons/icons/bulb.js.map +1 -1
  5. package/dist/assets/line-icons/icons/hand.js.map +1 -1
  6. package/dist/assets/line-icons/icons/scribble.js +36 -13
  7. package/dist/assets/line-icons/icons/scribble.js.map +1 -1
  8. package/dist/assets/line-icons/icons/sticker.js +9 -9
  9. package/dist/assets/line-icons/icons/sticker.js.map +1 -1
  10. package/dist/features/cue-canvas/sidebar/puzzles/api/get-puzzles.js.map +1 -1
  11. package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js +6 -6
  12. package/dist/features/journey/hooks/use-home-page-journey/home-page-homeworks-mock.js.map +1 -1
  13. package/dist/features/journey/hooks/use-home-page-journey/recent-chapters-mock.js +2 -2
  14. package/dist/features/journey/hooks/use-home-page-journey/recent-chapters-mock.js.map +1 -1
  15. package/dist/features/journey/mocks/chapter-page-journey-mock-data.js +29 -64
  16. package/dist/features/journey/mocks/chapter-page-journey-mock-data.js.map +1 -1
  17. package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js +2 -2
  18. package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js.map +1 -1
  19. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +107 -103
  20. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
  21. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js +2 -2
  22. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js.map +1 -1
  23. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +104 -96
  24. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
  25. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +134 -115
  26. package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
  27. package/dist/features/milestone/milestone-list-container/milestone-list-container.js +95 -91
  28. package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
  29. package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js +92 -74
  30. package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js.map +1 -1
  31. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js +28 -25
  32. package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js.map +1 -1
  33. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +214 -170
  34. package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js.map +1 -1
  35. package/dist/features/milestone/milestone-resources/resources-assign/store/action-types.js +20 -0
  36. package/dist/features/milestone/milestone-resources/resources-assign/store/action-types.js.map +1 -0
  37. package/dist/features/milestone/milestone-resources/resources-assign/store/actions.js +55 -0
  38. package/dist/features/milestone/milestone-resources/resources-assign/store/actions.js.map +1 -0
  39. package/dist/features/milestone/milestone-resources/resources-assign/store/initial-state.js +38 -0
  40. package/dist/features/milestone/milestone-resources/resources-assign/store/initial-state.js.map +1 -0
  41. package/dist/features/milestone/milestone-resources/resources-assign/store/reducer.js +58 -0
  42. package/dist/features/milestone/milestone-resources/resources-assign/store/reducer.js.map +1 -0
  43. package/dist/features/milestone/milestone-resources/resources-list/resources-list.js +40 -39
  44. package/dist/features/milestone/milestone-resources/resources-list/resources-list.js.map +1 -1
  45. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +44 -43
  46. package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -1
  47. package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-selection.js +51 -42
  48. package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-selection.js.map +1 -1
  49. package/dist/features/milestone/milestone-tests/tests-creation/test-stages/difficulty-and-duration-selection/difficulty-and-duration-selection.js +85 -72
  50. package/dist/features/milestone/milestone-tests/tests-creation/test-stages/difficulty-and-duration-selection/difficulty-and-duration-selection.js.map +1 -1
  51. package/dist/features/milestone/milestone-tests/tests-creation/test-stages/test-preview/test-preview.js +34 -25
  52. package/dist/features/milestone/milestone-tests/tests-creation/test-stages/test-preview/test-preview.js.map +1 -1
  53. package/dist/features/milestone/milestone-tests/tests-creation/tests-creation-types.js +5 -0
  54. package/dist/features/milestone/milestone-tests/tests-creation/tests-creation-types.js.map +1 -0
  55. package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +146 -89
  56. package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js.map +1 -1
  57. package/dist/features/puzzles/app/puzzle-app-view.js +40 -40
  58. package/dist/features/puzzles/app/puzzle-app-view.js.map +1 -1
  59. package/dist/features/trial-session/comps/learning-plan/index.js +268 -83
  60. package/dist/features/trial-session/comps/learning-plan/index.js.map +1 -1
  61. package/dist/features/trial-session/hooks/use-learning-plan-sync.js +29 -0
  62. package/dist/features/trial-session/hooks/use-learning-plan-sync.js.map +1 -0
  63. package/dist/features/trial-session/trial-session-types.js +3 -2
  64. package/dist/features/trial-session/trial-session-types.js.map +1 -1
  65. package/dist/features/ui/tabs/tabs.js +15 -15
  66. package/dist/features/ui/tabs/tabs.js.map +1 -1
  67. package/dist/features/worksheet/learnosity-preloader/learnosity-preloader.js +1 -0
  68. package/dist/features/worksheet/learnosity-preloader/learnosity-preloader.js.map +1 -1
  69. package/dist/features/worksheet/worksheet/constants.js +13 -12
  70. package/dist/features/worksheet/worksheet/constants.js.map +1 -1
  71. package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js +100 -123
  72. package/dist/features/worksheet/worksheet/hooks/use-create-imperative-handle.js.map +1 -1
  73. package/dist/features/worksheet/worksheet/hooks/use-worksheet-store.js +1 -1
  74. package/dist/features/worksheet/worksheet/hooks/use-worksheet-store.js.map +1 -1
  75. package/dist/features/worksheet/worksheet/question-tips.js +100 -0
  76. package/dist/features/worksheet/worksheet/question-tips.js.map +1 -0
  77. package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js +109 -40
  78. package/dist/features/worksheet/worksheet/worksheet-action-bar/worksheet-action-bar.js.map +1 -1
  79. package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js +46 -49
  80. package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js.map +1 -1
  81. package/dist/features/worksheet/worksheet/worksheet-calculator/worksheet-calculator.js +4 -4
  82. package/dist/features/worksheet/worksheet/worksheet-calculator/worksheet-calculator.js.map +1 -1
  83. package/dist/features/worksheet/worksheet/worksheet-helpers.js +276 -129
  84. package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
  85. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-navigation.js +25 -25
  86. package/dist/features/worksheet/worksheet/worksheet-navigation/worksheet-navigation.js.map +1 -1
  87. package/dist/features/worksheet/worksheet/worksheet-provider.js +1 -1
  88. package/dist/features/worksheet/worksheet/worksheet-provider.js.map +1 -1
  89. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +25 -22
  90. package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
  91. package/dist/features/worksheet/worksheet/worksheet-question/question-backdrop/question-backdrop-styled.js +20 -26
  92. package/dist/features/worksheet/worksheet/worksheet-question/question-backdrop/question-backdrop-styled.js.map +1 -1
  93. package/dist/features/worksheet/worksheet/worksheet-question/question-backdrop/question-backdrop.js +17 -32
  94. package/dist/features/worksheet/worksheet/worksheet-question/question-backdrop/question-backdrop.js.map +1 -1
  95. package/dist/features/worksheet/worksheet/worksheet-question/subjective-styled.js +22 -17
  96. package/dist/features/worksheet/worksheet/worksheet-question/subjective-styled.js.map +1 -1
  97. package/dist/features/worksheet/worksheet/worksheet-question/system-intros/basic-practice-intro.js +1 -1
  98. package/dist/features/worksheet/worksheet/worksheet-question/system-intros/basic-practice-intro.js.map +1 -1
  99. package/dist/features/worksheet/worksheet/worksheet-question/system-intros/regular-practice-intro.js +2 -2
  100. package/dist/features/worksheet/worksheet/worksheet-question/system-intros/regular-practice-intro.js.map +1 -1
  101. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +50 -32
  102. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
  103. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +287 -377
  104. package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
  105. package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js +53 -0
  106. package/dist/features/worksheet/worksheet/worksheet-questions-controller/scribble-switch.js.map +1 -0
  107. package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js +191 -0
  108. package/dist/features/worksheet/worksheet/worksheet-questions-controller/use-handler-callbacks.js.map +1 -0
  109. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +345 -20
  110. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
  111. package/dist/features/worksheet/worksheet/worksheet-sidebar/navigator.js +20 -33
  112. package/dist/features/worksheet/worksheet/worksheet-sidebar/navigator.js.map +1 -1
  113. package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js +112 -0
  114. package/dist/features/worksheet/worksheet/worksheet-sidebar/question-guide.js.map +1 -0
  115. package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js +61 -0
  116. package/dist/features/worksheet/worksheet/worksheet-sidebar/sidebar.js.map +1 -0
  117. package/dist/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.js +91 -0
  118. package/dist/features/worksheet/worksheet/worksheet-sidebar/worksheet-sidebar-styled.js.map +1 -0
  119. package/dist/features/worksheet/worksheet/worksheet-store.js +289 -0
  120. package/dist/features/worksheet/worksheet/worksheet-store.js.map +1 -0
  121. package/dist/features/worksheet/worksheet/worksheet-styled.js +83 -29
  122. package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
  123. package/dist/features/worksheet/worksheet/worksheet-summary-controller/worksheet-summary-controller.js +24 -45
  124. package/dist/features/worksheet/worksheet/worksheet-summary-controller/worksheet-summary-controller.js.map +1 -1
  125. package/dist/features/worksheet/worksheet/worksheet-types.js +3 -4
  126. package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
  127. package/dist/features/worksheet/worksheet/worksheet-view.js +99 -88
  128. package/dist/features/worksheet/worksheet/worksheet-view.js.map +1 -1
  129. package/dist/features/worksheet/worksheet/worksheet.js +117 -126
  130. package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
  131. package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js +29 -29
  132. package/dist/features/worksheet/worksheet-preview/dynamic-worksheet-preview/dynamic-worksheet-preview.js.map +1 -1
  133. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +16 -16
  134. package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
  135. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +24 -24
  136. package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
  137. package/dist/index.d.ts +129 -68
  138. package/dist/index.js +745 -760
  139. package/dist/index.js.map +1 -1
  140. package/dist/node_modules/decode-uri-component/index.js.map +1 -0
  141. package/dist/node_modules/query-string/base.js +1 -1
  142. package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
  143. package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
  144. package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
  145. package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
  146. package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
  147. package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
  148. package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
  149. package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
  150. package/dist/types/models/worksheet.js +1 -2
  151. package/dist/types/models/worksheet.js.map +1 -1
  152. package/package.json +1 -1
  153. package/dist/assets/line-icons/icons/chevron-up.js +0 -28
  154. package/dist/assets/line-icons/icons/chevron-up.js.map +0 -1
  155. package/dist/assets/line-icons/icons/close.js +0 -28
  156. package/dist/assets/line-icons/icons/close.js.map +0 -1
  157. package/dist/assets/line-icons/icons/cursor2.js +0 -24
  158. package/dist/assets/line-icons/icons/cursor2.js.map +0 -1
  159. package/dist/assets/line-icons/icons/hints.js +0 -25
  160. package/dist/assets/line-icons/icons/hints.js.map +0 -1
  161. package/dist/assets/line-icons/icons/question-feedback.js +0 -30
  162. package/dist/assets/line-icons/icons/question-feedback.js.map +0 -1
  163. package/dist/assets/line-icons/icons/teaching-tools.js +0 -40
  164. package/dist/assets/line-icons/icons/teaching-tools.js.map +0 -1
  165. package/dist/assets/line-icons/icons/tval-question.js +0 -32
  166. package/dist/assets/line-icons/icons/tval-question.js.map +0 -1
  167. package/dist/features/trial-session/comps/learning-plan/use-learning-plan-scroll-sync.js +0 -37
  168. package/dist/features/trial-session/comps/learning-plan/use-learning-plan-scroll-sync.js.map +0 -1
  169. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-allow-retry-button-click.js +0 -15
  170. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-allow-retry-button-click.js.map +0 -1
  171. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-back-button-click.js +0 -18
  172. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-back-button-click.js.map +0 -1
  173. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-check-button-click.js +0 -21
  174. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-check-button-click.js.map +0 -1
  175. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-next-button-click.js +0 -19
  176. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-next-button-click.js.map +0 -1
  177. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-ready-button-click.js +0 -34
  178. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-ready-button-click.js.map +0 -1
  179. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-response-change.js +0 -38
  180. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-response-change.js.map +0 -1
  181. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-retry-button-click.js +0 -16
  182. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-retry-button-click.js.map +0 -1
  183. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-skip-button-click.js +0 -35
  184. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-skip-button-click.js.map +0 -1
  185. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-skip-section-button-click.js +0 -12
  186. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-skip-section-button-click.js.map +0 -1
  187. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-start-button-click.js +0 -44
  188. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-start-button-click.js.map +0 -1
  189. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-submit-quiz.js +0 -51
  190. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-submit-quiz.js.map +0 -1
  191. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-validate-button-click.js +0 -19
  192. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-handle-validate-button-click.js.map +0 -1
  193. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-play-validation-audio.js +0 -23
  194. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-play-validation-audio.js.map +0 -1
  195. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-validate-question.js +0 -36
  196. package/dist/features/worksheet/worksheet/worksheet-questions-controller/hooks/use-validate-question.js.map +0 -1
  197. package/dist/features/worksheet/worksheet/worksheet-questions-controller/student/controller-lesson-v3.js +0 -184
  198. package/dist/features/worksheet/worksheet/worksheet-questions-controller/student/controller-lesson-v3.js.map +0 -1
  199. package/dist/features/worksheet/worksheet/worksheet-questions-controller/student/controller-lesson-v3_1.js +0 -261
  200. package/dist/features/worksheet/worksheet/worksheet-questions-controller/student/controller-lesson-v3_1.js.map +0 -1
  201. package/dist/features/worksheet/worksheet/worksheet-questions-controller/student/controller.js +0 -180
  202. package/dist/features/worksheet/worksheet/worksheet-questions-controller/student/controller.js.map +0 -1
  203. package/dist/features/worksheet/worksheet/worksheet-questions-controller/teacher/controller-lesson-v3.js +0 -77
  204. package/dist/features/worksheet/worksheet/worksheet-questions-controller/teacher/controller-lesson-v3.js.map +0 -1
  205. package/dist/features/worksheet/worksheet/worksheet-questions-controller/teacher/controller-lesson-v3_1.js +0 -103
  206. package/dist/features/worksheet/worksheet/worksheet-questions-controller/teacher/controller-lesson-v3_1.js.map +0 -1
  207. package/dist/features/worksheet/worksheet/worksheet-questions-controller/teacher/controller.js +0 -21
  208. package/dist/features/worksheet/worksheet/worksheet-questions-controller/teacher/controller.js.map +0 -1
  209. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller-view.js +0 -22
  210. package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller-view.js.map +0 -1
  211. package/dist/features/worksheet/worksheet/worksheet-questions-tools/questions-toolbar/questions-toolbar-styled.js +0 -49
  212. package/dist/features/worksheet/worksheet/worksheet-questions-tools/questions-toolbar/questions-toolbar-styled.js.map +0 -1
  213. package/dist/features/worksheet/worksheet/worksheet-questions-tools/questions-toolbar/questions-toolbar.js +0 -191
  214. package/dist/features/worksheet/worksheet/worksheet-questions-tools/questions-toolbar/questions-toolbar.js.map +0 -1
  215. package/dist/features/worksheet/worksheet/worksheet-questions-tools/scribble-switch.js +0 -65
  216. package/dist/features/worksheet/worksheet/worksheet-questions-tools/scribble-switch.js.map +0 -1
  217. package/dist/features/worksheet/worksheet/worksheet-questions-tools/worksheet-questions-styled.js +0 -9
  218. package/dist/features/worksheet/worksheet/worksheet-questions-tools/worksheet-questions-styled.js.map +0 -1
  219. package/dist/features/worksheet/worksheet/worksheet-questions-tools/worksheet-questions-tools.js +0 -38
  220. package/dist/features/worksheet/worksheet/worksheet-questions-tools/worksheet-questions-tools.js.map +0 -1
  221. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-computed-properties.js +0 -73
  222. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-computed-properties.js.map +0 -1
  223. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-derived-blocker.js +0 -20
  224. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-derived-blocker.js.map +0 -1
  225. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-last-attemptable-question-index.js +0 -69
  226. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-last-attemptable-question-index.js.map +0 -1
  227. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-last-unlocked-question-index.js +0 -18
  228. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-last-unlocked-question-index.js.map +0 -1
  229. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-merged-response-state.js +0 -19
  230. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-merged-response-state.js.map +0 -1
  231. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-questions-from-items.js +0 -138
  232. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-questions-from-items.js.map +0 -1
  233. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-renderable-questions.js +0 -9
  234. package/dist/features/worksheet/worksheet/worksheet-store/helpers/get-renderable-questions.js.map +0 -1
  235. package/dist/features/worksheet/worksheet/worksheet-store/worksheet-store.js +0 -230
  236. package/dist/features/worksheet/worksheet/worksheet-store/worksheet-store.js.map +0 -1
  237. package/dist/features/worksheet/worksheet/worksheet-teaching-tools/worksheet-teaching-tools-styled.js +0 -19
  238. package/dist/features/worksheet/worksheet/worksheet-teaching-tools/worksheet-teaching-tools-styled.js.map +0 -1
  239. package/dist/features/worksheet/worksheet/worksheet-teaching-tools/worksheet-teaching-tools.js +0 -72
  240. package/dist/features/worksheet/worksheet/worksheet-teaching-tools/worksheet-teaching-tools.js.map +0 -1
  241. package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +0 -1
  242. package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
  243. package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
  244. package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
  245. package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
  246. package/dist/static/pattern-cubes.113d8dda.svg +0 -1
  247. package/dist/static/pattern-diamond.a51b202c.svg +0 -1
  248. package/dist/static/pattern-honeycomb.ed7ad26a.svg +0 -1
  249. /package/dist/node_modules/{query-string/node_modules/decode-uri-component → decode-uri-component}/index.js +0 -0
@@ -1,73 +0,0 @@
1
- import { getInitialResponses as k, getInitialQuestionId as v, getWorksheetDimensions as r } from "../../worksheet-helpers.js";
2
- import { getLastAttemptableQuestionIndex as x } from "./get-last-attemptable-question-index.js";
3
- import { getQuestionsFromItems as C } from "./get-questions-from-items.js";
4
- import { getLastUnlockedQuestionIndex as h } from "./get-last-unlocked-question-index.js";
5
- import { getDerivedBlocker as R } from "./get-derived-blocker.js";
6
- import { getRenderableQuestions as T } from "./get-renderable-questions.js";
7
- const D = (n, e) => {
8
- var m;
9
- const {
10
- learnosityItems: d,
11
- learnosityResponses: b,
12
- updatedResponses: I,
13
- layout: Q,
14
- behavior: s,
15
- userType: a,
16
- initialResponseId: p,
17
- initialItemIndex: g
18
- } = n, { initialQuestion: y } = s, i = (e == null ? void 0 : e.questions) ?? C(d, {
19
- nodeType: n.nodeType,
20
- activityType: n.activityType
21
- }), l = I ?? (e == null ? void 0 : e.responses) ?? b ?? k(i), t = h({
22
- questions: i,
23
- responses: l,
24
- behavior: s,
25
- userType: a,
26
- inClass: !!n.inClass
27
- }), c = (e == null ? void 0 : e.initialQuestionId) ?? v({
28
- questions: i,
29
- initialQuestion: y,
30
- lastUnlockedQuestionIndex: t,
31
- lastAttemptableQuestionIndex: x({
32
- questions: i,
33
- responses: l,
34
- behavior: s,
35
- userType: a,
36
- inClass: !!n.inClass
37
- }),
38
- initialResponseId: p,
39
- initialItemIndex: g
40
- }), u = (e == null ? void 0 : e.activeQuestionId) ?? c, o = i.findIndex(
41
- (f) => f.response_id === u
42
- );
43
- return setTimeout(() => {
44
- !e && i[o] && n.onActiveQuestionChange && n.onActiveQuestionChange(i[o]);
45
- }, 0), {
46
- questions: i,
47
- renderableQuestions: T({
48
- questions: i,
49
- userType: a,
50
- lastUnlockedQuestionIndex: t
51
- }),
52
- responses: l,
53
- lastUnlockedQuestionIndex: t,
54
- initialQuestionId: c,
55
- activeQuestionId: u,
56
- activeQuestionIndex: o,
57
- summaryVisible: e ? e.summaryVisible : !1,
58
- calculatorVisible: e ? e.calculatorVisible : !1,
59
- scribblingEnabled: e ? e.scribblingEnabled : !1,
60
- blocker: R({
61
- currentBlocker: e == null ? void 0 : e.blocker,
62
- teacherValidationEnabled: s.teacherValidationEnabled,
63
- userType: a,
64
- lastUnlockedQuestion: i[t],
65
- lastUnlockedQuestionResponse: l[((m = i[t]) == null ? void 0 : m.response_id) ?? ""]
66
- }),
67
- ...r(d, Q)
68
- };
69
- };
70
- export {
71
- D as getComputedProperties
72
- };
73
- //# sourceMappingURL=get-computed-properties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-computed-properties.js","sources":["../../../../../../src/features/worksheet/worksheet/worksheet-store/helpers/get-computed-properties.ts"],"sourcesContent":["import {\n getInitialQuestionId,\n getInitialResponses,\n getWorksheetDimensions,\n} from '../../worksheet-helpers';\nimport { getLastAttemptableQuestionIndex } from './get-last-attemptable-question-index';\nimport { getQuestionsFromItems } from './get-questions-from-items';\nimport { getLastUnlockedQuestionIndex } from './get-last-unlocked-question-index';\nimport type {\n IWorksheetStore,\n IWorksheetStoreState,\n TWorksheetStoreProps,\n} from '../../worksheet-types';\nimport { getDerivedBlocker } from './get-derived-blocker';\nimport { getRenderableQuestions } from './get-renderable-questions';\n\ninterface IGetComputedProperties {\n (props: TWorksheetStoreProps, store?: IWorksheetStore): IWorksheetStoreState;\n}\nexport const getComputedProperties: IGetComputedProperties = (props, store) => {\n const {\n learnosityItems,\n learnosityResponses,\n updatedResponses,\n layout,\n behavior,\n userType,\n initialResponseId,\n initialItemIndex,\n } = props;\n const { initialQuestion } = behavior;\n const questions =\n store?.questions ??\n getQuestionsFromItems(learnosityItems, {\n nodeType: props.nodeType,\n activityType: props.activityType,\n });\n const responses =\n updatedResponses ?? store?.responses ?? learnosityResponses ?? getInitialResponses(questions);\n const lastUnlockedQuestionIndex = getLastUnlockedQuestionIndex({\n questions,\n responses,\n behavior,\n userType,\n inClass: !!props.inClass,\n });\n const initialQuestionId =\n store?.initialQuestionId ??\n getInitialQuestionId({\n questions,\n initialQuestion,\n lastUnlockedQuestionIndex,\n lastAttemptableQuestionIndex: getLastAttemptableQuestionIndex({\n questions,\n responses,\n behavior,\n userType,\n inClass: !!props.inClass,\n }),\n initialResponseId,\n initialItemIndex,\n });\n\n const activeQuestionId = store?.activeQuestionId ?? initialQuestionId;\n const activeQuestionIndex = questions.findIndex(\n question => question.response_id === activeQuestionId,\n );\n\n setTimeout(() => {\n if (!store && questions[activeQuestionIndex] && props.onActiveQuestionChange) {\n props.onActiveQuestionChange(questions[activeQuestionIndex]);\n }\n }, 0);\n\n return {\n questions,\n renderableQuestions: getRenderableQuestions({\n questions,\n userType,\n lastUnlockedQuestionIndex,\n }),\n responses,\n lastUnlockedQuestionIndex,\n initialQuestionId,\n activeQuestionId,\n activeQuestionIndex,\n summaryVisible: store ? store.summaryVisible : false,\n calculatorVisible: store ? store.calculatorVisible : false,\n scribblingEnabled: store ? store.scribblingEnabled : false,\n blocker: getDerivedBlocker({\n currentBlocker: store?.blocker,\n teacherValidationEnabled: behavior.teacherValidationEnabled,\n userType,\n lastUnlockedQuestion: questions[lastUnlockedQuestionIndex]!,\n lastUnlockedQuestionResponse:\n responses[questions[lastUnlockedQuestionIndex]?.response_id ?? ''],\n }),\n ...getWorksheetDimensions(learnosityItems, layout),\n };\n};\n"],"names":["getComputedProperties","props","store","learnosityItems","learnosityResponses","updatedResponses","layout","behavior","userType","initialResponseId","initialItemIndex","initialQuestion","questions","getQuestionsFromItems","responses","getInitialResponses","lastUnlockedQuestionIndex","getLastUnlockedQuestionIndex","initialQuestionId","getInitialQuestionId","getLastAttemptableQuestionIndex","activeQuestionId","activeQuestionIndex","question","getRenderableQuestions","getDerivedBlocker","_a","getWorksheetDimensions"],"mappings":";;;;;;AAmBa,MAAAA,IAAgD,CAACC,GAAOC,MAAU;;AACvE,QAAA;AAAA,IACJ,iBAAAC;AAAA,IACA,qBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,QAAAC;AAAA,IACA,UAAAC;AAAA,IACA,UAAAC;AAAA,IACA,mBAAAC;AAAA,IACA,kBAAAC;AAAA,EACE,IAAAT,GACE,EAAE,iBAAAU,EAAoB,IAAAJ,GACtBK,KACJV,KAAA,gBAAAA,EAAO,cACPW,EAAsBV,GAAiB;AAAA,IACrC,UAAUF,EAAM;AAAA,IAChB,cAAcA,EAAM;AAAA,EAAA,CACrB,GACGa,IACJT,MAAoBH,KAAA,gBAAAA,EAAO,cAAaE,KAAuBW,EAAoBH,CAAS,GACxFI,IAA4BC,EAA6B;AAAA,IAC7D,WAAAL;AAAA,IACA,WAAAE;AAAA,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AAAU,EAAsC,gBAAe,EAAE;AAAA,IAAA,CACpE;AAAA,IACD,GAAGC,EAAuBxB,GAAiBG,CAAM;AAAA,EAAA;AAErD;"}
@@ -1,20 +0,0 @@
1
- const B = ({
2
- teacherValidationEnabled: i,
3
- userType: v,
4
- lastUnlockedQuestion: f,
5
- lastUnlockedQuestionResponse: r
6
- }) => {
7
- if (i) {
8
- const { item_type: m, instructor_stimulus: y, is_optional: x } = f;
9
- if (v === "TEACHER") {
10
- if (m === "exit-ticket" && y !== "SystemIntro")
11
- return r != null && r.submittedByStudent && !(r != null && r.validatedByTeacher) ? "exit-ticket-review-available" : r != null && r.validatedByTeacher ? void 0 : "exit-ticket-teacher-intervention";
12
- if (x)
13
- return r != null && r.assignStatus ? void 0 : "optional-items-assignment";
14
- }
15
- }
16
- };
17
- export {
18
- B as getDerivedBlocker
19
- };
20
- //# sourceMappingURL=get-derived-blocker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-derived-blocker.js","sources":["../../../../../../src/features/worksheet/worksheet/worksheet-store/helpers/get-derived-blocker.ts"],"sourcesContent":["import type {\n IWorksheetQuestion,\n IWorksheetResponse,\n IWorksheetStore,\n} from '../../worksheet-types';\n\ninterface IGetDerivedBlocker {\n (options: {\n currentBlocker?: IWorksheetStore['blocker'];\n teacherValidationEnabled: IWorksheetStore['behavior']['teacherValidationEnabled'];\n userType: IWorksheetStore['userType'];\n lastUnlockedQuestion: IWorksheetQuestion;\n lastUnlockedQuestionResponse?: IWorksheetResponse;\n }): IWorksheetStore['blocker'] | undefined;\n}\n\nexport const getDerivedBlocker: IGetDerivedBlocker = ({\n teacherValidationEnabled,\n userType,\n lastUnlockedQuestion,\n lastUnlockedQuestionResponse,\n}) => {\n if (teacherValidationEnabled) {\n const { item_type, instructor_stimulus, is_optional } = lastUnlockedQuestion;\n\n if (userType === 'TEACHER') {\n if (item_type === 'exit-ticket' && instructor_stimulus !== 'SystemIntro') {\n if (\n lastUnlockedQuestionResponse?.submittedByStudent &&\n !lastUnlockedQuestionResponse?.validatedByTeacher\n ) {\n return 'exit-ticket-review-available';\n }\n\n if (!lastUnlockedQuestionResponse?.validatedByTeacher) {\n return 'exit-ticket-teacher-intervention';\n }\n\n return undefined;\n }\n\n if (is_optional) {\n if (!lastUnlockedQuestionResponse?.assignStatus) {\n return 'optional-items-assignment';\n }\n\n return undefined;\n }\n }\n }\n\n return undefined;\n};\n"],"names":["getDerivedBlocker","teacherValidationEnabled","userType","lastUnlockedQuestion","lastUnlockedQuestionResponse","item_type","instructor_stimulus","is_optional"],"mappings":"AAgBO,MAAMA,IAAwC,CAAC;AAAA,EACpD,0BAAAC;AAAA,EACA,UAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,8BAAAC;AACF,MAAM;AACJ,MAAIH,GAA0B;AAC5B,UAAM,EAAE,WAAAI,GAAW,qBAAAC,GAAqB,aAAAC,EAAA,IAAgBJ;AAExD,QAAID,MAAa,WAAW;AACtB,UAAAG,MAAc,iBAAiBC,MAAwB;AACzD,eACEF,KAAA,QAAAA,EAA8B,sBAC9B,EAACA,KAAA,QAAAA,EAA8B,sBAExB,iCAGJA,KAAA,QAAAA,EAA8B,qBAI5B,SAHE;AAMX,UAAIG;AACE,eAACH,KAAA,QAAAA,EAA8B,eAI5B,SAHE;AAAA,IAKb;AAAA,EACF;AAGF;"}
@@ -1,69 +0,0 @@
1
- import { isTeacherInterventionNeeded as l } from "../../worksheet-helpers.js";
2
- const m = ({
3
- questions: e,
4
- responses: c,
5
- userType: s
6
- }) => {
7
- const d = [...e].reverse().findIndex((i) => {
8
- const r = c[i.response_id], { validatedByTeacher: t, assignStatus: n } = r ?? {};
9
- return !!(t || n === "skipped");
10
- });
11
- if (d === -1)
12
- return 0;
13
- if (d === 0) {
14
- const i = [...e].reverse().findIndex((r) => {
15
- var t;
16
- return ((t = c[r.response_id]) == null ? void 0 : t.assignStatus) !== "skipped";
17
- });
18
- return e.length - i - 1;
19
- }
20
- if (s === "STUDENT") {
21
- const i = e.length - d, r = e[i], { assignStatus: t } = c[r.response_id] ?? {};
22
- return r.is_optional && !t ? i - 1 : i;
23
- }
24
- return e.length - d;
25
- }, x = ({
26
- questions: e,
27
- responses: c,
28
- behavior: s,
29
- inClass: d
30
- }) => {
31
- const { attemptsAfterTeacherInterventionNeeded: i } = s, r = e.findIndex((t) => {
32
- var u;
33
- const n = c[t.response_id], { attemptsHistory: a } = n ?? {};
34
- if (t.is_non_question)
35
- return (n == null ? void 0 : n.responseGiven) !== !0;
36
- if (t.item_type === "exit-ticket")
37
- return (n == null ? void 0 : n.skipped) !== !0 && (n == null ? void 0 : n.response) === void 0;
38
- const o = (u = a == null ? void 0 : a.slice(-1)[0]) == null ? void 0 : u.score;
39
- return o ? (o.score ?? 0) === o.max_score ? !!(d && t.metadata.acknowledgements && !(n != null && n.validatedByTeacher)) : l({
40
- attemptsAfterTeacherInterventionNeeded: i,
41
- attemptsHistory: a
42
- }) ? d : !0 : !0;
43
- });
44
- return r === -1 ? e.length - 1 : r === 0 ? 0 : r;
45
- }, I = ({
46
- questions: e,
47
- responses: c,
48
- behavior: s
49
- }) => {
50
- const { maximumAttempts: d, validation: i, navigationMode: r } = s, t = [...e].reverse().findIndex((n) => {
51
- var f;
52
- const a = c[n.response_id], { attemptsHistory: o } = a ?? {}, u = (f = o == null ? void 0 : o.slice(-1)[0]) == null ? void 0 : f.score;
53
- return u ? (u.score ?? 0) === u.max_score || ((o == null ? void 0 : o.length) ?? 0) >= d : !!(!i && r === "LINEAR" && (a != null && a.response || a != null && a.skipped));
54
- });
55
- return t === -1 ? 0 : t === 0 ? e.length - 1 : e.length - t;
56
- }, p = ({
57
- questions: e,
58
- responses: c,
59
- behavior: s,
60
- userType: d,
61
- inClass: i
62
- }) => {
63
- const { teacherValidationEnabled: r, teacherDiscussionEnabled: t } = s;
64
- return r ? m({ questions: e, responses: c, userType: d }) : t ? x({ questions: e, responses: c, behavior: s, inClass: i }) : I({ questions: e, responses: c, behavior: s });
65
- };
66
- export {
67
- p as getLastAttemptableQuestionIndex
68
- };
69
- //# sourceMappingURL=get-last-attemptable-question-index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-last-attemptable-question-index.js","sources":["../../../../../../src/features/worksheet/worksheet/worksheet-store/helpers/get-last-attemptable-question-index.ts"],"sourcesContent":["import { isTeacherInterventionNeeded } from '../../worksheet-helpers';\nimport type {\n IWorksheetBehavior,\n IWorksheetQuestion,\n IWorksheetResponse,\n} from '../../worksheet-types';\nimport type { TUserTypes } from '../../../../ui/types';\n\ninterface IGetLastAttemptableQuestionIndex {\n (options: {\n questions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n behavior: IWorksheetBehavior;\n userType: TUserTypes;\n inClass: boolean;\n }): number;\n}\n\ninterface IGetLastAttemptableIndexTeacherValidation {\n (options: {\n questions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n userType: TUserTypes;\n }): number;\n}\n\ninterface IGetLastAttemptableIndexTeacherDiscussion {\n (options: {\n questions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n behavior: IWorksheetBehavior;\n inClass: boolean;\n }): number;\n}\n\ninterface IGetLastAttemptableIndexDefault {\n (options: {\n questions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n behavior: IWorksheetBehavior;\n }): number;\n}\n\n/**\n * Handles finding last attemptable question when teacher validation is enabled\n */\nconst getLastAttemptableIndexTeacherValidation: IGetLastAttemptableIndexTeacherValidation = ({\n questions,\n responses,\n userType,\n}) => {\n const questionIndex = [...questions].reverse().findIndex(q => {\n const qResp = responses[q.response_id];\n const { validatedByTeacher, assignStatus } = qResp ?? {};\n\n if (validatedByTeacher) {\n return true;\n }\n\n if (assignStatus === 'skipped') {\n return true;\n }\n\n return false;\n });\n\n if (questionIndex === -1) {\n return 0;\n }\n\n if (questionIndex === 0) {\n const unskippedQuestionIndex = [...questions].reverse().findIndex(q => {\n return responses[q.response_id]?.assignStatus !== 'skipped';\n });\n\n return questions.length - unskippedQuestionIndex - 1;\n }\n\n if (userType === 'STUDENT') {\n const lastUnlockedQuestionIndex = questions.length - questionIndex;\n const lastUnlockedQuestion = questions[lastUnlockedQuestionIndex]!;\n const { assignStatus } = responses[lastUnlockedQuestion.response_id] ?? {};\n\n if (lastUnlockedQuestion.is_optional && !assignStatus) {\n return lastUnlockedQuestionIndex - 1;\n }\n\n return lastUnlockedQuestionIndex;\n }\n\n return questions.length - questionIndex;\n};\n\n/**\n * Handles finding last attemptable question when teacher discussion is enabled\n */\nconst getLastAttemptableIndexTeacherDiscussion: IGetLastAttemptableIndexTeacherDiscussion = ({\n questions,\n responses,\n behavior,\n inClass,\n}) => {\n const { attemptsAfterTeacherInterventionNeeded } = behavior;\n\n // Find the first non-attemptable question from the start\n const firstNonAttemptableIndex = questions.findIndex(q => {\n const qResp = responses[q.response_id];\n const { attemptsHistory } = qResp ?? {};\n\n if (q.is_non_question) {\n return qResp?.responseGiven !== true;\n }\n\n if (q.item_type === 'exit-ticket') {\n return qResp?.skipped !== true && qResp?.response === undefined;\n }\n\n const lastAttemptScore = attemptsHistory?.slice(-1)[0]?.score;\n\n if (lastAttemptScore) {\n if ((lastAttemptScore.score ?? 0) === lastAttemptScore.max_score) {\n // Special handling for teacher discussion mode\n if (inClass && q.metadata.acknowledgements && !qResp?.validatedByTeacher) {\n return true;\n }\n\n return false;\n }\n\n const teacherInterventionNeeded = isTeacherInterventionNeeded({\n attemptsAfterTeacherInterventionNeeded,\n attemptsHistory,\n });\n\n if (!teacherInterventionNeeded) return true;\n\n return inClass;\n }\n\n return true;\n });\n\n // If all questions are attempted\n if (firstNonAttemptableIndex === -1) {\n return questions.length - 1;\n }\n\n // If first question is attemptable\n if (firstNonAttemptableIndex === 0) {\n return 0;\n }\n\n // Return the index before the first non-attemptable question\n return firstNonAttemptableIndex;\n};\n\n/**\n * Handles finding last attemptable question for default cases\n */\nconst getLastAttemptableIndexDefault: IGetLastAttemptableIndexDefault = ({\n questions,\n responses,\n behavior,\n}) => {\n const { maximumAttempts, validation, navigationMode } = behavior;\n\n const questionIndex = [...questions].reverse().findIndex(q => {\n const qResp = responses[q.response_id];\n const { attemptsHistory } = qResp ?? {};\n const lastAttemptScore = attemptsHistory?.slice(-1)[0]?.score;\n\n if (lastAttemptScore) {\n if ((lastAttemptScore.score ?? 0) === lastAttemptScore.max_score) return true;\n\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n if (maximumAttemptsReached) return true;\n\n return false;\n }\n\n if (!validation && navigationMode === 'LINEAR' && (qResp?.response || qResp?.skipped)) {\n return true;\n }\n\n return false;\n });\n\n if (questionIndex === -1) {\n return 0;\n }\n\n if (questionIndex === 0) {\n return questions.length - 1;\n }\n\n return questions.length - questionIndex;\n};\n\n/**\n * Main function that delegates to specialized functions based on behavior flags\n */\nexport const getLastAttemptableQuestionIndex: IGetLastAttemptableQuestionIndex = ({\n questions,\n responses,\n behavior,\n userType,\n inClass,\n}) => {\n const { teacherValidationEnabled, teacherDiscussionEnabled } = behavior;\n\n // Teacher validation mode takes precedence\n if (teacherValidationEnabled) {\n return getLastAttemptableIndexTeacherValidation({ questions, responses, userType });\n }\n\n // Teacher discussion mode\n if (teacherDiscussionEnabled) {\n return getLastAttemptableIndexTeacherDiscussion({ questions, responses, behavior, inClass });\n }\n\n // Default behavior\n return getLastAttemptableIndexDefault({ questions, responses, behavior });\n};\n"],"names":["getLastAttemptableIndexTeacherValidation","questions","responses","userType","questionIndex","q","qResp","validatedByTeacher","assignStatus","unskippedQuestionIndex","_a","lastUnlockedQuestionIndex","lastUnlockedQuestion","getLastAttemptableIndexTeacherDiscussion","behavior","inClass","attemptsAfterTeacherInterventionNeeded","firstNonAttemptableIndex","attemptsHistory","lastAttemptScore","isTeacherInterventionNeeded","getLastAttemptableIndexDefault","maximumAttempts","validation","navigationMode","getLastAttemptableQuestionIndex","teacherValidationEnabled","teacherDiscussionEnabled"],"mappings":";AA8CA,MAAMA,IAAsF,CAAC;AAAA,E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AAb;AAG/D,SAAIY,IACK1B,EAAyC,EAAE,WAAAC,GAAW,WAAAC,GAAW,UAAAC,EAAU,CAAA,IAIhFwB,IACKd,EAAyC,EAAE,WAAAZ,GAAW,WAAAC,GAAW,UAAAY,GAAU,SAAAC,GAAS,IAItFM,EAA+B,EAAE,WAAApB,GAAW,WAAAC,GAAW,UAAAY,EAAU,CAAA;AAC1E;"}
@@ -1,18 +0,0 @@
1
- import { getLastAttemptableQuestionIndex as a } from "./get-last-attemptable-question-index.js";
2
- const g = ({
3
- questions: t,
4
- responses: n,
5
- behavior: e,
6
- userType: o,
7
- inClass: r
8
- }) => e.navigationMode === "OPEN" ? t.length - 1 : a({
9
- questions: t,
10
- responses: n,
11
- behavior: e,
12
- userType: o,
13
- inClass: r
14
- });
15
- export {
16
- g as getLastUnlockedQuestionIndex
17
- };
18
- //# sourceMappingURL=get-last-unlocked-question-index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-last-unlocked-question-index.js","sources":["../../../../../../src/features/worksheet/worksheet/worksheet-store/helpers/get-last-unlocked-question-index.ts"],"sourcesContent":["import type {\n IWorksheetBehavior,\n IWorksheetQuestion,\n IWorksheetResponse,\n} from '../../worksheet-types';\nimport type { TUserTypes } from '../../../../ui/types';\nimport { getLastAttemptableQuestionIndex } from './get-last-attemptable-question-index';\n\ninterface IGetLastUnlockedQuestionIndex {\n (options: {\n questions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n behavior: IWorksheetBehavior;\n userType: TUserTypes;\n inClass: boolean;\n }): number;\n}\n\nexport const getLastUnlockedQuestionIndex: IGetLastUnlockedQuestionIndex = ({\n questions,\n responses,\n behavior,\n userType,\n inClass,\n}) => {\n if (behavior.navigationMode === 'OPEN') {\n return questions.length - 1;\n }\n\n return getLastAttemptableQuestionIndex({\n questions,\n responses,\n behavior,\n userType,\n inClass,\n });\n};\n"],"names":["getLastUnlockedQuestionIndex","questions","responses","behavior","userType","inClass","getLastAttemptableQuestionIndex"],"mappings":";AAkBO,MAAMA,IAA8D,CAAC;AAAA,EAC1E,WAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AACF,MACMF,EAAS,mBAAmB,SACvBF,EAAU,SAAS,IAGrBK,EAAgC;AAAA,EACrC,WAAAL;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,SAAAC;AAAA,CACD;"}
@@ -1,19 +0,0 @@
1
- import { getQuestionMetadata as s } from "../../worksheet-helpers.js";
2
- const i = (e, o, r) => {
3
- const n = s(e.questions, o);
4
- return n ? {
5
- ...e,
6
- responses: {
7
- ...e.responses,
8
- [o]: {
9
- ...n,
10
- ...e.responses[o],
11
- ...r
12
- }
13
- }
14
- } : e;
15
- };
16
- export {
17
- i as getMergedResponseState
18
- };
19
- //# sourceMappingURL=get-merged-response-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-merged-response-state.js","sources":["../../../../../../src/features/worksheet/worksheet/worksheet-store/helpers/get-merged-response-state.ts"],"sourcesContent":["import { getQuestionMetadata } from '../../worksheet-helpers';\nimport type { IWorksheetResponse, IWorksheetStore } from '../../worksheet-types';\n\ninterface IGetMergedResponseState {\n (\n state: IWorksheetStore,\n responseId: string,\n newResponse: Partial<IWorksheetResponse>,\n ): IWorksheetStore;\n}\nexport const getMergedResponseState: IGetMergedResponseState = (state, responseId, newResponse) => {\n const questionMeta = getQuestionMetadata(state.questions, responseId);\n\n if (!questionMeta) return state;\n\n return {\n ...state,\n responses: {\n ...state.responses,\n [responseId]: {\n ...questionMeta,\n ...state.responses[responseId],\n ...newResponse,\n },\n },\n };\n};\n"],"names":["getMergedResponseState","state","responseId","newResponse","questionMeta","getQuestionMetadata"],"mappings":";AAUO,MAAMA,IAAkD,CAACC,GAAOC,GAAYC,MAAgB;AACjG,QAAMC,IAAeC,EAAoBJ,EAAM,WAAWC,CAAU;AAEhE,SAACE,IAEE;AAAA,IACL,GAAGH;AAAA,IACH,WAAW;AAAA,MACT,GAAGA,EAAM;AAAA,MACT,CAACC,CAAU,GAAG;AAAA,QACZ,GAAGE;AAAA,QACH,GAAGH,EAAM,UAAUC,CAAU;AAAA,QAC7B,GAAGC;AAAA,MACL;AAAA,IACF;AAAA,EAAA,IAXwBF;AAa5B;"}
@@ -1,138 +0,0 @@
1
- import { EWorksheetActivity as S } from "../../../../../types/models/worksheet.js";
2
- import { OPTIONAL_ITEM_TYPES as T } from "../../constants.js";
3
- import { isConceptIntroWidget as I } from "../../worksheet-helpers.js";
4
- import { QUESTION_TAGS as f } from "../../worksheet-types.js";
5
- const L = (c) => {
6
- switch (c) {
7
- case "overview":
8
- return "overview";
9
- case "learning":
10
- case "learning-we-do":
11
- case "learning-your-turn":
12
- case "learning-explore":
13
- return "learning";
14
- case "practice":
15
- return "practice";
16
- case "practice-basic":
17
- case "practice-basic-optional":
18
- return "practice-basic";
19
- case "practice-regular":
20
- case "practice-regular-optional":
21
- return "practice-regular";
22
- case "exit-ticket":
23
- return "exit-ticket";
24
- case "advanced-explore":
25
- case "advanced-we-do":
26
- case "advanced-your-turn":
27
- case "advanced-practice":
28
- return "advanced";
29
- default:
30
- return;
31
- }
32
- }, w = (c) => c.reduce((h, m) => {
33
- const [l, g] = m.split(":"), s = l == null ? void 0 : l.trim(), t = g == null ? void 0 : g.trim();
34
- return !s || !t ? h : {
35
- ...h,
36
- [s.toLowerCase()]: t
37
- };
38
- }, {}), V = (c, { nodeType: h, activityType: m }) => {
39
- const l = c.reduce(
40
- (s, t, o) => t.questions.reduce((n, e, i) => (n[e.response_id] = {
41
- ...e,
42
- // 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
43
- feedback_attempts: void 0,
44
- item_reference: t.reference,
45
- item_number: o,
46
- item_display_number: o + 1,
47
- item_tags: t.tags ?? [],
48
- item_tags_map: w(t.tags ?? []),
49
- question_number: i,
50
- total_questions: t.questions.length
51
- }, n), s),
52
- {}
53
- );
54
- if (h === "LEARNING" && (m === S.LESSON_V3 || m == S.LESSON_V3_1))
55
- return c.reduce((s, t, o) => {
56
- var N;
57
- let n = !1, e;
58
- const { content: i, itemType: r } = t, d = L(r), a = s[s.length - 1], v = d === (a == null ? void 0 : a.section_name) && (a != null && a.item_display_number) ? a.item_display_number + 1 : 1, O = i.match(/question-[^"]*/g), p = O == null ? void 0 : O.reduce(
59
- (_, u, b) => {
60
- const E = l[u.replace("question-", "")];
61
- if (!E)
62
- throw new Error(`Question not found for the response id: ${u}`);
63
- const q = I(E.instructor_stimulus);
64
- return n = n || q, q && m === S.LESSON_V3_1 ? (e = E.stimulus, _) : (_.push({
65
- ...E,
66
- concept_intro_stimulus: e,
67
- is_non_question: m === S.LESSON_V3_1 && r === "overview",
68
- item_display_number: v,
69
- section_name: d,
70
- item_type: r,
71
- is_optional: r ? T.includes(r) : !1,
72
- question_number: b - (n ? 1 : 0),
73
- total_questions: O.length
74
- }), e && (e = void 0), _);
75
- },
76
- []
77
- );
78
- if (n = !1, p != null && p[0] && o > 0 && c.length > 0) {
79
- const _ = (N = c[o - 1]) == null ? void 0 : N.itemType, u = r != null && r.startsWith("advanced-") ? "advanced" : r, b = _ != null && _.startsWith("advanced-") ? "advanced" : _;
80
- if ((u === "practice" || u === "practice-basic" || u === "practice-regular" || u === "exit-ticket" || u === "advanced") && u !== b)
81
- return [
82
- ...s,
83
- {
84
- ...p[0],
85
- metadata: {
86
- ...p[0].metadata,
87
- teacher_tips: void 0,
88
- hints: void 0,
89
- solution: void 0
90
- },
91
- instructor_stimulus: "SystemIntro",
92
- response_id: `${r}-system-intro`,
93
- is_optional: r == null ? void 0 : r.startsWith("advanced-"),
94
- is_non_question: m === S.LESSON_V3_1
95
- },
96
- ...p ?? []
97
- ];
98
- }
99
- return [...s, ...p ?? []];
100
- }, []);
101
- const g = c.reduce((s, t) => {
102
- const { content: o } = t, n = o.match(/question-[^"]*/g), e = n == null ? void 0 : n.map(
103
- (i, r) => {
104
- const d = l[i.replace("question-", "")];
105
- if (!d)
106
- throw new Error(`Question not found for the response id: ${i}`);
107
- return {
108
- ...d,
109
- question_number: r,
110
- total_questions: n.length
111
- };
112
- }
113
- );
114
- return [...s, ...e ?? []];
115
- }, []);
116
- if (h === "TRIAL_DIAGNOSTIC") {
117
- const s = [], t = {};
118
- return g.sort((o, n) => {
119
- var a, v;
120
- const e = o.item_tags_map[f.TRIAL_TOPIC], i = n.item_tags_map[f.TRIAL_TOPIC];
121
- if (e && t[e] === void 0 && (t[e] = s.length, s.push(e)), i && t[i] === void 0 && (t[i] = s.length, s.push(i)), !e || !i)
122
- return 0;
123
- const r = `${t[e]}-${((a = o.item_tags_map[f.QUESTION_CODE]) == null ? void 0 : a.length) ?? 0}`, d = `${t[i]}-${((v = n.item_tags_map[f.QUESTION_CODE]) == null ? void 0 : v.length) ?? 0}`;
124
- return r > d ? 1 : -1;
125
- }).map((o) => {
126
- const n = t[o.item_tags_map[f.TRIAL_TOPIC] ?? ""] ?? 0, e = o.item_tags_map[f.QUESTION_CODE] ?? "";
127
- return {
128
- ...o,
129
- item_display_number: n * 3 + e.length
130
- };
131
- });
132
- }
133
- return g;
134
- };
135
- export {
136
- V as getQuestionsFromItems
137
- };
138
- //# sourceMappingURL=get-questions-from-items.js.map
@@ -1 +0,0 @@
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 };\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 } 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 },\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,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AAE,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,9 +0,0 @@
1
- const u = ({
2
- userType: e,
3
- questions: r,
4
- lastUnlockedQuestionIndex: t
5
- }) => r.filter((s, n) => e === "TEACHER" ? !0 : n <= t);
6
- export {
7
- u as getRenderableQuestions
8
- };
9
- //# sourceMappingURL=get-renderable-questions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-renderable-questions.js","sources":["../../../../../../src/features/worksheet/worksheet/worksheet-store/helpers/get-renderable-questions.ts"],"sourcesContent":["import type { IWorksheetStore } from '../../worksheet-types';\n\ninterface IGetRenderableQuestions {\n (\n options: Pick<IWorksheetStore, 'questions' | 'lastUnlockedQuestionIndex' | 'userType'>,\n ): IWorksheetStore['questions'];\n}\nexport const getRenderableQuestions: IGetRenderableQuestions = ({\n userType,\n questions,\n lastUnlockedQuestionIndex,\n}) => {\n return questions.filter((_, index) => {\n const isUnlocked = userType === 'TEACHER' ? true : index <= lastUnlockedQuestionIndex;\n\n if (!isUnlocked) return false;\n\n return true;\n });\n};\n"],"names":["getRenderableQuestions","userType","questions","lastUnlockedQuestionIndex","_","index"],"mappings":"AAOO,MAAMA,IAAkD,CAAC;AAAA,EAC9D,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,2BAAAC;AACF,MACSD,EAAU,OAAO,CAACE,GAAGC,MACPJ,MAAa,YAAY,KAAOI,KAASF,CAK7D;"}