@cuemath/leap 3.2.15-link.1 → 3.2.16-pzd-beta-0.1
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.
- package/dist/assets/illustrations/illustrations.js +1 -6
- package/dist/assets/illustrations/illustrations.js.map +1 -1
- package/dist/assets/line-icons/icons/cue-board-filled.js +33 -0
- package/dist/assets/line-icons/icons/cue-board-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/cue-board.js +23 -0
- package/dist/assets/line-icons/icons/cue-board.js.map +1 -0
- package/dist/assets/line-icons/icons/hint-fill.js +35 -0
- package/dist/assets/line-icons/icons/hint-fill.js.map +1 -0
- package/dist/assets/line-icons/icons/screen-grab-filled.js +35 -0
- package/dist/assets/line-icons/icons/screen-grab-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/screen-grab.js +23 -0
- package/dist/assets/line-icons/icons/screen-grab.js.map +1 -0
- package/dist/assets/line-icons/icons/sticker-filled.js +64 -0
- package/dist/assets/line-icons/icons/sticker-filled.js.map +1 -0
- package/dist/assets/line-icons/icons/sticker.js +46 -0
- package/dist/assets/line-icons/icons/sticker.js.map +1 -0
- package/dist/assets/lottie/lottie.js +6 -11
- package/dist/assets/lottie/lottie.js.map +1 -1
- package/dist/features/analytics-events/platform-events-student.js +2 -1
- package/dist/features/analytics-events/platform-events-student.js.map +1 -1
- package/dist/features/analytics-events/platform-events-teacher.js +6 -4
- package/dist/features/analytics-events/platform-events-teacher.js.map +1 -1
- package/dist/features/analytics-events/whitelist-events.js +10 -8
- package/dist/features/analytics-events/whitelist-events.js.map +1 -1
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js +13 -18
- package/dist/features/auth/comps/auth-page-layout/auth-page-layout.js.map +1 -1
- package/dist/features/auth/comps/resend-otp/resend-otp.js +47 -54
- package/dist/features/auth/comps/resend-otp/resend-otp.js.map +1 -1
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js +17 -29
- package/dist/features/auth/comps/tabs/tab-tem/tab-item.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs-styled.js +10 -22
- package/dist/features/auth/comps/tabs/tabs-styled.js.map +1 -1
- package/dist/features/auth/comps/tabs/tabs.js +5 -5
- package/dist/features/auth/comps/tabs/tabs.js.map +1 -1
- package/dist/features/chapters-v2/utils/node-card-utils.js +9 -9
- package/dist/features/chapters-v2/utils/node-card-utils.js.map +1 -1
- package/dist/features/communication/pub-sub/constants.js +7 -4
- package/dist/features/communication/pub-sub/constants.js.map +1 -1
- package/dist/features/homework/homework-card-view.js +85 -97
- package/dist/features/homework/homework-card-view.js.map +1 -1
- package/dist/features/homework/homework-card.js +44 -42
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list-view.js +31 -29
- package/dist/features/homework/hw-card-list/hw-card-list-view.js.map +1 -1
- package/dist/features/homework/hw-card-list/hw-card-list.js +57 -50
- package/dist/features/homework/hw-card-list/hw-card-list.js.map +1 -1
- package/dist/features/homework/utils.js +33 -27
- package/dist/features/homework/utils.js.map +1 -1
- package/dist/features/journey/comps/coachmark/coachmark.js +29 -28
- package/dist/features/journey/comps/coachmark/coachmark.js.map +1 -1
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js +17 -11
- package/dist/features/journey/hooks/use-home-page-journey/tooltip-item.js.map +1 -1
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js +72 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-assigned.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js +63 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-dashboard-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js +67 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-intro-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-progress-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js +59 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js.map +1 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js +70 -0
- package/dist/features/journey/hooks/use-puzzles-journey/use-teacher-puzzle-assigned-journey.js.map +1 -0
- package/dist/features/journey/journey-id/journey-id-student.js +2 -2
- package/dist/features/journey/journey-id/journey-id-student.js.map +1 -1
- package/dist/features/journey/journey-id/journey-id-teacher.js +2 -2
- package/dist/features/journey/journey-id/journey-id-teacher.js.map +1 -1
- package/dist/features/journey/use-journey/journey-context-provider.js +73 -72
- package/dist/features/journey/use-journey/journey-context-provider.js.map +1 -1
- package/dist/features/journey/use-journey/journey-styled.js +6 -4
- package/dist/features/journey/use-journey/journey-styled.js.map +1 -1
- package/dist/features/puzzles/api/puzzle-dashboard.js +10 -0
- package/dist/features/puzzles/api/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app-styled.js +81 -0
- package/dist/features/puzzles/app/puzzle-app-styled.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app-view.js +120 -0
- package/dist/features/puzzles/app/puzzle-app-view.js.map +1 -0
- package/dist/features/puzzles/app/puzzle-app.js +62 -0
- package/dist/features/puzzles/app/puzzle-app.js.map +1 -0
- package/dist/features/puzzles/comps/puzzle-card-styled.js +24 -69
- package/dist/features/puzzles/comps/puzzle-card-styled.js.map +1 -1
- package/dist/features/puzzles/comps/puzzle-card.js +64 -30
- package/dist/features/puzzles/comps/puzzle-card.js.map +1 -1
- package/dist/features/puzzles/constants/puzzle-container.js +8 -0
- package/dist/features/puzzles/constants/puzzle-container.js.map +1 -0
- package/dist/features/puzzles/puzzle-analytics-events.js +11 -0
- package/dist/features/puzzles/puzzle-analytics-events.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js +55 -25
- package/dist/features/puzzles/puzzle-container/puzzle-container-styled.js.map +1 -1
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js +55 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container-view.js.map +1 -0
- package/dist/features/puzzles/puzzle-container/puzzle-container.js +100 -107
- package/dist/features/puzzles/puzzle-container/puzzle-container.js.map +1 -1
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js +37 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard-styled.js.map +1 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js +110 -0
- package/dist/features/puzzles/puzzle-dashboard/puzzle-dashboard.js.map +1 -0
- package/dist/features/puzzles/utils/puzzle-pattern.js +28 -13
- package/dist/features/puzzles/utils/puzzle-pattern.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js +50 -7
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro-styled.js.map +1 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js +69 -15
- package/dist/features/trial-session/comps/teacher-intro/teacher-intro.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js +6 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-constants.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js +12 -60
- package/dist/features/ui/arrow-tooltip/arrow-tooltip-styled.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js +72 -77
- package/dist/features/ui/arrow-tooltip/arrow-tooltip.js.map +1 -1
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js +63 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body-styled.js.map +1 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js +21 -0
- package/dist/features/ui/arrow-tooltip/comps/tooltip-body.js.map +1 -0
- package/dist/features/ui/image/image.js +1 -1
- package/dist/features/ui/image/image.js.map +1 -1
- package/dist/features/ui/inputs/base-input/base-input.js +11 -11
- package/dist/features/ui/inputs/base-input/base-input.js.map +1 -1
- package/dist/features/ui/inputs/text-input/text-input.js +18 -19
- package/dist/features/ui/inputs/text-input/text-input.js.map +1 -1
- package/dist/features/ui/modals/modal-styled.js +8 -43
- package/dist/features/ui/modals/modal-styled.js.map +1 -1
- package/dist/features/ui/modals/modal.js +27 -37
- package/dist/features/ui/modals/modal.js.map +1 -1
- package/dist/features/ui/nudge/nudge-styled.js +14 -7
- package/dist/features/ui/nudge/nudge-styled.js.map +1 -1
- package/dist/features/ui/nudge/nudge.js +13 -12
- package/dist/features/ui/nudge/nudge.js.map +1 -1
- package/dist/features/ui/text/text.js +29 -31
- package/dist/features/ui/text/text.js.map +1 -1
- package/dist/features/ui/theme/button.js +78 -78
- package/dist/features/ui/theme/button.js.map +1 -1
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js +28 -0
- package/dist/features/worksheet/worksheet/hooks/use-worksheet-journey.js.map +1 -0
- package/dist/features/worksheet/worksheet/worksheet-helpers.js +20 -19
- package/dist/features/worksheet/worksheet/worksheet-helpers.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js +29 -25
- package/dist/features/worksheet/worksheet/worksheet-question/learnosity-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js +101 -47
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js +149 -146
- package/dist/features/worksheet/worksheet/worksheet-question/worksheet-question.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js +242 -207
- package/dist/features/worksheet/worksheet/worksheet-questions-controller/worksheet-questions-controller.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-styled.js +37 -37
- package/dist/features/worksheet/worksheet/worksheet-styled.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +307 -313
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +44 -35
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +125 -156
- package/dist/index.js +520 -524
- package/dist/index.js.map +1 -1
- package/dist/static/nudge-tap.0591aef4.json +1 -0
- package/dist/static/puzzle-blue-lottie.7017e2e8.json +1 -0
- package/dist/static/puzzle-blue-lottie.bf64ebc5.json +12760 -0
- package/dist/static/puzzle-dashboard-banner.b7956519.svg +1 -0
- package/dist/static/puzzle-green-lottie.1da90698.json +1 -0
- package/dist/static/puzzle-orange-lottie.cfcf3724.json +1 -0
- package/dist/static/puzzle-purple-lottie.e70de110.json +9860 -0
- package/dist/static/puzzle-yellow-lottie.275b5cf4.json +1 -0
- package/package.json +3 -2
- package/dist/assets/line-icons/icons/after-noon.js +0 -34
- package/dist/assets/line-icons/icons/after-noon.js.map +0 -1
- package/dist/assets/line-icons/icons/apple-icon-white.js +0 -42
- package/dist/assets/line-icons/icons/apple-icon-white.js.map +0 -1
- package/dist/assets/line-icons/icons/evening.js +0 -35
- package/dist/assets/line-icons/icons/evening.js.map +0 -1
- package/dist/assets/line-icons/icons/morning.js +0 -35
- package/dist/assets/line-icons/icons/morning.js.map +0 -1
- package/dist/assets/line-icons/icons/star3.js +0 -32
- package/dist/assets/line-icons/icons/star3.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js +0 -9
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-constants.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js +0 -65
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message-styled.js.map +0 -1
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js +0 -92
- package/dist/features/auth/comps/animated-avatar-message/animated-avatar-message.js.map +0 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js +0 -12
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar-styled.js.map +0 -1
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js +0 -34
- package/dist/features/auth/comps/linear-progress-bar/linear-progress-bar.js.map +0 -1
- package/dist/features/auth/comps/otp-input/otp-input-styled.js +0 -22
- package/dist/features/auth/comps/otp-input/otp-input-styled.js.map +0 -1
- package/dist/features/auth/comps/otp-input/otp-input.js +0 -51
- package/dist/features/auth/comps/otp-input/otp-input.js.map +0 -1
- package/dist/features/auth/comps/pill-button/pill-button-styled.js +0 -44
- package/dist/features/auth/comps/pill-button/pill-button-styled.js.map +0 -1
- package/dist/features/auth/comps/pill-button/pill-button.js +0 -75
- package/dist/features/auth/comps/pill-button/pill-button.js.map +0 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js +0 -17
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card-styled.js.map +0 -1
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js +0 -67
- package/dist/features/auth/comps/selectable-info-card/selectable-info-card.js.map +0 -1
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-constants.js +0 -19
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-constants.js.map +0 -1
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-styled.js +0 -32
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide-styled.js.map +0 -1
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide.js +0 -44
- package/dist/features/auth/signup-v2/onboarding-guide/onboarding-guide.js.map +0 -1
- package/dist/features/auth/signup-v2/signup-header/signup-header.js +0 -54
- package/dist/features/auth/signup-v2/signup-header/signup-header.js.map +0 -1
- package/dist/features/auth/signup-v2/signup-options/signup-options.js +0 -83
- package/dist/features/auth/signup-v2/signup-options/signup-options.js.map +0 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js +0 -49
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile-styled.js.map +0 -1
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js +0 -64
- package/dist/features/trial-session/comps/teacher-intro/teacher-profile/teacher-profile.js.map +0 -1
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js +0 -28
- package/dist/features/ui/accordion/accordion-items/accordion-items-styled.js.map +0 -1
- package/dist/features/ui/accordion/accordion-items/accordion-items.js +0 -83
- package/dist/features/ui/accordion/accordion-items/accordion-items.js.map +0 -1
- package/dist/features/ui/accordion/accordion.js +0 -62
- package/dist/features/ui/accordion/accordion.js.map +0 -1
- package/dist/static/animated-avatar.1ad58b1d.json +0 -1
- package/dist/static/animated-avatar.69b07505.json +0 -1
- package/dist/static/animated-avatar.9c560b46.json +0 -1
- package/dist/static/calendar-purple.1a840b41.svg +0 -1
- package/dist/static/flying-disk.c7f6ed39.json +0 -1
- package/dist/static/graduation-cap.3be3340a.json +0 -1
- package/dist/static/handshake.287e7dfb.svg +0 -1
- package/dist/static/light-bulb.c6db0b23.json +0 -1
- package/dist/static/money.332aacf1.svg +0 -1
- package/dist/static/muscle.9bcfb8a7.json +0 -1
- package/dist/static/nudge-tap.5cb30093.json +0 -1057
- package/dist/static/parent-avatar.822c7b9b.svg +0 -1
- package/dist/static/pencil.23df9da0.json +0 -1
- package/dist/static/plus-sign.de6af957.json +0 -1
- package/dist/static/racing-car.2cbf864e.json +0 -1
- package/dist/static/rocket.0a3ccab0.json +0 -1
- package/dist/static/shovel.abeec04c.json +0 -1
- package/dist/static/stripe-blurple.6abf422f.svg +0 -1
- package/dist/static/trustpilot.bd3d79e1.svg +0 -1
@@ -1,48 +1,48 @@
|
|
1
|
-
const
|
1
|
+
const e = (i) => ({ sizes: {
|
2
2
|
xsmall: {
|
3
|
-
height:
|
4
|
-
paddingHorizontal:
|
3
|
+
height: i * 2,
|
4
|
+
paddingHorizontal: i * 1.375,
|
5
5
|
textVariant: "ub3-bold",
|
6
6
|
borderWidth: 1,
|
7
|
-
iconSize:
|
8
|
-
iconPadding:
|
9
|
-
loaderSize:
|
7
|
+
iconSize: i,
|
8
|
+
iconPadding: i * 0.25,
|
9
|
+
loaderSize: i * 1.25
|
10
10
|
},
|
11
11
|
small: {
|
12
|
-
height:
|
13
|
-
paddingHorizontal:
|
12
|
+
height: i * 2.5,
|
13
|
+
paddingHorizontal: i * 1.625,
|
14
14
|
textVariant: "ub2-bold",
|
15
15
|
borderWidth: 1,
|
16
|
-
iconSize:
|
17
|
-
iconPadding:
|
18
|
-
loaderSize:
|
16
|
+
iconSize: i * 1.25,
|
17
|
+
iconPadding: i * 0.375,
|
18
|
+
loaderSize: i * 1.5
|
19
19
|
},
|
20
20
|
regular: {
|
21
|
-
height:
|
22
|
-
paddingHorizontal:
|
21
|
+
height: i * 3,
|
22
|
+
paddingHorizontal: i * 1.875,
|
23
23
|
textVariant: "ub1-bold",
|
24
24
|
borderWidth: 1,
|
25
|
-
iconSize:
|
26
|
-
iconPadding:
|
27
|
-
loaderSize:
|
25
|
+
iconSize: i * 1.5,
|
26
|
+
iconPadding: i * 0.5,
|
27
|
+
loaderSize: i * 1.75
|
28
28
|
},
|
29
29
|
medium: {
|
30
|
-
height:
|
31
|
-
paddingHorizontal:
|
30
|
+
height: i * 3.5,
|
31
|
+
paddingHorizontal: i * 2.125,
|
32
32
|
textVariant: "ub1-bold",
|
33
33
|
borderWidth: 1.5,
|
34
|
-
iconSize:
|
35
|
-
iconPadding:
|
36
|
-
loaderSize:
|
34
|
+
iconSize: i * 1.5,
|
35
|
+
iconPadding: i * 0.5,
|
36
|
+
loaderSize: i * 2
|
37
37
|
},
|
38
38
|
large: {
|
39
|
-
height:
|
40
|
-
paddingHorizontal:
|
39
|
+
height: i * 4,
|
40
|
+
paddingHorizontal: i * 2.375,
|
41
41
|
textVariant: "ub1-bold",
|
42
42
|
borderWidth: 2,
|
43
|
-
iconSize:
|
44
|
-
iconPadding:
|
45
|
-
loaderSize:
|
43
|
+
iconSize: i * 1.5,
|
44
|
+
iconPadding: i * 0.5,
|
45
|
+
loaderSize: i * 2.25
|
46
46
|
}
|
47
47
|
}, variants: {
|
48
48
|
primary: {
|
@@ -129,57 +129,6 @@ const d = (a) => ({ sizes: {
|
|
129
129
|
active: "BLACK",
|
130
130
|
disabled: "WHITE_T_15"
|
131
131
|
}
|
132
|
-
},
|
133
|
-
black: {
|
134
|
-
backgroundColorName: {
|
135
|
-
inactive: "BLACK_1",
|
136
|
-
active: "BLACK_T_60",
|
137
|
-
disabled: "BLACK_T_15"
|
138
|
-
},
|
139
|
-
borderColorName: {
|
140
|
-
inactive: "BLACK_1",
|
141
|
-
active: "BLACK_1",
|
142
|
-
disabled: "BLACK_T_15"
|
143
|
-
},
|
144
|
-
colorName: {
|
145
|
-
inactive: "WHITE_1",
|
146
|
-
active: "WHITE_1",
|
147
|
-
disabled: "WHITE_T_87"
|
148
|
-
}
|
149
|
-
},
|
150
|
-
"black-dark": {
|
151
|
-
backgroundColorName: {
|
152
|
-
inactive: "BLACK_1",
|
153
|
-
active: "BLACK_4",
|
154
|
-
disabled: "WHITE_T_10"
|
155
|
-
},
|
156
|
-
borderColorName: {
|
157
|
-
inactive: "WHITE_1",
|
158
|
-
active: "WHITE_1",
|
159
|
-
disabled: "WHITE_T_15"
|
160
|
-
},
|
161
|
-
colorName: {
|
162
|
-
inactive: "WHITE_1",
|
163
|
-
active: "WHITE_1",
|
164
|
-
disabled: "WHITE_T_38"
|
165
|
-
}
|
166
|
-
},
|
167
|
-
"yellow-dark": {
|
168
|
-
backgroundColorName: {
|
169
|
-
inactive: "YELLOW_4",
|
170
|
-
active: "YELLOW_3",
|
171
|
-
disabled: "WHITE_T_10"
|
172
|
-
},
|
173
|
-
borderColorName: {
|
174
|
-
inactive: "WHITE",
|
175
|
-
active: "WHITE",
|
176
|
-
disabled: "WHITE_T_15"
|
177
|
-
},
|
178
|
-
colorName: {
|
179
|
-
inactive: "BLACK_1",
|
180
|
-
active: "BLACK_1",
|
181
|
-
disabled: "WHITE_T_38"
|
182
|
-
}
|
183
132
|
}
|
184
133
|
// 'yellow': {
|
185
134
|
// backgroundColorName: {
|
@@ -198,6 +147,23 @@ const d = (a) => ({ sizes: {
|
|
198
147
|
// disabled: 'BLACK_T_35',
|
199
148
|
// },
|
200
149
|
// },
|
150
|
+
// 'yellow-dark': {
|
151
|
+
// backgroundColorName: {
|
152
|
+
// inactive: 'YELLOW_4',
|
153
|
+
// active: 'WHITE_4',
|
154
|
+
// disabled: 'WHITE_T_40',
|
155
|
+
// },
|
156
|
+
// borderColorName: {
|
157
|
+
// inactive: 'BLACK_4',
|
158
|
+
// active: 'BLACK_4',
|
159
|
+
// disabled: 'WHITE_T_40',
|
160
|
+
// },
|
161
|
+
// colorName: {
|
162
|
+
// inactive: 'BLACK_4',
|
163
|
+
// active: 'BLACK_4',
|
164
|
+
// disabled: 'WHITE_T_40',
|
165
|
+
// },
|
166
|
+
// },
|
201
167
|
// 'white': {
|
202
168
|
// backgroundColorName: {
|
203
169
|
// inactive: 'WHITE_1',
|
@@ -232,8 +198,42 @@ const d = (a) => ({ sizes: {
|
|
232
198
|
// disabled: 'WHITE_T_40',
|
233
199
|
// },
|
234
200
|
// },
|
201
|
+
// 'black': {
|
202
|
+
// backgroundColorName: {
|
203
|
+
// inactive: 'BLACK_4',
|
204
|
+
// active: 'BLACK_T_60',
|
205
|
+
// disabled: 'BLACK_T_35',
|
206
|
+
// },
|
207
|
+
// borderColorName: {
|
208
|
+
// inactive: 'BLACK_4',
|
209
|
+
// active: 'BLACK_4',
|
210
|
+
// disabled: 'BLACK_T_35',
|
211
|
+
// },
|
212
|
+
// colorName: {
|
213
|
+
// inactive: 'WHITE_4',
|
214
|
+
// active: 'WHITE_4',
|
215
|
+
// disabled: 'BLACK_T_35',
|
216
|
+
// },
|
217
|
+
// },
|
218
|
+
// 'black-dark': {
|
219
|
+
// backgroundColorName: {
|
220
|
+
// inactive: 'BLACK_4',
|
221
|
+
// active: 'WHITE_T_40',
|
222
|
+
// disabled: 'WHITE_T_40',
|
223
|
+
// },
|
224
|
+
// borderColorName: {
|
225
|
+
// inactive: 'WHITE_4',
|
226
|
+
// active: 'WHITE_4',
|
227
|
+
// disabled: 'WHITE_T_40',
|
228
|
+
// },
|
229
|
+
// colorName: {
|
230
|
+
// inactive: 'WHITE_4',
|
231
|
+
// active: 'WHITE_4',
|
232
|
+
// disabled: 'WHITE_T_40',
|
233
|
+
// },
|
234
|
+
// },
|
235
235
|
} });
|
236
236
|
export {
|
237
|
-
|
237
|
+
e as default
|
238
238
|
};
|
239
239
|
//# sourceMappingURL=button.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../../src/features/ui/theme/button.ts"],"sourcesContent":["import type {\n IButtonSizeConfig,\n TButtonSizes,\n IButtonVariantConfig,\n TButtonVariants,\n} from '../types';\n\ninterface IGetButtonConfig {\n (gutter: number): {\n sizes: Record<TButtonSizes, IButtonSizeConfig>;\n variants: Record<TButtonVariants, IButtonVariantConfig>;\n };\n}\n\nconst getButtonConfig: IGetButtonConfig = (gutter: number) => {\n const sizes: Record<TButtonSizes, IButtonSizeConfig> = {\n xsmall: {\n height: gutter * 2,\n paddingHorizontal: gutter * (1 + 0.375),\n textVariant: 'ub3-bold',\n borderWidth: 1,\n iconSize: gutter,\n iconPadding: gutter * 0.25,\n loaderSize: gutter * 1.25,\n },\n small: {\n height: gutter * 2.5,\n paddingHorizontal: gutter * (1 + 0.625),\n textVariant: 'ub2-bold',\n borderWidth: 1,\n iconSize: gutter * 1.25,\n iconPadding: gutter * 0.375,\n loaderSize: gutter * 1.5,\n },\n regular: {\n height: gutter * 3,\n paddingHorizontal: gutter * (1 + 0.875),\n textVariant: 'ub1-bold',\n borderWidth: 1,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 1.75,\n },\n medium: {\n height: gutter * 3.5,\n paddingHorizontal: gutter * (1 + 1.125),\n textVariant: 'ub1-bold',\n borderWidth: 1.5,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 2,\n },\n large: {\n height: gutter * 4,\n paddingHorizontal: gutter * (1 + 1.375),\n textVariant: 'ub1-bold',\n borderWidth: 2,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 2.25,\n },\n };\n\n const variants: Record<TButtonVariants, IButtonVariantConfig> = {\n 'primary': {\n backgroundColorName: {\n inactive: 'YELLOW_4',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'tertiary': {\n backgroundColorName: {\n inactive: 'RED',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'WHITE',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary-gray': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'WHITE_4',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary-dark': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'WHITE_T_10',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'WHITE_T_38',\n },\n borderColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'WHITE_T_15',\n },\n },\n '
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../../src/features/ui/theme/button.ts"],"sourcesContent":["import type {\n IButtonSizeConfig,\n TButtonSizes,\n IButtonVariantConfig,\n TButtonVariants,\n} from '../types';\n\ninterface IGetButtonConfig {\n (gutter: number): {\n sizes: Record<TButtonSizes, IButtonSizeConfig>;\n variants: Record<TButtonVariants, IButtonVariantConfig>;\n };\n}\n\nconst getButtonConfig: IGetButtonConfig = (gutter: number) => {\n const sizes: Record<TButtonSizes, IButtonSizeConfig> = {\n xsmall: {\n height: gutter * 2,\n paddingHorizontal: gutter * (1 + 0.375),\n textVariant: 'ub3-bold',\n borderWidth: 1,\n iconSize: gutter,\n iconPadding: gutter * 0.25,\n loaderSize: gutter * 1.25,\n },\n small: {\n height: gutter * 2.5,\n paddingHorizontal: gutter * (1 + 0.625),\n textVariant: 'ub2-bold',\n borderWidth: 1,\n iconSize: gutter * 1.25,\n iconPadding: gutter * 0.375,\n loaderSize: gutter * 1.5,\n },\n regular: {\n height: gutter * 3,\n paddingHorizontal: gutter * (1 + 0.875),\n textVariant: 'ub1-bold',\n borderWidth: 1,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 1.75,\n },\n medium: {\n height: gutter * 3.5,\n paddingHorizontal: gutter * (1 + 1.125),\n textVariant: 'ub1-bold',\n borderWidth: 1.5,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 2,\n },\n large: {\n height: gutter * 4,\n paddingHorizontal: gutter * (1 + 1.375),\n textVariant: 'ub1-bold',\n borderWidth: 2,\n iconSize: gutter * 1.5,\n iconPadding: gutter * 0.5,\n loaderSize: gutter * 2.25,\n },\n };\n\n const variants: Record<TButtonVariants, IButtonVariantConfig> = {\n 'primary': {\n backgroundColorName: {\n inactive: 'YELLOW_4',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'tertiary': {\n backgroundColorName: {\n inactive: 'RED',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'WHITE',\n active: 'WHITE',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary-gray': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'WHITE_4',\n disabled: 'GREY_3',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'BLACK',\n },\n borderColorName: {\n inactive: 'BLACK',\n active: 'BLACK',\n disabled: 'GREY_3',\n },\n },\n 'secondary-dark': {\n backgroundColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'WHITE_T_10',\n },\n colorName: {\n inactive: 'BLACK',\n active: 'WHITE',\n disabled: 'WHITE_T_38',\n },\n borderColorName: {\n inactive: 'WHITE',\n active: 'BLACK',\n disabled: 'WHITE_T_15',\n },\n },\n // 'yellow': {\n // backgroundColorName: {\n // inactive: 'YELLOW_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // colorName: {\n // inactive: 'BLACK_4',\n // active: 'WHITE_4',\n // disabled: 'BLACK_T_35',\n // },\n // },\n // 'yellow-dark': {\n // backgroundColorName: {\n // inactive: 'YELLOW_4',\n // active: 'WHITE_4',\n // disabled: 'WHITE_T_40',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'WHITE_T_40',\n // },\n // colorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'WHITE_T_40',\n // },\n // },\n // 'white': {\n // backgroundColorName: {\n // inactive: 'WHITE_1',\n // active: 'BLACK_T_35',\n // disabled: 'BLACK_T_35',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // colorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // },\n // 'white-dark': {\n // backgroundColorName: {\n // inactive: 'WHITE_4',\n // active: 'WHITE_T_70',\n // disabled: 'WHITE_T_40',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'WHITE_T_40',\n // },\n // colorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'WHITE_T_40',\n // },\n // },\n // 'black': {\n // backgroundColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_T_60',\n // disabled: 'BLACK_T_35',\n // },\n // borderColorName: {\n // inactive: 'BLACK_4',\n // active: 'BLACK_4',\n // disabled: 'BLACK_T_35',\n // },\n // colorName: {\n // inactive: 'WHITE_4',\n // active: 'WHITE_4',\n // disabled: 'BLACK_T_35',\n // },\n // },\n // 'black-dark': {\n // backgroundColorName: {\n // inactive: 'BLACK_4',\n // active: 'WHITE_T_40',\n // disabled: 'WHITE_T_40',\n // },\n // borderColorName: {\n // inactive: 'WHITE_4',\n // active: 'WHITE_4',\n // disabled: 'WHITE_T_40',\n // },\n // colorName: {\n // inactive: 'WHITE_4',\n // active: 'WHITE_4',\n // disabled: 'WHITE_T_40',\n // },\n // },\n };\n\n return { sizes, variants };\n};\n\nexport default getButtonConfig;\n"],"names":["getButtonConfig","gutter"],"mappings":"AAcM,MAAAA,IAAoC,CAACC,OA+OlC,EAAE,OA9O8C;AAAA,EACrD,QAAQ;AAAA,IACN,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA;AAAA,IACV,aAAaA,IAAS;AAAA,IACtB,YAAYA,IAAS;AAAA,EACvB;AAAA,EACA,OAAO;AAAA,IACL,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA,IAAS;AAAA,IACnB,aAAaA,IAAS;AAAA,IACtB,YAAYA,IAAS;AAAA,EACvB;AAAA,EACA,SAAS;AAAA,IACP,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA,IAAS;AAAA,IACnB,aAAaA,IAAS;AAAA,IACtB,YAAYA,IAAS;AAAA,EACvB;AAAA,EACA,QAAQ;AAAA,IACN,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA,IAAS;AAAA,IACnB,aAAaA,IAAS;AAAA,IACtB,YAAYA,IAAS;AAAA,EACvB;AAAA,EACA,OAAO;AAAA,IACL,QAAQA,IAAS;AAAA,IACjB,mBAAmBA,IAAU;AAAA,IAC7B,aAAa;AAAA,IACb,aAAa;AAAA,IACb,UAAUA,IAAS;AAAA,IACnB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,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA,WAAW;AAAA,MACT,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,IACA,iBAAiB;AAAA,MACf,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,UAAU;AAAA,IACZ;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { useMemo as p, useEffect as m } from "react";
|
2
|
+
import { usePuzzleAttemptJourney as c } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey.js";
|
3
|
+
import { usePuzzleReviewJourney as f } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-review-journey.js";
|
4
|
+
import { usePuzzleUnassignJourney as l } from "../../../journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey.js";
|
5
|
+
import { useJourney as P } from "../../../journey/use-journey/use-journey.js";
|
6
|
+
const C = ({ behavior: a }) => {
|
7
|
+
const { maximumAttempts: e, canStartJourney: t } = a, { isJourneyActive: r, clearJourney: o } = P(), { puzzleAttemptCtaRef: i, startJourney: u } = c(), { puzzleReviewCtaRef: y, startJourney: n } = f(), { puzzleUnassignRef: J, startJourney: s } = l(), z = p(() => e === -2, [e]);
|
8
|
+
return m(() => {
|
9
|
+
z && t && !r && (u(), n(), s());
|
10
|
+
}, [
|
11
|
+
t,
|
12
|
+
r,
|
13
|
+
z,
|
14
|
+
u,
|
15
|
+
n,
|
16
|
+
s
|
17
|
+
]), m(() => () => {
|
18
|
+
o();
|
19
|
+
}, [o]), {
|
20
|
+
puzzleAttemptCtaRef: i,
|
21
|
+
puzzleReviewCtaRef: y,
|
22
|
+
puzzleUnassignRef: J
|
23
|
+
};
|
24
|
+
};
|
25
|
+
export {
|
26
|
+
C as useWorksheetJourney
|
27
|
+
};
|
28
|
+
//# sourceMappingURL=use-worksheet-journey.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"use-worksheet-journey.js","sources":["../../../../../src/features/worksheet/worksheet/hooks/use-worksheet-journey.ts"],"sourcesContent":["import type { IWorksheetBehavior } from '../worksheet-types';\n\nimport { useEffect, useMemo } from 'react';\n\nimport { usePuzzleAttemptJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-attempt-journey';\nimport { usePuzzleReviewJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-review-journey';\nimport { usePuzzleUnassignJourney } from '../../../journey/hooks/use-puzzles-journey/use-puzzle-unassign-journey';\nimport { useJourney } from '../../../journey/use-journey/use-journey';\n\ninterface IUseWorksheetJourney {\n behavior: IWorksheetBehavior;\n}\n\nconst useWorksheetJourney = ({ behavior }: IUseWorksheetJourney) => {\n const { maximumAttempts, canStartJourney } = behavior;\n\n const { isJourneyActive, clearJourney } = useJourney();\n\n const { puzzleAttemptCtaRef, startJourney: startPuzzleAttemptJourney } =\n usePuzzleAttemptJourney();\n\n const { puzzleReviewCtaRef, startJourney: startPuzzleReviewJourney } = usePuzzleReviewJourney();\n const { puzzleUnassignRef, startJourney: startPuzzleUnassignJourney } =\n usePuzzleUnassignJourney();\n\n const isPuzzleCard = useMemo(() => maximumAttempts === -2, [maximumAttempts]);\n\n useEffect(() => {\n if (isPuzzleCard && canStartJourney && !isJourneyActive) {\n //* This will be triggered by STUDENT during resume sheet.\n startPuzzleAttemptJourney();\n //* This will be triggered by TEACHER during review sheet\n startPuzzleReviewJourney();\n //* This will be trigger by TEACHER during preview sheet.\n startPuzzleUnassignJourney();\n }\n }, [\n canStartJourney,\n isJourneyActive,\n isPuzzleCard,\n startPuzzleAttemptJourney,\n startPuzzleReviewJourney,\n startPuzzleUnassignJourney,\n ]);\n\n useEffect(() => {\n return () => {\n clearJourney();\n };\n }, [clearJourney]);\n\n return {\n puzzleAttemptCtaRef,\n puzzleReviewCtaRef,\n puzzleUnassignRef,\n };\n};\n\nexport { useWorksheetJourney };\n"],"names":["useWorksheetJourney","behavior","maximumAttempts","canStartJourney","isJourneyActive","clearJourney","useJourney","puzzleAttemptCtaRef","startPuzzleAttemptJourney","usePuzzleAttemptJourney","puzzleReviewCtaRef","startPuzzleReviewJourney","usePuzzleReviewJourney","puzzleUnassignRef","startPuzzleUnassignJourney","usePuzzleUnassignJourney","isPuzzleCard","useMemo","useEffect"],"mappings":";;;;;AAaA,MAAMA,IAAsB,CAAC,EAAE,UAAAC,QAAqC;AAC5D,QAAA,EAAE,iBAAAC,GAAiB,iBAAAC,EAAoB,IAAAF,GAEvC,EAAE,iBAAAG,GAAiB,cAAAC,EAAa,IAAIC,EAAW,GAE/C,EAAE,qBAAAC,GAAqB,cAAcC,MACzCC,EAAwB,GAEpB,EAAE,oBAAAC,GAAoB,cAAcC,MAA6BC,EAAuB,GACxF,EAAE,mBAAAC,GAAmB,cAAcC,MACvCC,EAAyB,GAErBC,IAAeC,EAAQ,MAAMf,MAAoB,IAAI,CAACA,CAAe,CAAC;AAE5E,SAAAgB,EAAU,MAAM;AACV,IAAAF,KAAgBb,KAAmB,CAACC,MAEZI,KAEDG,KAEEG;EAC7B,GACC;AAAA,IACDX;AAAA,IACAC;AAAA,IACAY;AAAA,IACAR;AAAA,IACAG;AAAA,IACAG;AAAA,EAAA,CACD,GAEDI,EAAU,MACD,MAAM;AACE,IAAAb;EAAA,GAEd,CAACA,CAAY,CAAC,GAEV;AAAA,IACL,qBAAAE;AAAA,IACA,oBAAAG;AAAA,IACA,mBAAAG;AAAA,EAAA;AAEJ;"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import w from "../../../assets/line-icons/icons/bulb2.js";
|
2
2
|
import S from "../../../assets/line-icons/icons/edit-star.js";
|
3
3
|
import A from "../../../assets/line-icons/icons/edit2.js";
|
4
|
-
import
|
5
|
-
import
|
4
|
+
import k from "../../../assets/line-icons/icons/question-letter.js";
|
5
|
+
import L from "../../../assets/line-icons/icons/star2.js";
|
6
6
|
import b from "../constants/events.js";
|
7
|
-
import { OPTIONAL_ITEM_TYPES as
|
7
|
+
import { OPTIONAL_ITEM_TYPES as O, ACTION_BAR_HEIGHT as R, QUESTION_WIDTH as C, SPLIT_QUESTION_WIDTH as N, CLOZE_FORMULA_RESPONSE_LIMIT as x } from "./constants.js";
|
8
8
|
import { QUESTION_TAGS as E } from "./worksheet-types.js";
|
9
9
|
const Q = (e) => {
|
10
10
|
switch (e) {
|
@@ -35,7 +35,7 @@ const Q = (e) => {
|
|
35
35
|
return !1;
|
36
36
|
const r = e.toLowerCase();
|
37
37
|
return r === "intro" || r === "concept-intro";
|
38
|
-
},
|
38
|
+
}, y = (e) => e.reduce((r, t) => {
|
39
39
|
const [n, s] = t.split(":"), a = n == null ? void 0 : n.trim(), c = s == null ? void 0 : s.trim();
|
40
40
|
return !a || !c ? r : {
|
41
41
|
...r,
|
@@ -61,9 +61,9 @@ const Q = (e) => {
|
|
61
61
|
item_display_number: g,
|
62
62
|
section_name: l,
|
63
63
|
item_type: r ? o : void 0,
|
64
|
-
is_optional: o ?
|
64
|
+
is_optional: o ? O.includes(o) : !1,
|
65
65
|
item_tags: a.tags ?? [],
|
66
|
-
item_tags_map:
|
66
|
+
item_tags_map: y(a.tags ?? []),
|
67
67
|
question_number: h - (d ? 1 : 0),
|
68
68
|
total_questions: _.length
|
69
69
|
};
|
@@ -105,7 +105,7 @@ const Q = (e) => {
|
|
105
105
|
item_number: c,
|
106
106
|
item_display_number: c + 1,
|
107
107
|
item_tags: a.tags ?? [],
|
108
|
-
item_tags_map:
|
108
|
+
item_tags_map: y(a.tags ?? []),
|
109
109
|
question_number: m,
|
110
110
|
total_questions: i.length
|
111
111
|
};
|
@@ -131,7 +131,7 @@ const Q = (e) => {
|
|
131
131
|
});
|
132
132
|
}
|
133
133
|
return n;
|
134
|
-
},
|
134
|
+
}, z = ({
|
135
135
|
questions: e,
|
136
136
|
initialQuestion: r,
|
137
137
|
initialResponseId: t,
|
@@ -154,7 +154,7 @@ const Q = (e) => {
|
|
154
154
|
if ((u = e[0]) != null && u.response_id)
|
155
155
|
return e[0].response_id;
|
156
156
|
throw new Error("Initial question not found");
|
157
|
-
},
|
157
|
+
}, J = ({
|
158
158
|
questions: e,
|
159
159
|
responses: r,
|
160
160
|
behavior: t,
|
@@ -206,7 +206,7 @@ function M(e, r) {
|
|
206
206
|
}
|
207
207
|
};
|
208
208
|
}
|
209
|
-
const
|
209
|
+
const V = (e) => e.reduce(
|
210
210
|
(r, t) => ({
|
211
211
|
...r,
|
212
212
|
[t.response_id]: M(e, t.response_id)
|
@@ -217,9 +217,9 @@ const z = (e) => e.reduce(
|
|
217
217
|
return {
|
218
218
|
questionsContainerWidth: !e.some(
|
219
219
|
(a) => a.questions.some((c) => c.stimulus_review)
|
220
|
-
) ?
|
221
|
-
maxQuestionWidth:
|
222
|
-
actionbarHeight: t === "bottom" ?
|
220
|
+
) ? C : N,
|
221
|
+
maxQuestionWidth: C,
|
222
|
+
actionbarHeight: t === "bottom" ? R : 0
|
223
223
|
};
|
224
224
|
}, Z = ({
|
225
225
|
questions: e,
|
@@ -352,9 +352,9 @@ const z = (e) => e.reduce(
|
|
352
352
|
case "practice-regular":
|
353
353
|
return S;
|
354
354
|
case "exit-ticket":
|
355
|
-
return
|
355
|
+
return k;
|
356
356
|
case "advanced":
|
357
|
-
return
|
357
|
+
return L;
|
358
358
|
default:
|
359
359
|
return w;
|
360
360
|
}
|
@@ -385,16 +385,17 @@ const z = (e) => e.reduce(
|
|
385
385
|
bgColor: "BLACK",
|
386
386
|
borderColor: "BLACK_4",
|
387
387
|
textColor: "WHITE"
|
388
|
-
};
|
388
|
+
}, ue = (e) => e ? `${e}_1` : "BLUE_1";
|
389
389
|
export {
|
390
390
|
ie as checkIsClozeFormulaResponseInvalid,
|
391
|
-
|
392
|
-
|
393
|
-
|
391
|
+
z as getInitialQuestionId,
|
392
|
+
V as getInitialResponses,
|
393
|
+
J as getLastUnlockedQuestionIndex,
|
394
394
|
ne as getNavigationSectionBackgroundColor,
|
395
395
|
ae as getNavigationSectionIcon,
|
396
396
|
oe as getNavigationSectionName,
|
397
397
|
ee as getPaperColorByQuestion,
|
398
|
+
ue as getPuzzleWorksheetBackgroundColor,
|
398
399
|
te as getQuestionBackgroundImage,
|
399
400
|
re as getQuestionBorderColor,
|
400
401
|
M as getQuestionMetadata,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"worksheet-helpers.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-helpers.ts"],"sourcesContent":["import type { NODE_TYPES } from '../../../types/models/worksheet';\nimport type { TColorNames, TUserTypes } from '../../ui/types';\nimport type { TWorksheetQuestionPaperColor } from './worksheet-question/worksheet-question-types';\nimport type { ILearnosityQuestionResponse, IWorksheetHeaderLayoutProps } from './worksheet-types';\n\nimport Bulb2Icon from '../../../assets/line-icons/icons/bulb2';\nimport EditStarIcon from '../../../assets/line-icons/icons/edit-star';\nimport Edit2Icon from '../../../assets/line-icons/icons/edit2';\nimport QuestionLetterIcon from '../../../assets/line-icons/icons/question-letter';\nimport Star2Icon from '../../../assets/line-icons/icons/star2';\nimport EVENTS from '../constants/events';\nimport {\n ACTION_BAR_HEIGHT,\n CLOZE_FORMULA_RESPONSE_LIMIT,\n OPTIONAL_ITEM_TYPES,\n QUESTION_WIDTH,\n SPLIT_QUESTION_WIDTH,\n} from './constants';\nimport {\n QUESTION_TAGS,\n type ILearnosityItem,\n type ILearnosityQuestion,\n type ISheetNudgeBannerInfo,\n type IWorksheetBehavior,\n type IWorksheetProps,\n type IWorksheetQuestion,\n type IWorksheetResponse,\n type TInstructorStimulus,\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-we-do':\n case 'learning-your-turn':\n case 'learning-explore':\n return 'learning';\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 isConceptIntroWidget = (instructorStimulus?: TInstructorStimulus) => {\n if (!instructorStimulus) {\n return false;\n }\n\n const lowerCaseInstructorStimulus = instructorStimulus.toLowerCase();\n\n return lowerCaseInstructorStimulus === 'intro' || lowerCaseInstructorStimulus === 'concept-intro';\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 sectioned?: boolean;\n adaptive?: boolean;\n },\n ): IWorksheetQuestion[];\n}\nconst getQuestionsFromItems: IGetQuestionsFromItems = (\n items,\n { sectioned = false, adaptive = false },\n) => {\n if (sectioned) {\n return items.reduce((acc, item, itemIndex) => {\n let hasIntroWidget = false;\n const { content, questions, 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?.map((responseId, widgetIndex) => {\n const question = questions.find(\n ({ response_id: respId }) => respId === responseId.replace('question-', ''),\n );\n\n if (!question) {\n throw new Error(`Question not found for the response id: ${responseId}`);\n }\n\n hasIntroWidget = hasIntroWidget || isConceptIntroWidget(question.instructor_stimulus);\n\n return {\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: itemDisplayNumber,\n section_name: sectionName,\n item_type: sectioned ? itemType : undefined,\n is_optional: itemType ? OPTIONAL_ITEM_TYPES.includes(itemType) : false,\n item_tags: item.tags ?? [],\n item_tags_map: getTagsMap(item.tags ?? []),\n question_number: widgetIndex - (hasIntroWidget ? 1 : 0),\n total_questions: orderedQuestionIds.length,\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-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 },\n ...(orderedQuestions ?? []),\n ];\n }\n }\n\n return [...acc, ...(orderedQuestions ?? [])];\n }, [] as IWorksheetQuestion[]);\n }\n\n const finalQuestions = items.reduce((acc, item, itemIndex) => {\n const { content, questions } = item;\n const orderedQuestionIds = content.match(/question-[^\"]*/g);\n const orderedQuestions = orderedQuestionIds?.map<IWorksheetQuestion>(\n (responseId, widgetIndex) => {\n const question = questions.find(\n ({ response_id: respId }) => respId === responseId.replace('question-', ''),\n );\n\n if (!question) {\n throw new Error(`Question not found for the response id: ${responseId}`);\n }\n\n return {\n ...question,\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: widgetIndex,\n total_questions: orderedQuestionIds.length,\n };\n },\n );\n\n return [...acc, ...(orderedQuestions ?? [])];\n }, [] as IWorksheetQuestion[]);\n\n if (adaptive) {\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\ninterface IGetInitialQuestionId {\n (params: {\n questions: IWorksheetQuestion[];\n initialQuestion: IWorksheetBehavior['initialQuestion'];\n lastUnlockedQuestionIndex: number;\n initialResponseId?: string;\n initialItemIndex?: number;\n }): string;\n}\n\nconst getInitialQuestionId: IGetInitialQuestionId = ({\n questions,\n initialQuestion,\n initialResponseId,\n initialItemIndex,\n lastUnlockedQuestionIndex,\n}) => {\n const unlockedQuestions = questions.slice(0, lastUnlockedQuestionIndex + 1);\n const lastUnlockedQuestion = questions[lastUnlockedQuestionIndex]!;\n\n if (initialResponseId && unlockedQuestions.find(q => q.response_id === initialResponseId)) {\n return initialResponseId;\n }\n\n if (\n typeof initialItemIndex === 'number' &&\n initialItemIndex <= lastUnlockedQuestion.item_number\n ) {\n const question = questions.find(q => q.item_number === initialItemIndex);\n\n if (question?.response_id) {\n return question.response_id;\n }\n }\n\n if (initialQuestion === 'FIRST' && questions[0]?.response_id) {\n return questions[0].response_id;\n }\n\n if (initialQuestion === 'CURRENT') {\n return lastUnlockedQuestion.response_id;\n }\n\n if (questions[0]?.response_id) {\n return questions[0].response_id;\n }\n\n throw new Error('Initial question not found');\n};\n\ninterface IGetLastUnlockedQuestionIndex {\n (options: {\n questions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n behavior: IWorksheetBehavior;\n userType: TUserTypes;\n }): number;\n}\n\nconst getLastUnlockedQuestionIndex: IGetLastUnlockedQuestionIndex = ({\n questions,\n responses,\n behavior,\n userType,\n}) => {\n const { maximumAttempts, teacherValidationEnabled, validation, navigationMode } = behavior;\n const questionIndex = [...questions].reverse().findIndex(q => {\n const qResp = responses[q.response_id];\n\n const { attemptsHistory, validatedByTeacher, assignStatus } = qResp ?? {};\n\n if (teacherValidationEnabled) {\n if (validatedByTeacher) {\n return true;\n }\n\n if (assignStatus === 'skipped') {\n return true;\n }\n\n return false;\n }\n\n const lastAttemptScore = attemptsHistory?.slice(-1)[0]?.score;\n\n if (lastAttemptScore) {\n if ((lastAttemptScore.score ?? 0) === lastAttemptScore.max_score) {\n return true;\n }\n\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n return maximumAttemptsReached;\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 if (teacherValidationEnabled) {\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 return questions.length - 1;\n }\n\n if (teacherValidationEnabled && 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\ntype TQuestionMetadata = Pick<\n IWorksheetResponse,\n 'widgetReference' | 'itemReference' | 'itemPosition' | 'questionPosition' | 'isOkayTypeQuestion'\n>;\n\nfunction getQuestionMetadata(\n questions: IWorksheetQuestion[],\n questionId: string,\n): TQuestionMetadata;\nfunction getQuestionMetadata(question: IWorksheetQuestion): TQuestionMetadata;\nfunction getQuestionMetadata(\n questions: IWorksheetQuestion | IWorksheetQuestion[],\n questionId?: string,\n) {\n const question = Array.isArray(questions)\n ? questions.find(q => q.response_id === questionId)\n : questions;\n\n if (!question) {\n throw new Error(`Question with id ${questionId} not found`);\n }\n\n return {\n widgetReference: question.metadata.widget_reference,\n itemReference: question.item_reference,\n itemPosition: question.item_number,\n questionPosition: question.question_number,\n isOkayTypeQuestion: isOkayTypeQuestion(question),\n score: {\n max_score:\n question?.validation?.valid_response?.score ?? 0 * question.metadata.valid_response_count,\n },\n tags: {\n ...question.item_tags_map,\n instructor_stimulus: question.instructor_stimulus,\n },\n };\n}\n\ninterface IGetInitialResponses {\n (questions: IWorksheetQuestion[]): Record<string, IWorksheetResponse>;\n}\n\nconst getInitialResponses: IGetInitialResponses = questions => {\n return questions.reduce(\n (acc, question) => ({\n ...acc,\n [question.response_id]: getQuestionMetadata(questions, question.response_id),\n }),\n {},\n );\n};\n\ninterface IGetWorksheetDimensions {\n (\n items: ILearnosityItem[],\n layout: IWorksheetProps['layout'],\n ): {\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n };\n}\n\nconst getWorksheetDimensions: IGetWorksheetDimensions = (items, layout) => {\n const { actionBar } = layout;\n const isSingleColumn = !items.some(item =>\n item.questions.some(question => question.stimulus_review),\n );\n const actionbarHeight = actionBar === 'bottom' ? ACTION_BAR_HEIGHT : 0;\n\n return {\n questionsContainerWidth: isSingleColumn ? QUESTION_WIDTH : SPLIT_QUESTION_WIDTH,\n maxQuestionWidth: QUESTION_WIDTH,\n actionbarHeight,\n };\n};\n\ninterface IGetRenderableQuestions {\n (options: {\n questions: IWorksheetQuestion[];\n lastUnlockedQuestionIndex: number;\n userType: TUserTypes;\n }): IWorksheetQuestion[];\n}\nconst getRenderableQuestions: IGetRenderableQuestions = ({\n questions,\n lastUnlockedQuestionIndex,\n userType,\n}) => {\n if (userType === 'STUDENT') return questions.slice(0, lastUnlockedQuestionIndex + 1);\n\n return questions;\n};\n\ninterface IScrollToQuestion {\n (questionId: string, params?: { animation?: boolean }): void;\n}\n\nconst scrollToQuestion: IScrollToQuestion = (questionId, { animation = false } = {}) => {\n const $questionEl = document.querySelectorAll(`.widget-${questionId}`)[0];\n\n if ($questionEl) {\n $questionEl.scrollIntoView({\n block: 'start',\n behavior: animation ? 'smooth' : 'instant',\n });\n }\n};\n\ninterface IIsOkayTypeQuestion {\n (question: IWorksheetQuestion | ILearnosityQuestion): boolean;\n}\n\nconst isOkayTypeQuestion: IIsOkayTypeQuestion = question => {\n const { type, options, instructor_stimulus } = question;\n const itemType = 'item_type' in question ? question.item_type : undefined;\n\n if (\n itemType === 'overview' ||\n instructor_stimulus === 'Intro' ||\n instructor_stimulus === 'SystemIntro' ||\n instructor_stimulus === 'Concept-Intro'\n ) {\n return true;\n }\n\n return type === 'mcq' && options?.length === 1 ? true : false;\n};\n\nconst setMathJaxConfigInWindow = (\n logger: (eventName: string, data?: Record<string, unknown>) => void,\n) => {\n window.MathJax = {\n options: {\n enableMenu: false,\n ignoreHtmlClass: 'lrn_noMath',\n compileError: function (doc, math, err) {\n logger(EVENTS.MATHJAX_COMPILE_ERROR);\n doc.compileError(math, err);\n },\n typesetError: function (doc, math, err) {\n logger(EVENTS.MATHJAX_TYPESET_ERROR);\n doc.typesetError(math, err);\n // throw new Error('typesetError');\n },\n },\n tex: {\n inlineMath: [\n ['\\\\(', '\\\\)'],\n ['$$', '$$'],\n ],\n displayMath: [['\\\\[', '\\\\]']],\n macros: {\n abs: ['{|#1|}', 1],\n degree: ['°'],\n longdiv: ['{\\\\enclose{longdiv}{#1}}', 1],\n atomic: ['{_{#1}^{#2}}', 2],\n polyatomic: ['{_{#2}{}^{#1}}', 2],\n circledot: ['{\\\\odot}'],\n parallelogram: ['\\\\unicode{x25B1}'],\n ngtr: ['\\\\unicode{x226F}'],\n nless: ['\\\\unicode{x226E}'],\n MathQuillVarField: ['#1', 1],\n overarc: ['{\\\\overparen{#1}}', 1],\n },\n formatError: (jax, err) => {\n logger(EVENTS.MATHJAX_FORMAT_ERROR, {\n id: err.id,\n message: err.message,\n });\n jax.formatError(err);\n },\n },\n chtml: {\n minScale: 1,\n matchFontHeight: false,\n },\n };\n};\n\ninterface IGetPaperColorByQuestion {\n (question: IWorksheetQuestion): TWorksheetQuestionPaperColor;\n}\n\nconst getPaperColorByQuestion: IGetPaperColorByQuestion = question => {\n const { item_type, instructor_stimulus } = question;\n const lowerCaseInstructorStimulus = instructor_stimulus?.toLowerCase();\n\n switch (item_type) {\n case 'overview':\n return 'white';\n case 'learning-we-do':\n case 'learning-your-turn':\n case 'learning-explore':\n if (\n lowerCaseInstructorStimulus === 'instruction' ||\n lowerCaseInstructorStimulus === 'intro' ||\n lowerCaseInstructorStimulus === 'concept-intro'\n ) {\n return 'blue';\n }\n\n if (lowerCaseInstructorStimulus === 'task') {\n return 'green';\n }\n\n return 'yellow';\n case 'practice-basic':\n case 'practice-regular':\n return 'yellow';\n case 'exit-ticket':\n return 'purple';\n case 'advanced-practice':\n return 'orange';\n default:\n if (lowerCaseInstructorStimulus === 'learn') return 'blue';\n\n if (lowerCaseInstructorStimulus === 'try' || lowerCaseInstructorStimulus === 'apply')\n return 'green';\n\n return 'yellow';\n }\n};\n\nconst getQuestionBackgroundImage = (paperColor: TWorksheetQuestionPaperColor) => {\n return `https://cuemath-intel.s3.ap-southeast-1.amazonaws.com/media/math-canvas/paper-${paperColor}.png`;\n};\n\nconst getQuestionBorderColor = (\n paperColor: TWorksheetQuestionPaperColor,\n isActive?: boolean,\n): TColorNames => {\n if (!isActive) {\n return 'GREY_3';\n }\n\n switch (paperColor) {\n case 'orange':\n case 'white':\n return 'ORANGE_2';\n case 'blue':\n return 'BLUE_2';\n case 'green':\n return 'GREEN_2';\n case 'yellow':\n return 'YELLOW_2';\n case 'purple':\n return 'PURPLE_2';\n default:\n return 'GREY_3';\n }\n};\n\nconst getNavigationSectionBackgroundColor = (sectionName?: TSectionName): TColorNames => {\n switch (sectionName) {\n case 'learning':\n return 'BLUE_1';\n case 'practice-basic':\n case 'practice-regular':\n return 'YELLOW_1';\n case 'exit-ticket':\n return 'PURPLE_1';\n case 'advanced':\n return 'ORANGE_1';\n default:\n return 'YELLOW_1';\n }\n};\n\nconst getNavigationSectionName = (sectionName?: TSectionName): string => {\n switch (sectionName) {\n case 'learning':\n return 'Learning';\n case 'practice-basic':\n return 'Basic practice';\n case 'practice-regular':\n return 'Regular practice';\n case 'exit-ticket':\n return 'Mini quiz';\n case 'advanced':\n return 'Advanced work';\n default:\n return '';\n }\n};\n\nconst getNavigationSectionIcon = (sectionName?: TSectionName) => {\n switch (sectionName) {\n case 'learning':\n return Bulb2Icon;\n case 'practice-basic':\n return Edit2Icon;\n case 'practice-regular':\n return EditStarIcon;\n case 'exit-ticket':\n return QuestionLetterIcon;\n case 'advanced':\n return Star2Icon;\n default:\n return Bulb2Icon;\n }\n};\n\nconst isSATAssessmentNode = (nodeType: NODE_TYPES) =>\n nodeType === 'SAT_ENGLISH_ASSESSMENT' || nodeType === 'SAT_MATH_ASSESSMENT';\n\nconst checkIsClozeFormulaResponseInvalid = (response: ILearnosityQuestionResponse) => {\n if (Array.isArray(response.value)) {\n const isInvalid = response.value.some(\n item => typeof item === 'string' && item.length > CLOZE_FORMULA_RESPONSE_LIMIT,\n );\n\n return isInvalid;\n }\n\n return false;\n};\n\nconst getWorksheetNudgeBannerInfo = (\n userType: TUserTypes,\n markedAsCompleted: boolean,\n): ISheetNudgeBannerInfo => {\n const isTeacher = userType === 'TEACHER';\n\n if (markedAsCompleted) {\n return {\n bannerBackgroundColor: 'GREEN_4',\n label: isTeacher\n ? 'This sheet was marked as completed.'\n : 'Marked as completed by the teacher',\n };\n }\n\n return {\n bannerBackgroundColor: 'ORANGE_2',\n label: 'Complete this with your tutor in class',\n };\n};\n\nconst getWorksheetHeaderLayout: IWorksheetHeaderLayoutProps = ({\n isPuzzleWorksheet,\n isTestWorksheet,\n imageHue = 'BLUE',\n}) => {\n if (isPuzzleWorksheet) {\n return {\n bgColor: `${imageHue}_3`,\n borderColor: `${imageHue}_4`,\n textColor: 'BLACK_T_87',\n };\n }\n\n if (isTestWorksheet) {\n return {\n bgColor: 'WHITE_3',\n borderColor: 'WHITE_4',\n textColor: 'BLACK_T_87',\n };\n }\n\n return {\n bgColor: 'BLACK',\n borderColor: 'BLACK_4',\n textColor: 'WHITE',\n };\n};\n\nexport {\n getInitialQuestionId,\n getInitialResponses,\n getLastUnlockedQuestionIndex,\n getNavigationSectionBackgroundColor,\n getNavigationSectionIcon,\n getNavigationSectionName,\n getPaperColorByQuestion,\n getQuestionBackgroundImage,\n getQuestionBorderColor,\n getQuestionMetadata,\n getQuestionsFromItems,\n getRenderableQuestions,\n getWorksheetDimensions,\n isConceptIntroWidget,\n isSATAssessmentNode,\n isOkayTypeQuestion,\n scrollToQuestion,\n setMathJaxConfigInWindow,\n getWorksheetNudgeBannerInfo,\n checkIsClozeFormulaResponseInvalid,\n getWorksheetHeaderLayout,\n};\n"],"names":["getSectionNameFromItemType","itemType","isConceptIntroWidget","instructorStimulus","lowerCaseInstructorStimulus","getTagsMap","tags","acc","tag","key","value","trimmedKey","trimmedValue","getQuestionsFromItems","items","sectioned","adaptive","item","itemIndex","hasIntroWidget","content","questions","sectionName","prevItem","itemDisplayNumber","orderedQuestionIds","orderedQuestions","responseId","widgetIndex","question","respId","OPTIONAL_ITEM_TYPES","prevItemType","_a","itemTypeDerived","prevItemTypeDerived","finalQuestions","topics","topicsOrder","a","b","aTopic","QUESTION_TAGS","bTopic","aSortKey","bSortKey","_b","topicOrder","questionCode","getInitialQuestionId","initialQuestion","initialResponseId","initialItemIndex","lastUnlockedQuestionIndex","unlockedQuestions","lastUnlockedQuestion","q","getLastUnlockedQuestionIndex","responses","behavior","userType","maximumAttempts","teacherValidationEnabled","validation","navigationMode","questionIndex","qResp","attemptsHistory","validatedByTeacher","assignStatus","lastAttemptScore","unskippedQuestionIndex","getQuestionMetadata","questionId","isOkayTypeQuestion","getInitialResponses","getWorksheetDimensions","layout","actionBar","QUESTION_WIDTH","SPLIT_QUESTION_WIDTH","ACTION_BAR_HEIGHT","getRenderableQuestions","scrollToQuestion","animation","$questionEl","type","options","instructor_stimulus","setMathJaxConfigInWindow","logger","doc","math","err","EVENTS","jax","getPaperColorByQuestion","item_type","getQuestionBackgroundImage","paperColor","getQuestionBorderColor","isActive","getNavigationSectionBackgroundColor","getNavigationSectionName","getNavigationSectionIcon","Bulb2Icon","Edit2Icon","EditStarIcon","QuestionLetterIcon","Star2Icon","checkIsClozeFormulaResponseInvalid","response","CLOZE_FORMULA_RESPONSE_LIMIT","getWorksheetNudgeBannerInfo","markedAsCompleted","isTeacher","getWorksheetHeaderLayout","isPuzzleWorksheet","isTestWorksheet","imageHue"],"mappings":";;;;;;;;AAoCA,MAAMA,IAA0D,CAAYC,MAAA;AAC1E,UAAQA,GAAU;AAAA,IAChB,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,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,IAAuB,CAACC,MAA6C;AACzE,MAAI,CAACA;AACI,WAAA;AAGH,QAAAC,IAA8BD,EAAmB;AAEhD,SAAAC,MAAgC,WAAWA,MAAgC;AACpF,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,IAAgD,C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AAa;AAAA,IACnB,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AACI,aAAA;AAAA,IACT;AACS,aAAA;AAAA,EACX;AACF,GAEMkF,KAA2B,CAAClF,MAA+B;AAC/D,UAAQA,GAAa;AAAA,IACnB,KAAK;AACI,aAAAmF;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IACT,KAAK;AACI,aAAAC;AAAA,IACT;AACS,aAAAJ;AAAA,EACX;AACF,GAKMK,KAAqC,CAACC,MACtC,MAAM,QAAQA,EAAS,KAAK,IACZA,EAAS,MAAM;AAAA,EAC/B,CAAQ9F,MAAA,OAAOA,KAAS,YAAYA,EAAK,SAAS+F;AAAA,IAM/C,IAGHC,KAA8B,CAClCrD,GACAsD,MAC0B;AAC1B,QAAMC,IAAYvD,MAAa;AAE/B,SAAIsD,IACK;AAAA,IACL,uBAAuB;AAAA,IACvB,OAAOC,IACH,wCACA;AAAA,EAAA,IAID;AAAA,IACL,uBAAuB;AAAA,IACvB,OAAO;AAAA,EAAA;AAEX,GAEMC,KAAwD,CAAC;AAAA,EAC7D,mBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC,IAAW;AACb,MACMF,IACK;AAAA,EACL,SAAS,GAAGE,CAAQ;AAAA,EACpB,aAAa,GAAGA,CAAQ;AAAA,EACxB,WAAW;AAAA,IAIXD,IACK;AAAA,EACL,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA,IAIR;AAAA,EACL,SAAS;AAAA,EACT,aAAa;AAAA,EACb,WAAW;AAAA;"}
|
1
|
+
{"version":3,"file":"worksheet-helpers.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-helpers.ts"],"sourcesContent":["import type { NODE_TYPES } from '../../../types/models/worksheet';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { TWorksheetQuestionPaperColor } from './worksheet-question/worksheet-question-types';\nimport type { ILearnosityQuestionResponse, IWorksheetHeaderLayoutProps } from './worksheet-types';\n\nimport Bulb2Icon from '../../../assets/line-icons/icons/bulb2';\nimport EditStarIcon from '../../../assets/line-icons/icons/edit-star';\nimport Edit2Icon from '../../../assets/line-icons/icons/edit2';\nimport QuestionLetterIcon from '../../../assets/line-icons/icons/question-letter';\nimport Star2Icon from '../../../assets/line-icons/icons/star2';\nimport EVENTS from '../constants/events';\nimport {\n ACTION_BAR_HEIGHT,\n CLOZE_FORMULA_RESPONSE_LIMIT,\n OPTIONAL_ITEM_TYPES,\n QUESTION_WIDTH,\n SPLIT_QUESTION_WIDTH,\n} from './constants';\nimport {\n QUESTION_TAGS,\n type ILearnosityItem,\n type ILearnosityQuestion,\n type ISheetNudgeBannerInfo,\n type IWorksheetBehavior,\n type IWorksheetProps,\n type IWorksheetQuestion,\n type IWorksheetResponse,\n type TInstructorStimulus,\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-we-do':\n case 'learning-your-turn':\n case 'learning-explore':\n return 'learning';\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 isConceptIntroWidget = (instructorStimulus?: TInstructorStimulus) => {\n if (!instructorStimulus) {\n return false;\n }\n\n const lowerCaseInstructorStimulus = instructorStimulus.toLowerCase();\n\n return lowerCaseInstructorStimulus === 'intro' || lowerCaseInstructorStimulus === 'concept-intro';\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 sectioned?: boolean;\n adaptive?: boolean;\n },\n ): IWorksheetQuestion[];\n}\nconst getQuestionsFromItems: IGetQuestionsFromItems = (\n items,\n { sectioned = false, adaptive = false },\n) => {\n if (sectioned) {\n return items.reduce((acc, item, itemIndex) => {\n let hasIntroWidget = false;\n const { content, questions, 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?.map((responseId, widgetIndex) => {\n const question = questions.find(\n ({ response_id: respId }) => respId === responseId.replace('question-', ''),\n );\n\n if (!question) {\n throw new Error(`Question not found for the response id: ${responseId}`);\n }\n\n hasIntroWidget = hasIntroWidget || isConceptIntroWidget(question.instructor_stimulus);\n\n return {\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: itemDisplayNumber,\n section_name: sectionName,\n item_type: sectioned ? itemType : undefined,\n is_optional: itemType ? OPTIONAL_ITEM_TYPES.includes(itemType) : false,\n item_tags: item.tags ?? [],\n item_tags_map: getTagsMap(item.tags ?? []),\n question_number: widgetIndex - (hasIntroWidget ? 1 : 0),\n total_questions: orderedQuestionIds.length,\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-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 },\n ...(orderedQuestions ?? []),\n ];\n }\n }\n\n return [...acc, ...(orderedQuestions ?? [])];\n }, [] as IWorksheetQuestion[]);\n }\n\n const finalQuestions = items.reduce((acc, item, itemIndex) => {\n const { content, questions } = item;\n const orderedQuestionIds = content.match(/question-[^\"]*/g);\n const orderedQuestions = orderedQuestionIds?.map<IWorksheetQuestion>(\n (responseId, widgetIndex) => {\n const question = questions.find(\n ({ response_id: respId }) => respId === responseId.replace('question-', ''),\n );\n\n if (!question) {\n throw new Error(`Question not found for the response id: ${responseId}`);\n }\n\n return {\n ...question,\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: widgetIndex,\n total_questions: orderedQuestionIds.length,\n };\n },\n );\n\n return [...acc, ...(orderedQuestions ?? [])];\n }, [] as IWorksheetQuestion[]);\n\n if (adaptive) {\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\ninterface IGetInitialQuestionId {\n (params: {\n questions: IWorksheetQuestion[];\n initialQuestion: IWorksheetBehavior['initialQuestion'];\n lastUnlockedQuestionIndex: number;\n initialResponseId?: string;\n initialItemIndex?: number;\n }): string;\n}\n\nconst getInitialQuestionId: IGetInitialQuestionId = ({\n questions,\n initialQuestion,\n initialResponseId,\n initialItemIndex,\n lastUnlockedQuestionIndex,\n}) => {\n const unlockedQuestions = questions.slice(0, lastUnlockedQuestionIndex + 1);\n const lastUnlockedQuestion = questions[lastUnlockedQuestionIndex]!;\n\n if (initialResponseId && unlockedQuestions.find(q => q.response_id === initialResponseId)) {\n return initialResponseId;\n }\n\n if (\n typeof initialItemIndex === 'number' &&\n initialItemIndex <= lastUnlockedQuestion.item_number\n ) {\n const question = questions.find(q => q.item_number === initialItemIndex);\n\n if (question?.response_id) {\n return question.response_id;\n }\n }\n\n if (initialQuestion === 'FIRST' && questions[0]?.response_id) {\n return questions[0].response_id;\n }\n\n if (initialQuestion === 'CURRENT') {\n return lastUnlockedQuestion.response_id;\n }\n\n if (questions[0]?.response_id) {\n return questions[0].response_id;\n }\n\n throw new Error('Initial question not found');\n};\n\ninterface IGetLastUnlockedQuestionIndex {\n (options: {\n questions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n behavior: IWorksheetBehavior;\n userType: TUserTypes;\n }): number;\n}\n\nconst getLastUnlockedQuestionIndex: IGetLastUnlockedQuestionIndex = ({\n questions,\n responses,\n behavior,\n userType,\n}) => {\n const { maximumAttempts, teacherValidationEnabled, validation, navigationMode } = behavior;\n const questionIndex = [...questions].reverse().findIndex(q => {\n const qResp = responses[q.response_id];\n\n const { attemptsHistory, validatedByTeacher, assignStatus } = qResp ?? {};\n\n if (teacherValidationEnabled) {\n if (validatedByTeacher) {\n return true;\n }\n\n if (assignStatus === 'skipped') {\n return true;\n }\n\n return false;\n }\n\n const lastAttemptScore = attemptsHistory?.slice(-1)[0]?.score;\n\n if (lastAttemptScore) {\n if ((lastAttemptScore.score ?? 0) === lastAttemptScore.max_score) {\n return true;\n }\n\n const maximumAttemptsReached = (attemptsHistory?.length ?? 0) >= maximumAttempts;\n\n return maximumAttemptsReached;\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 if (teacherValidationEnabled) {\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 return questions.length - 1;\n }\n\n if (teacherValidationEnabled && 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\ntype TQuestionMetadata = Pick<\n IWorksheetResponse,\n 'widgetReference' | 'itemReference' | 'itemPosition' | 'questionPosition' | 'isOkayTypeQuestion'\n>;\n\nfunction getQuestionMetadata(\n questions: IWorksheetQuestion[],\n questionId: string,\n): TQuestionMetadata;\nfunction getQuestionMetadata(question: IWorksheetQuestion): TQuestionMetadata;\nfunction getQuestionMetadata(\n questions: IWorksheetQuestion | IWorksheetQuestion[],\n questionId?: string,\n) {\n const question = Array.isArray(questions)\n ? questions.find(q => q.response_id === questionId)\n : questions;\n\n if (!question) {\n throw new Error(`Question with id ${questionId} not found`);\n }\n\n return {\n widgetReference: question.metadata.widget_reference,\n itemReference: question.item_reference,\n itemPosition: question.item_number,\n questionPosition: question.question_number,\n isOkayTypeQuestion: isOkayTypeQuestion(question),\n score: {\n max_score:\n question?.validation?.valid_response?.score ?? 0 * question.metadata.valid_response_count,\n },\n tags: {\n ...question.item_tags_map,\n instructor_stimulus: question.instructor_stimulus,\n },\n };\n}\n\ninterface IGetInitialResponses {\n (questions: IWorksheetQuestion[]): Record<string, IWorksheetResponse>;\n}\n\nconst getInitialResponses: IGetInitialResponses = questions => {\n return questions.reduce(\n (acc, question) => ({\n ...acc,\n [question.response_id]: getQuestionMetadata(questions, question.response_id),\n }),\n {},\n );\n};\n\ninterface IGetWorksheetDimensions {\n (\n items: ILearnosityItem[],\n layout: IWorksheetProps['layout'],\n ): {\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n };\n}\n\nconst getWorksheetDimensions: IGetWorksheetDimensions = (items, layout) => {\n const { actionBar } = layout;\n const isSingleColumn = !items.some(item =>\n item.questions.some(question => question.stimulus_review),\n );\n const actionbarHeight = actionBar === 'bottom' ? ACTION_BAR_HEIGHT : 0;\n\n return {\n questionsContainerWidth: isSingleColumn ? QUESTION_WIDTH : SPLIT_QUESTION_WIDTH,\n maxQuestionWidth: QUESTION_WIDTH,\n actionbarHeight,\n };\n};\n\ninterface IGetRenderableQuestions {\n (options: {\n questions: IWorksheetQuestion[];\n lastUnlockedQuestionIndex: number;\n userType: TUserTypes;\n }): IWorksheetQuestion[];\n}\nconst getRenderableQuestions: IGetRenderableQuestions = ({\n questions,\n lastUnlockedQuestionIndex,\n userType,\n}) => {\n if (userType === 'STUDENT') return questions.slice(0, lastUnlockedQuestionIndex + 1);\n\n return questions;\n};\n\ninterface IScrollToQuestion {\n (questionId: string, params?: { animation?: boolean }): void;\n}\n\nconst scrollToQuestion: IScrollToQuestion = (questionId, { animation = false } = {}) => {\n const $questionEl = document.querySelectorAll(`.widget-${questionId}`)[0];\n\n if ($questionEl) {\n $questionEl.scrollIntoView({\n block: 'start',\n behavior: animation ? 'smooth' : 'instant',\n });\n }\n};\n\ninterface IIsOkayTypeQuestion {\n (question: IWorksheetQuestion | ILearnosityQuestion): boolean;\n}\n\nconst isOkayTypeQuestion: IIsOkayTypeQuestion = question => {\n const { type, options, instructor_stimulus } = question;\n const itemType = 'item_type' in question ? question.item_type : undefined;\n\n if (\n itemType === 'overview' ||\n instructor_stimulus === 'Intro' ||\n instructor_stimulus === 'SystemIntro' ||\n instructor_stimulus === 'Concept-Intro'\n ) {\n return true;\n }\n\n return type === 'mcq' && options?.length === 1 ? true : false;\n};\n\nconst setMathJaxConfigInWindow = (\n logger: (eventName: string, data?: Record<string, unknown>) => void,\n) => {\n window.MathJax = {\n options: {\n enableMenu: false,\n ignoreHtmlClass: 'lrn_noMath',\n compileError: function (doc, math, err) {\n logger(EVENTS.MATHJAX_COMPILE_ERROR);\n doc.compileError(math, err);\n },\n typesetError: function (doc, math, err) {\n logger(EVENTS.MATHJAX_TYPESET_ERROR);\n doc.typesetError(math, err);\n // throw new Error('typesetError');\n },\n },\n tex: {\n inlineMath: [\n ['\\\\(', '\\\\)'],\n ['$$', '$$'],\n ],\n displayMath: [['\\\\[', '\\\\]']],\n macros: {\n abs: ['{|#1|}', 1],\n degree: ['°'],\n longdiv: ['{\\\\enclose{longdiv}{#1}}', 1],\n atomic: ['{_{#1}^{#2}}', 2],\n polyatomic: ['{_{#2}{}^{#1}}', 2],\n circledot: ['{\\\\odot}'],\n parallelogram: ['\\\\unicode{x25B1}'],\n ngtr: ['\\\\unicode{x226F}'],\n nless: ['\\\\unicode{x226E}'],\n MathQuillVarField: ['#1', 1],\n overarc: ['{\\\\overparen{#1}}', 1],\n },\n formatError: (jax, err) => {\n logger(EVENTS.MATHJAX_FORMAT_ERROR, {\n id: err.id,\n message: err.message,\n });\n jax.formatError(err);\n },\n },\n chtml: {\n minScale: 1,\n matchFontHeight: false,\n },\n };\n};\n\ninterface IGetPaperColorByQuestion {\n (question: IWorksheetQuestion): TWorksheetQuestionPaperColor;\n}\n\nconst getPaperColorByQuestion: IGetPaperColorByQuestion = question => {\n const { item_type, instructor_stimulus } = question;\n const lowerCaseInstructorStimulus = instructor_stimulus?.toLowerCase();\n\n switch (item_type) {\n case 'overview':\n return 'white';\n case 'learning-we-do':\n case 'learning-your-turn':\n case 'learning-explore':\n if (\n lowerCaseInstructorStimulus === 'instruction' ||\n lowerCaseInstructorStimulus === 'intro' ||\n lowerCaseInstructorStimulus === 'concept-intro'\n ) {\n return 'blue';\n }\n\n if (lowerCaseInstructorStimulus === 'task') {\n return 'green';\n }\n\n return 'yellow';\n case 'practice-basic':\n case 'practice-regular':\n return 'yellow';\n case 'exit-ticket':\n return 'purple';\n case 'advanced-practice':\n return 'orange';\n default:\n if (lowerCaseInstructorStimulus === 'learn') return 'blue';\n\n if (lowerCaseInstructorStimulus === 'try' || lowerCaseInstructorStimulus === 'apply')\n return 'green';\n\n return 'yellow';\n }\n};\n\nconst getQuestionBackgroundImage = (paperColor: TWorksheetQuestionPaperColor) => {\n return `https://cuemath-intel.s3.ap-southeast-1.amazonaws.com/media/math-canvas/paper-${paperColor}.png`;\n};\n\nconst getQuestionBorderColor = (\n paperColor: TWorksheetQuestionPaperColor,\n isActive?: boolean,\n): TColorNames => {\n if (!isActive) {\n return 'GREY_3';\n }\n\n switch (paperColor) {\n case 'orange':\n case 'white':\n return 'ORANGE_2';\n case 'blue':\n return 'BLUE_2';\n case 'green':\n return 'GREEN_2';\n case 'yellow':\n return 'YELLOW_2';\n case 'purple':\n return 'PURPLE_2';\n default:\n return 'GREY_3';\n }\n};\n\nconst getNavigationSectionBackgroundColor = (sectionName?: TSectionName): TColorNames => {\n switch (sectionName) {\n case 'learning':\n return 'BLUE_1';\n case 'practice-basic':\n case 'practice-regular':\n return 'YELLOW_1';\n case 'exit-ticket':\n return 'PURPLE_1';\n case 'advanced':\n return 'ORANGE_1';\n default:\n return 'YELLOW_1';\n }\n};\n\nconst getNavigationSectionName = (sectionName?: TSectionName): string => {\n switch (sectionName) {\n case 'learning':\n return 'Learning';\n case 'practice-basic':\n return 'Basic practice';\n case 'practice-regular':\n return 'Regular practice';\n case 'exit-ticket':\n return 'Mini quiz';\n case 'advanced':\n return 'Advanced work';\n default:\n return '';\n }\n};\n\nconst getNavigationSectionIcon = (sectionName?: TSectionName) => {\n switch (sectionName) {\n case 'learning':\n return Bulb2Icon;\n case 'practice-basic':\n return Edit2Icon;\n case 'practice-regular':\n return EditStarIcon;\n case 'exit-ticket':\n return QuestionLetterIcon;\n case 'advanced':\n return Star2Icon;\n default:\n return Bulb2Icon;\n }\n};\n\nconst isSATAssessmentNode = (nodeType: NODE_TYPES) =>\n nodeType === 'SAT_ENGLISH_ASSESSMENT' || nodeType === 'SAT_MATH_ASSESSMENT';\n\nconst checkIsClozeFormulaResponseInvalid = (response: ILearnosityQuestionResponse) => {\n if (Array.isArray(response.value)) {\n const isInvalid = response.value.some(\n item => typeof item === 'string' && item.length > CLOZE_FORMULA_RESPONSE_LIMIT,\n );\n\n return isInvalid;\n }\n\n return false;\n};\n\nconst getWorksheetNudgeBannerInfo = (\n userType: TUserTypes,\n markedAsCompleted: boolean,\n): ISheetNudgeBannerInfo => {\n const isTeacher = userType === 'TEACHER';\n\n if (markedAsCompleted) {\n return {\n bannerBackgroundColor: 'GREEN_4',\n label: isTeacher\n ? 'This sheet was marked as completed.'\n : 'Marked as completed by the teacher',\n };\n }\n\n return {\n bannerBackgroundColor: 'ORANGE_2',\n label: 'Complete this with your tutor in class',\n };\n};\n\nconst getWorksheetHeaderLayout: IWorksheetHeaderLayoutProps = ({\n isPuzzleWorksheet,\n isTestWorksheet,\n imageHue = 'BLUE',\n}) => {\n if (isPuzzleWorksheet) {\n return {\n bgColor: `${imageHue}_3`,\n borderColor: `${imageHue}_4`,\n textColor: 'BLACK_T_87',\n };\n }\n\n if (isTestWorksheet) {\n return {\n bgColor: 'WHITE_3',\n borderColor: 'WHITE_4',\n textColor: 'BLACK_T_87',\n };\n }\n\n return {\n bgColor: 'BLACK',\n borderColor: 'BLACK_4',\n textColor: 'WHITE',\n };\n};\n\ninterface IGetPuzzleWorksheetBackgroundColor {\n (imageHue?: THueNames): TColorNames;\n}\n\nconst getPuzzleWorksheetBackgroundColor: IGetPuzzleWorksheetBackgroundColor = imageHue => {\n if (!imageHue) return 'BLUE_1';\n\n return `${imageHue}_1`;\n};\n\nexport {\n getInitialQuestionId,\n getInitialResponses,\n getLastUnlockedQuestionIndex,\n getNavigationSectionBackgroundColor,\n getNavigationSectionIcon,\n getNavigationSectionName,\n getPaperColorByQuestion,\n getQuestionBackgroundImage,\n getQuestionBorderColor,\n getQuestionMetadata,\n getQuestionsFromItems,\n getRenderableQuestions,\n getWorksheetDimensions,\n isConceptIntroWidget,\n isSATAssessmentNode,\n isOkayTypeQuestion,\n scrollToQuestion,\n setMathJaxConfigInWindow,\n getWorksheetNudgeBannerInfo,\n checkIsClozeFormulaResponseInvalid,\n getWorksheetHeaderLayout,\n getPuzzleWorksheetBackgroundColor,\n};\n"],"names":["getSectionNameFromItemType","itemType","isConceptIntroWidget","instructorStimulus","lowerCaseInstructorStimulus","getTagsMap","tags","acc","tag","key","value","trimmedKey","trimmedValue","getQuestionsFromItems","items","sectioned","adaptive","item","itemIndex","hasIntroWidget","content","questions","sectionName","prevItem","itemDisplayNumber","orderedQuestionIds","orderedQuestions","responseId","widgetIndex","question","respId","OPTIONAL_ITEM_TYPES","prevItemType","_a","itemTypeDerived","prevItemTypeDerived","finalQuestions","topics","topicsOrder","a","b","aTopic","QUESTION_TAGS","bTopic","aSortKey","bSortKey","_b","topicOrder","questionCode","getInitialQuestionId","initialQuestion","initialResponseId","initialItemIndex","lastUnlockedQuestionIndex","unlockedQuestions","lastUnlockedQuestion","q","getLastUnlockedQuestionIndex","responses","behavior","userType","maximumAttempts","teacherValidationEnabled","validation","navigationMode","questionIndex","qResp","attemptsHistory","validatedByTeacher","assignStatus","lastAttemptScore","unskippedQuestionIndex","getQuestionMetadata","questionId","isOkayTypeQuestion","getInitialResponses","getWorksheetDimensions","layout","actionBar","QUESTION_WIDTH","SPLIT_QUESTION_WIDTH","ACTION_BAR_HEIGHT","getRenderableQuestions","scrollToQuestion","animation","$questionEl","type","options","instructor_stimulus","setMathJaxConfigInWindow","logger","doc","math","err","EVENTS","jax","getPaperColorByQuestion","item_type","getQuestionBackgroundImage","paperColor","getQuestionBorderColor","isActive","getNavigationSectionBackgroundColor","getNavigationSectionName","getNavigationSectionIcon","Bulb2Icon","Edit2Icon","EditStarIcon","QuestionLetterIcon","Star2Icon","checkIsClozeFormulaResponseInvalid","response","CLOZE_FORMULA_RESPONSE_LIMIT","getWorksheetNudgeBannerInfo","markedAsCompleted","isTeacher","getWorksheetHeaderLayout","isPuzzleWorksheet","isTestWorksheet","imageHue","getPuzzleWorksheetBackgroundColor"],"mappings":";;;;;;;;AAoCA,MAAMA,IAA0D,CAAYC,MAAA;AAC1E,UAAQA,GAAU;AAAA,IAChB,KAAK;AACI,aAAA;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,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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