@cuemath/leap 3.5.52-as1 → 3.5.53-j1
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/features/homework/homework-card.js +122 -121
- package/dist/features/homework/homework-card.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js +66 -61
- package/dist/features/milestone/create/comps/add-custom-chapter/add-custom-chapter.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js +56 -55
- package/dist/features/milestone/create/comps/add-custom-chapter/course-catalog.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/search-chapter/search-chapters.js +32 -25
- package/dist/features/milestone/create/comps/add-custom-chapter/search-chapter/search-chapters.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/selected-chapters/selected-chapter-item.js +16 -15
- package/dist/features/milestone/create/comps/add-custom-chapter/selected-chapters/selected-chapter-item.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/selected-chapters/selected-chapters.js +17 -10
- package/dist/features/milestone/create/comps/add-custom-chapter/selected-chapters/selected-chapters.js.map +1 -1
- package/dist/features/milestone/create/comps/add-custom-chapter/selected-chapters/tags-render.js +6 -6
- package/dist/features/milestone/create/comps/add-custom-chapter/selected-chapters/tags-render.js.map +1 -1
- package/dist/features/milestone/create/comps/body-layout/body-layout.js +30 -29
- package/dist/features/milestone/create/comps/body-layout/body-layout.js.map +1 -1
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js +77 -74
- package/dist/features/milestone/create/comps/chapters-selection-step/chapters-selection-step.js.map +1 -1
- package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js +82 -79
- package/dist/features/milestone/create/comps/goal-completion-date-selector/goal-completion-date-selector.js.map +1 -1
- package/dist/features/milestone/create/milestone-create-styled.js +8 -8
- package/dist/features/milestone/create/milestone-create-styled.js.map +1 -1
- package/dist/features/milestone/create/milestone-create.js +48 -46
- package/dist/features/milestone/create/milestone-create.js.map +1 -1
- package/dist/features/milestone/edit/goal-draft-edit-sync.js +26 -0
- package/dist/features/milestone/edit/goal-draft-edit-sync.js.map +1 -0
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js +72 -66
- package/dist/features/milestone/edit/goal-drafts/goal-draft-edit-container.js.map +1 -1
- package/dist/features/milestone/edit/hooks/use-milestone-edit-sync.js +82 -0
- package/dist/features/milestone/edit/hooks/use-milestone-edit-sync.js.map +1 -0
- package/dist/features/milestone/milestone-list-container/hooks/use-milestone-list-sync.js +49 -0
- package/dist/features/milestone/milestone-list-container/hooks/use-milestone-list-sync.js.map +1 -0
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js +109 -105
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-list.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js +2 -2
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/goals/goal-action-ctas.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs-styled.js +21 -16
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs-styled.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js +106 -98
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-tabs/milestone-tabs.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js +136 -117
- package/dist/features/milestone/milestone-list-container/milestone-list/milestone-widget/milestone-widget.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js +96 -92
- package/dist/features/milestone/milestone-list-container/milestone-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-list-container/milestone-list-sync.js +25 -0
- package/dist/features/milestone/milestone-list-container/milestone-list-sync.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js +78 -81
- package/dist/features/milestone/milestone-resources/resources-assign/added-resource-and-filters.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js +28 -25
- package/dist/features/milestone/milestone-resources/resources-assign/comps/filter-item/filter-item.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item.js +39 -33
- package/dist/features/milestone/milestone-resources/resources-assign/comps/resource-item/resource-item.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/hooks/use-resource-assign-sync.js +50 -0
- package/dist/features/milestone/milestone-resources/resources-assign/hooks/use-resource-assign-sync.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-assign-sync.js +25 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-assign-sync.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.js +43 -53
- package/dist/features/milestone/milestone-resources/resources-assign/resource-items/resource-items.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js +218 -174
- package/dist/features/milestone/milestone-resources/resources-assign/resources-assign.js.map +1 -1
- package/dist/features/milestone/milestone-resources/resources-assign/store/resource-assign-store.js +198 -0
- package/dist/features/milestone/milestone-resources/resources-assign/store/resource-assign-store.js.map +1 -0
- package/dist/features/milestone/milestone-resources/resources-list/resources-list.js +69 -67
- package/dist/features/milestone/milestone-resources/resources-list/resources-list.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js +46 -45
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-container.js.map +1 -1
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js +34 -32
- package/dist/features/milestone/milestone-tests/test-list-v2/test-list-view.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/hooks/use-tests-creation-sync.js +52 -0
- package/dist/features/milestone/milestone-tests/tests-creation/hooks/use-tests-creation-sync.js.map +1 -0
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-selection.js +51 -41
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/chapter-selection/chapter-selection.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/difficulty-and-duration-selection/difficulty-and-duration-selection.js +85 -71
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/difficulty-and-duration-selection/difficulty-and-duration-selection.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/test-preview/test-preview-styled.js +5 -5
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/test-preview/test-preview-styled.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/test-preview/test-preview.js +36 -26
- package/dist/features/milestone/milestone-tests/tests-creation/test-stages/test-preview/test-preview.js.map +1 -1
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation-sync.js +25 -0
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation-sync.js.map +1 -0
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation-types.js +5 -0
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation-types.js.map +1 -0
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js +150 -89
- package/dist/features/milestone/milestone-tests/tests-creation/tests-creation.js.map +1 -1
- package/dist/features/sheet-v2/resource-list/resource-list.js +26 -24
- package/dist/features/sheet-v2/resource-list/resource-list.js.map +1 -1
- package/dist/features/trial-session/comps/learning-plan/index.js +218 -91
- package/dist/features/trial-session/comps/learning-plan/index.js.map +1 -1
- package/dist/features/trial-session/comps/learning-plan/learning-plan-styled.js +7 -6
- package/dist/features/trial-session/comps/learning-plan/learning-plan-styled.js.map +1 -1
- package/dist/features/trial-session/hooks/use-learning-plan-scroll-sync.js +75 -0
- package/dist/features/trial-session/hooks/use-learning-plan-scroll-sync.js.map +1 -0
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js +125 -115
- package/dist/features/trial-session/hooks/use-trial-session-navigation.js.map +1 -1
- package/dist/features/trial-session/trial-session-types.js +3 -2
- package/dist/features/trial-session/trial-session-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js +69 -54
- package/dist/features/worksheet/worksheet/worksheet-behavior-helper.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet-types.js.map +1 -1
- package/dist/features/worksheet/worksheet/worksheet.js +44 -33
- package/dist/features/worksheet/worksheet/worksheet.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js +25 -22
- package/dist/features/worksheet/worksheet-preview/hooks/use-worksheet-layout.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js +48 -44
- package/dist/features/worksheet/worksheet-preview/worksheet-preview-view.js.map +1 -1
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js +2 -2
- package/dist/features/worksheet/worksheet-preview/worksheet-preview.js.map +1 -1
- package/dist/index.d.ts +138 -2
- package/dist/node_modules/decode-uri-component/index.js.map +1 -0
- package/dist/node_modules/query-string/base.js +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/native.js +7 -0
- package/dist/node_modules/uuid/dist/esm-browser/native.js.map +1 -0
- package/dist/node_modules/uuid/dist/esm-browser/rng.js +3 -2
- package/dist/node_modules/uuid/dist/esm-browser/rng.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js +6 -10
- package/dist/node_modules/uuid/dist/esm-browser/stringify.js.map +1 -1
- package/dist/node_modules/uuid/dist/esm-browser/v4.js +12 -9
- package/dist/node_modules/uuid/dist/esm-browser/v4.js.map +1 -1
- package/package.json +1 -1
- package/dist/features/trial-session/comps/learning-plan/use-learning-plan-scroll-sync.js +0 -37
- package/dist/features/trial-session/comps/learning-plan/use-learning-plan-scroll-sync.js.map +0 -1
- package/dist/node_modules/query-string/node_modules/decode-uri-component/index.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/regex.js +0 -5
- package/dist/node_modules/uuid/dist/esm-browser/regex.js.map +0 -1
- package/dist/node_modules/uuid/dist/esm-browser/validate.js +0 -8
- package/dist/node_modules/uuid/dist/esm-browser/validate.js.map +0 -1
- /package/dist/node_modules/{query-string/node_modules/decode-uri-component → decode-uri-component}/index.js +0 -0
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { EWorksheetActivity as
|
|
2
|
-
import { TRIAL_V3_NODE_TYPES as
|
|
3
|
-
const
|
|
1
|
+
import { EWorksheetActivity as E } from "../../../types/models/worksheet.js";
|
|
2
|
+
import { TRIAL_V3_NODE_TYPES as N, ASSESSMENT_NODE_TYPES as R } from "../../sheets/utils/is-v3-worksheet.js";
|
|
3
|
+
const l = (S) => {
|
|
4
4
|
const {
|
|
5
5
|
nodeType: n,
|
|
6
|
-
activityType:
|
|
7
|
-
inClass:
|
|
8
|
-
isDesmosEnabled:
|
|
9
|
-
userType:
|
|
6
|
+
activityType: c,
|
|
7
|
+
inClass: A,
|
|
8
|
+
isDesmosEnabled: u = !1,
|
|
9
|
+
userType: i,
|
|
10
10
|
mode: r,
|
|
11
|
-
worksheetCompleted:
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
worksheetCompleted: t,
|
|
12
|
+
behaviorOverride: m
|
|
13
|
+
} = S, o = N.includes(n), T = R.includes(n), s = r === "resume", a = {
|
|
14
|
+
hints: s,
|
|
14
15
|
navigationMode: "OPEN",
|
|
15
|
-
initialQuestion:
|
|
16
|
-
maximumAttempts:
|
|
16
|
+
initialQuestion: s || i === "TEACHER" && !t ? "CURRENT" : "FIRST",
|
|
17
|
+
maximumAttempts: T ? -1 : 99999,
|
|
17
18
|
minimumAccuracy: 100,
|
|
18
|
-
teacherDiscussionEnabled:
|
|
19
|
-
teacherValidationEnabled:
|
|
20
|
-
canTeacherValidate: !!
|
|
21
|
-
validation:
|
|
19
|
+
teacherDiscussionEnabled: c === E.LESSON_V3_1,
|
|
20
|
+
teacherValidationEnabled: c === E.LESSON_V3 || o,
|
|
21
|
+
canTeacherValidate: !!A && (c === E.LESSON_V3 || o),
|
|
22
|
+
validation: i === "STUDENT" && T ? !!t : !0,
|
|
22
23
|
review: !1,
|
|
23
|
-
canAttempt:
|
|
24
|
+
canAttempt: i === "STUDENT" ? s : !1,
|
|
24
25
|
canExceedAttempts: !0,
|
|
25
26
|
checkButtonLabel: "Check",
|
|
26
27
|
retryButtonLabel: "Retry",
|
|
27
28
|
canMarkForReview: !1,
|
|
28
|
-
canShowDesmosCalc:
|
|
29
|
+
canShowDesmosCalc: u,
|
|
29
30
|
canvasEnabled: r !== "preview",
|
|
30
31
|
canScribble: r !== "preview",
|
|
31
32
|
solutionHidden: !1
|
|
32
33
|
};
|
|
34
|
+
let e;
|
|
33
35
|
switch (n) {
|
|
34
36
|
case "LEARNING":
|
|
35
37
|
case "SAT_MATH_LEARNING":
|
|
36
38
|
case "SAT_ENGLISH_LEARNING":
|
|
37
39
|
return {
|
|
38
|
-
...
|
|
39
|
-
navigationMode:
|
|
40
|
+
...a,
|
|
41
|
+
navigationMode: c === E.LESSON_V3 && s && !A ? "OPEN" : "LINEAR",
|
|
40
42
|
attemptsAfterTeacherInterventionNeeded: 2,
|
|
41
43
|
review: !0
|
|
42
44
|
};
|
|
@@ -44,107 +46,120 @@ const I = (u) => {
|
|
|
44
46
|
case "REMEDIAL":
|
|
45
47
|
case "RECAP":
|
|
46
48
|
case "SAT_MATH_RECAP":
|
|
47
|
-
|
|
48
|
-
...
|
|
49
|
+
e = {
|
|
50
|
+
...a,
|
|
49
51
|
maximumAttempts: 1,
|
|
50
|
-
navigationMode:
|
|
52
|
+
navigationMode: t ? "OPEN" : "LINEAR",
|
|
51
53
|
review: !0
|
|
52
54
|
};
|
|
55
|
+
break;
|
|
53
56
|
case "EXTRA_PRACTICE":
|
|
54
57
|
case "TARGET_PRACTICE":
|
|
55
58
|
case "PRACTICE":
|
|
56
|
-
|
|
59
|
+
e = { ...a, maximumAttempts: 1, review: !0 };
|
|
60
|
+
break;
|
|
57
61
|
case "TURING_PRACTICE":
|
|
58
|
-
|
|
62
|
+
e = { ...a, maximumAttempts: 1 };
|
|
63
|
+
break;
|
|
59
64
|
case "PUZZLE_CARD":
|
|
60
|
-
|
|
61
|
-
...
|
|
65
|
+
e = {
|
|
66
|
+
...a,
|
|
62
67
|
navigationMode: "LINEAR",
|
|
63
68
|
maximumAttempts: -2,
|
|
64
69
|
solutionHidden: !0,
|
|
65
70
|
validation: !1,
|
|
66
71
|
minimumAccuracy: 0
|
|
67
72
|
};
|
|
73
|
+
break;
|
|
68
74
|
case "PUZZLE_EASY":
|
|
69
75
|
case "PUZZLE_MEDIUM":
|
|
70
76
|
case "PUZZLE_HARD":
|
|
71
|
-
|
|
77
|
+
e = { ...a, navigationMode: "LINEAR" };
|
|
78
|
+
break;
|
|
72
79
|
case "TRIAL_DIAGNOSTIC":
|
|
73
|
-
|
|
80
|
+
e = { ...a, navigationMode: "ADAPTIVE", review: !0 };
|
|
81
|
+
break;
|
|
74
82
|
case "TRIAL_BASIC":
|
|
75
83
|
case "TRIAL_INTERMEDIATE":
|
|
76
84
|
case "TRIAL_ADVANCED":
|
|
77
|
-
|
|
78
|
-
...
|
|
85
|
+
e = {
|
|
86
|
+
...a,
|
|
79
87
|
navigationMode: "CURRENT",
|
|
80
88
|
review: !0
|
|
81
89
|
};
|
|
90
|
+
break;
|
|
82
91
|
case "ASSESSMENT":
|
|
83
92
|
case "CHAPTER_ASSESSMENT":
|
|
84
93
|
case "DIAGNOSTIC":
|
|
85
94
|
case "DYNAMIC":
|
|
86
95
|
case "TURING_ASSESSMENT":
|
|
87
|
-
|
|
88
|
-
...
|
|
96
|
+
e = {
|
|
97
|
+
...a,
|
|
89
98
|
minimumAccuracy: 0
|
|
90
99
|
};
|
|
100
|
+
break;
|
|
91
101
|
case "SAT_MATH_ASSESSMENT":
|
|
92
102
|
case "SAT_ENGLISH_ASSESSMENT":
|
|
93
|
-
|
|
94
|
-
...
|
|
103
|
+
e = {
|
|
104
|
+
...a,
|
|
95
105
|
canMarkForReview: !0,
|
|
96
106
|
minimumAccuracy: 0,
|
|
97
107
|
canvasEnabled: !1
|
|
98
108
|
};
|
|
109
|
+
break;
|
|
99
110
|
case "MASTERY":
|
|
100
|
-
|
|
101
|
-
...
|
|
102
|
-
hintsTimer:
|
|
103
|
-
navigationMode:
|
|
111
|
+
e = {
|
|
112
|
+
...a,
|
|
113
|
+
hintsTimer: i === "STUDENT" && s ? 90 : void 0,
|
|
114
|
+
navigationMode: t ? "OPEN" : "LINEAR",
|
|
104
115
|
skippable: !0,
|
|
105
116
|
skippableTime: 90,
|
|
106
|
-
solutionHidden: !
|
|
117
|
+
solutionHidden: !t,
|
|
107
118
|
minimumAccuracy: 0,
|
|
108
|
-
canScribble:
|
|
119
|
+
canScribble: i === "TEACHER" ? t : !0
|
|
109
120
|
};
|
|
121
|
+
break;
|
|
110
122
|
case "SUBJECTIVE":
|
|
111
123
|
case "TURING_SUBJECTIVE":
|
|
112
|
-
|
|
113
|
-
...
|
|
124
|
+
e = {
|
|
125
|
+
...a,
|
|
114
126
|
maximumAttempts: 1,
|
|
115
127
|
minimumAccuracy: 0,
|
|
116
128
|
validation: !1,
|
|
117
|
-
solutionHidden: !
|
|
129
|
+
solutionHidden: !t
|
|
118
130
|
};
|
|
131
|
+
break;
|
|
119
132
|
case "LEGACY":
|
|
120
133
|
case "REVISION":
|
|
121
|
-
|
|
122
|
-
...
|
|
134
|
+
e = {
|
|
135
|
+
...a,
|
|
123
136
|
maximumAttempts: 2,
|
|
124
137
|
canExceedAttempts: !1,
|
|
125
138
|
minimumAccuracy: 0,
|
|
126
139
|
review: !0
|
|
127
140
|
};
|
|
141
|
+
break;
|
|
128
142
|
case "LEVEL2":
|
|
129
143
|
case "LEVEL3":
|
|
130
|
-
|
|
131
|
-
...
|
|
144
|
+
e = {
|
|
145
|
+
...a,
|
|
132
146
|
maximumAttempts: 1,
|
|
133
147
|
canExceedAttempts: !1,
|
|
134
148
|
minimumAccuracy: 0,
|
|
135
149
|
review: !0,
|
|
136
|
-
navigationMode:
|
|
150
|
+
navigationMode: t ? "OPEN" : "LINEAR"
|
|
137
151
|
};
|
|
152
|
+
break;
|
|
138
153
|
default:
|
|
139
|
-
|
|
140
|
-
...
|
|
154
|
+
e = {
|
|
155
|
+
...a,
|
|
141
156
|
maximumAttempts: 1,
|
|
142
|
-
navigationMode:
|
|
157
|
+
navigationMode: t ? "OPEN" : "LINEAR"
|
|
143
158
|
};
|
|
144
159
|
}
|
|
145
|
-
return e;
|
|
160
|
+
return m ? { ...e, ...m } : e;
|
|
146
161
|
};
|
|
147
162
|
export {
|
|
148
|
-
|
|
163
|
+
l as getWorksheetBehaviour
|
|
149
164
|
};
|
|
150
165
|
//# sourceMappingURL=worksheet-behavior-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet-behavior-helper.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-behavior-helper.ts"],"sourcesContent":["import { EWorksheetActivity, type TNodeTypes } from '../../../types/models/worksheet';\nimport { ASSESSMENT_NODE_TYPES, TRIAL_V3_NODE_TYPES } from '../../sheets/utils/is-v3-worksheet';\nimport type { TUserTypes } from '../../ui/types';\nimport type { IWorksheetBehavior } from './worksheet-types';\n\ninterface IGetWorksheetBehaviour {\n (params: {\n nodeType: TNodeTypes;\n activityType: EWorksheetActivity | null;\n inClass?: boolean;\n isDesmosEnabled?: boolean;\n userType: TUserTypes;\n mode: 'resume' | 'review' | 'preview';\n worksheetCompleted?: boolean;\n }): IWorksheetBehavior;\n}\n\nexport const getWorksheetBehaviour: IGetWorksheetBehaviour = params => {\n const {\n nodeType,\n activityType,\n inClass,\n isDesmosEnabled = false,\n userType,\n mode,\n worksheetCompleted,\n } = params;\n const isTrialV3 = TRIAL_V3_NODE_TYPES.includes(nodeType);\n const isAssessment = ASSESSMENT_NODE_TYPES.includes(nodeType);\n const canAttempt = mode === 'resume';\n\n const baseBehavior: IWorksheetBehavior = {\n hints: canAttempt,\n navigationMode: 'OPEN',\n initialQuestion:\n canAttempt || (userType === 'TEACHER' && !worksheetCompleted) ? 'CURRENT' : 'FIRST',\n maximumAttempts: isAssessment ? -1 : 99999,\n minimumAccuracy: 100,\n teacherDiscussionEnabled: activityType === EWorksheetActivity.LESSON_V3_1,\n teacherValidationEnabled: activityType === EWorksheetActivity.LESSON_V3 || isTrialV3,\n canTeacherValidate: !!inClass && (activityType === EWorksheetActivity.LESSON_V3 || isTrialV3),\n validation: userType === 'STUDENT' && isAssessment ? !!worksheetCompleted : true,\n review: false,\n canAttempt: userType === 'STUDENT' ? canAttempt : false,\n canExceedAttempts: true,\n checkButtonLabel: 'Check',\n retryButtonLabel: 'Retry',\n canMarkForReview: false,\n canShowDesmosCalc: isDesmosEnabled,\n canvasEnabled: mode !== 'preview',\n canScribble: mode !== 'preview',\n solutionHidden: false,\n };\n\n switch (nodeType) {\n // LEARNING SHEETS\n case 'LEARNING':\n case 'SAT_MATH_LEARNING':\n case 'SAT_ENGLISH_LEARNING': {\n return {\n ...baseBehavior,\n navigationMode:\n activityType === EWorksheetActivity.LESSON_V3 && canAttempt && !inClass\n ? 'OPEN'\n : 'LINEAR',\n attemptsAfterTeacherInterventionNeeded: 2,\n review: true,\n };\n }\n\n // RECAP SHEETS\n case 'GENERAL':\n case 'REMEDIAL':\n case 'RECAP':\n case 'SAT_MATH_RECAP':\n
|
|
1
|
+
{"version":3,"file":"worksheet-behavior-helper.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-behavior-helper.ts"],"sourcesContent":["import { EWorksheetActivity, type TNodeTypes } from '../../../types/models/worksheet';\nimport { ASSESSMENT_NODE_TYPES, TRIAL_V3_NODE_TYPES } from '../../sheets/utils/is-v3-worksheet';\nimport type { TUserTypes } from '../../ui/types';\nimport type { IWorksheetBehavior } from './worksheet-types';\n\ninterface IGetWorksheetBehaviour {\n (params: {\n nodeType: TNodeTypes;\n activityType: EWorksheetActivity | null;\n inClass?: boolean;\n isDesmosEnabled?: boolean;\n userType: TUserTypes;\n mode: 'resume' | 'review' | 'preview';\n worksheetCompleted?: boolean;\n behaviorOverride?: Partial<IWorksheetBehavior>;\n }): IWorksheetBehavior;\n}\n\nexport const getWorksheetBehaviour: IGetWorksheetBehaviour = params => {\n const {\n nodeType,\n activityType,\n inClass,\n isDesmosEnabled = false,\n userType,\n mode,\n worksheetCompleted,\n behaviorOverride,\n } = params;\n const isTrialV3 = TRIAL_V3_NODE_TYPES.includes(nodeType);\n const isAssessment = ASSESSMENT_NODE_TYPES.includes(nodeType);\n const canAttempt = mode === 'resume';\n\n const baseBehavior: IWorksheetBehavior = {\n hints: canAttempt,\n navigationMode: 'OPEN',\n initialQuestion:\n canAttempt || (userType === 'TEACHER' && !worksheetCompleted) ? 'CURRENT' : 'FIRST',\n maximumAttempts: isAssessment ? -1 : 99999,\n minimumAccuracy: 100,\n teacherDiscussionEnabled: activityType === EWorksheetActivity.LESSON_V3_1,\n teacherValidationEnabled: activityType === EWorksheetActivity.LESSON_V3 || isTrialV3,\n canTeacherValidate: !!inClass && (activityType === EWorksheetActivity.LESSON_V3 || isTrialV3),\n validation: userType === 'STUDENT' && isAssessment ? !!worksheetCompleted : true,\n review: false,\n canAttempt: userType === 'STUDENT' ? canAttempt : false,\n canExceedAttempts: true,\n checkButtonLabel: 'Check',\n retryButtonLabel: 'Retry',\n canMarkForReview: false,\n canShowDesmosCalc: isDesmosEnabled,\n canvasEnabled: mode !== 'preview',\n canScribble: mode !== 'preview',\n solutionHidden: false,\n };\n\n let behavior: IWorksheetBehavior;\n\n switch (nodeType) {\n // LEARNING SHEETS\n case 'LEARNING':\n case 'SAT_MATH_LEARNING':\n case 'SAT_ENGLISH_LEARNING': {\n return {\n ...baseBehavior,\n navigationMode:\n activityType === EWorksheetActivity.LESSON_V3 && canAttempt && !inClass\n ? 'OPEN'\n : 'LINEAR',\n attemptsAfterTeacherInterventionNeeded: 2,\n review: true,\n };\n }\n\n // RECAP SHEETS\n case 'GENERAL':\n case 'REMEDIAL':\n case 'RECAP':\n case 'SAT_MATH_RECAP':\n behavior = {\n ...baseBehavior,\n maximumAttempts: 1,\n navigationMode: !worksheetCompleted ? 'LINEAR' : 'OPEN',\n review: true,\n };\n break;\n\n // PRACTICE SHEETS\n case 'EXTRA_PRACTICE':\n case 'TARGET_PRACTICE':\n case 'PRACTICE':\n behavior = { ...baseBehavior, maximumAttempts: 1, review: true };\n break;\n\n case 'TURING_PRACTICE':\n behavior = { ...baseBehavior, maximumAttempts: 1 };\n break;\n\n //PUZZLE SHEETS\n case 'PUZZLE_CARD':\n behavior = {\n ...baseBehavior,\n navigationMode: 'LINEAR',\n maximumAttempts: -2,\n solutionHidden: true,\n validation: false,\n minimumAccuracy: 0,\n };\n break;\n\n case 'PUZZLE_EASY':\n case 'PUZZLE_MEDIUM':\n case 'PUZZLE_HARD':\n behavior = { ...baseBehavior, navigationMode: 'LINEAR' };\n break;\n\n // TRIAL SHEETS\n case 'TRIAL_DIAGNOSTIC':\n behavior = { ...baseBehavior, navigationMode: 'ADAPTIVE', review: true };\n break;\n\n case 'TRIAL_BASIC':\n case 'TRIAL_INTERMEDIATE':\n case 'TRIAL_ADVANCED':\n behavior = {\n ...baseBehavior,\n navigationMode: 'CURRENT',\n review: true,\n };\n break;\n\n // ASSESSMENT SHEETS\n case 'ASSESSMENT':\n case 'CHAPTER_ASSESSMENT':\n case 'DIAGNOSTIC':\n case 'DYNAMIC':\n case 'TURING_ASSESSMENT':\n behavior = {\n ...baseBehavior,\n minimumAccuracy: 0,\n };\n break;\n\n case 'SAT_MATH_ASSESSMENT':\n case 'SAT_ENGLISH_ASSESSMENT':\n behavior = {\n ...baseBehavior,\n canMarkForReview: true,\n minimumAccuracy: 0,\n canvasEnabled: false,\n };\n break;\n\n case 'MASTERY':\n behavior = {\n ...baseBehavior,\n hintsTimer: userType === 'STUDENT' && canAttempt ? 90 : undefined,\n navigationMode: !worksheetCompleted ? 'LINEAR' : 'OPEN',\n skippable: true,\n skippableTime: 90,\n solutionHidden: !worksheetCompleted,\n minimumAccuracy: 0,\n canScribble: userType === 'TEACHER' ? worksheetCompleted : true,\n };\n break;\n\n // SUBJECTIVE SHEETS\n case 'SUBJECTIVE':\n case 'TURING_SUBJECTIVE':\n behavior = {\n ...baseBehavior,\n maximumAttempts: 1,\n minimumAccuracy: 0,\n validation: false,\n solutionHidden: !worksheetCompleted,\n };\n break;\n\n // REVISION SHEETS\n case 'LEGACY':\n case 'REVISION':\n behavior = {\n ...baseBehavior,\n maximumAttempts: 2,\n canExceedAttempts: false,\n minimumAccuracy: 0,\n review: true,\n };\n break;\n\n case 'LEVEL2':\n case 'LEVEL3':\n behavior = {\n ...baseBehavior,\n maximumAttempts: 1,\n canExceedAttempts: false,\n minimumAccuracy: 0,\n review: true,\n navigationMode: !worksheetCompleted ? 'LINEAR' : 'OPEN',\n };\n break;\n\n default:\n behavior = {\n ...baseBehavior,\n maximumAttempts: 1,\n navigationMode: !worksheetCompleted ? 'LINEAR' : 'OPEN',\n };\n }\n\n return behaviorOverride ? { ...behavior, ...behaviorOverride } : behavior;\n};\n"],"names":["getWorksheetBehaviour","params","nodeType","activityType","inClass","isDesmosEnabled","userType","mode","worksheetCompleted","behaviorOverride","isTrialV3","TRIAL_V3_NODE_TYPES","isAssessment","ASSESSMENT_NODE_TYPES","canAttempt","baseBehavior","EWorksheetActivity","behavior"],"mappings":";;AAkBO,MAAMA,IAAgD,CAAUC,MAAA;AAC/D,QAAA;AAAA,IACJ,UAAAC;AAAA,IACA,cAAAC;AAAA,IACA,SAAAC;AAAA,IACA,iBAAAC,IAAkB;AAAA,IAClB,UAAAC;AAAA,IACA,MAAAC;AAAA,IACA,oBAAAC;AAAA,IACA,kBAAAC;AAAA,EACE,IAAAR,GACES,IAAYC,EAAoB,SAAST,CAAQ,GACjDU,IAAeC,EAAsB,SAASX,CAAQ,GACtDY,IAAaP,MAAS,UAEtBQ,IAAmC;AAAA,IACvC,OAAOD;AAAA,IACP,gBAAgB;AAAA,IAChB,iBACEA,KAAeR,MAAa,aAAa,CAACE,IAAsB,YAAY;AAAA,IAC9E,iBAAiBI,IAAe,KAAK;AAAA,IACrC,iBAAiB;AAAA,IACjB,0BAA0BT,MAAiBa,EAAmB;AAAA,IAC9D,0BAA0Bb,MAAiBa,EAAmB,aAAaN;AAAA,IAC3E,oBAAoB,CAAC,CAACN,MAAYD,MAAiBa,EAAmB,aAAaN;AAAA,IACnF,YAAYJ,MAAa,aAAaM,IAAe,CAAC,CAACJ,IAAqB;AAAA,IAC5E,QAAQ;AAAA,IACR,YAAYF,MAAa,YAAYQ,IAAa;AAAA,IAClD,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,kBAAkB;AAAA,IAClB,kBAAkB;AAAA,IAClB,mBAAmBT;AAAA,IACnB,eAAeE,MAAS;AAAA,IACxB,aAAaA,MAAS;AAAA,IACtB,gBAAgB;AAAA,EAAA;AAGd,MAAAU;AAEJ,UAAQf,GAAU;AAAA,IAEhB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACI,aAAA;AAAA,QACL,GAAGa;AAAA,QACH,gBACEZ,MAAiBa,EAAmB,aAAaF,KAAc,CAACV,IAC5D,SACA;AAAA,QACN,wCAAwC;AAAA,QACxC,QAAQ;AAAA,MAAA;AAAA,IAKZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACQ,MAAAa,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,iBAAiB;AAAA,QACjB,gBAAiBP,IAAgC,SAAX;AAAA,QACtC,QAAQ;AAAA,MAAA;AAEV;AAAA,IAGF,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,MAAAS,IAAW,EAAE,GAAGF,GAAc,iBAAiB,GAAG,QAAQ;AAC1D;AAAA,IAEF,KAAK;AACH,MAAAE,IAAW,EAAE,GAAGF,GAAc,iBAAiB,EAAE;AACjD;AAAA,IAGF,KAAK;AACQ,MAAAE,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,gBAAgB;AAAA,QAChB,iBAAiB;AAAA,QACjB,gBAAgB;AAAA,QAChB,YAAY;AAAA,QACZ,iBAAiB;AAAA,MAAA;AAEnB;AAAA,IAEF,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,MAAAE,IAAW,EAAE,GAAGF,GAAc,gBAAgB,SAAS;AACvD;AAAA,IAGF,KAAK;AACH,MAAAE,IAAW,EAAE,GAAGF,GAAc,gBAAgB,YAAY,QAAQ;AAClE;AAAA,IAEF,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACQ,MAAAE,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,gBAAgB;AAAA,QAChB,QAAQ;AAAA,MAAA;AAEV;AAAA,IAGF,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACQ,MAAAE,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,iBAAiB;AAAA,MAAA;AAEnB;AAAA,IAEF,KAAK;AAAA,IACL,KAAK;AACQ,MAAAE,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,kBAAkB;AAAA,QAClB,iBAAiB;AAAA,QACjB,eAAe;AAAA,MAAA;AAEjB;AAAA,IAEF,KAAK;AACQ,MAAAE,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,YAAYT,MAAa,aAAaQ,IAAa,KAAK;AAAA,QACxD,gBAAiBN,IAAgC,SAAX;AAAA,QACtC,WAAW;AAAA,QACX,eAAe;AAAA,QACf,gBAAgB,CAACA;AAAA,QACjB,iBAAiB;AAAA,QACjB,aAAaF,MAAa,YAAYE,IAAqB;AAAA,MAAA;AAE7D;AAAA,IAGF,KAAK;AAAA,IACL,KAAK;AACQ,MAAAS,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,iBAAiB;AAAA,QACjB,iBAAiB;AAAA,QACjB,YAAY;AAAA,QACZ,gBAAgB,CAACP;AAAA,MAAA;AAEnB;AAAA,IAGF,KAAK;AAAA,IACL,KAAK;AACQ,MAAAS,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,iBAAiB;AAAA,QACjB,mBAAmB;AAAA,QACnB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,MAAA;AAEV;AAAA,IAEF,KAAK;AAAA,IACL,KAAK;AACQ,MAAAE,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,iBAAiB;AAAA,QACjB,mBAAmB;AAAA,QACnB,iBAAiB;AAAA,QACjB,QAAQ;AAAA,QACR,gBAAiBP,IAAgC,SAAX;AAAA,MAAW;AAEnD;AAAA,IAEF;AACa,MAAAS,IAAA;AAAA,QACT,GAAGF;AAAA,QACH,iBAAiB;AAAA,QACjB,gBAAiBP,IAAgC,SAAX;AAAA,MAAW;AAAA,EAEvD;AAEA,SAAOC,IAAmB,EAAE,GAAGQ,GAAU,GAAGR,MAAqBQ;AACnE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement, ReactNode } from 'react';\n\nimport type { EWorksheetActivity, TNodeTypes } from '../../../types/models/worksheet';\nimport type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\nimport type { TWorksheetBlocker } from './worksheet-blocker/worksheet-blocker-types';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n acknowledgements?: string;\n sample_answer?: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\n\nexport type TItemType =\n | 'overview'\n | 'learning'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\ninterface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n /**\n * If true, the question is not a question, but a content only item\n * e.g. Intro, Overview, Instruction etc.\n */\n is_non_question?: boolean;\n concept_intro_stimulus?: string; // Content for concept intro widget\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n /**\n * if true, scribbler button will be shown on the question\n */\n can_scribble: boolean; // If true, the question can be scribbled on\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\ninterface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n /**\n * For non question questions, when user click on start, responseGiven will be true\n */\n responseGiven?: boolean;\n retryEnabled?: boolean;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n discussionQuestionOffset?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, after the question is system validated, teacher discussion button will be shown when the question has discussion points.\n */\n teacherDiscussionEnabled?: boolean;\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * This needs teacherValidationEnabled to be true\n * TODO: Consider changing to accept validation type: 'system' | 'teacher' | undefined instead of boolean\n */\n canTeacherValidate: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, solution wont be shown to the user.\n */\n solutionHidden?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n\n /**\n * After attemptsAfterTeacherInterventionNeeded incorrect attempts, retry button will be disabled in class, move ahead button will show ouside class.\n */\n attemptsAfterTeacherInterventionNeeded?: number;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n\n // If true, canvas is enabled and user can use canvas to scribble on the worksheet by toggling the scribble button\n canvasEnabled?: boolean;\n\n // If true, the user can scribble on workheet\n canScribble?: boolean;\n}\n\nexport type TWORKSHEET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onAllowRetry?: (questionId: string) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (\n responses: Record<string, IWorksheetResponse>,\n questions: IWorksheetQuestion[],\n ) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n onResolveDoubt?: (responseId: string) => void;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\ninterface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\ninterface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\ninterface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n background?: 'none' | 'paper';\n questionPadding: number;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n initialResponseId?: string;\n initialItemIndex?: number;\n layout: IWorksheetLayout;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n canResolveDoubt?: boolean;\n canShowActionBar?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n activityType: EWorksheetActivity | null;\n isDesmosEnabled?: boolean; // If true, the worksheet can show desmos calculator\n nodeType: TNodeTypes; // NodeType of the worksheet\n mode: 'resume' | 'review' | 'preview'; // mode of the worksheet\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\ninterface IWorksheetPlugins {\n plugins?: {\n stickers?: ReactNode;\n };\n}\n\ninterface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\ninterface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n allowRetry: (responseId: string) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n\nexport type TWorksheetStoreProps = Omit<\n IBaseWorksheetProps,\n 'studentName' | 'canShowActionBar' | 'itemsSignedRequest' | 'mode'\n> &\n Required<Pick<IBaseWorksheetProps, 'studentName' | 'canShowActionBar'>> &\n Omit<IWorksheetCallbackProps, 'onLoaded' | 'onErrored'> &\n ICueCanvasProps &\n ICueCanvasCallbackProps &\n IPointerSyncCallbackProps &\n IWorksheetPlugins & {\n behavior: IWorksheetBehavior;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n };\n\nexport enum EActiveQuestionTool {\n TEACHING_TOOLS = 'TEACHING_TOOLS',\n SOLUTION = 'SOLUTION',\n DISCUSSION = 'DISCUSSION',\n}\n\nexport interface IWorksheetStoreState {\n questions: IWorksheetQuestion[];\n renderableQuestions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n lastUnlockedQuestionIndex: number;\n initialQuestionId: string;\n activeQuestionId: string;\n activeQuestionIndex: number;\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n summaryVisible: boolean;\n calculatorVisible: boolean;\n scribblingEnabled: boolean;\n activeQuestionTool?: EActiveQuestionTool;\n blocker?: TWorksheetBlocker;\n scrolledToInitialQuestion: boolean;\n}\n\n// Actions interface - contains all the methods\ninterface IWorksheetStoreActions {\n mergeWorksheetProps: (data: TWorksheetStoreProps) => void;\n setResponses: (\n responses:\n | IWorksheetStore['responses']\n | ((prevResponses: IWorksheetStore['responses']) => IWorksheetStore['responses']),\n ) => void;\n showSummary: () => void;\n hideSummary: () => void;\n toggleSummary: () => void;\n toggleCalculator: () => void;\n toggleScribble: () => void;\n setBlocker: (blocker?: TWorksheetBlocker) => void;\n /**\n *\n * @param scrollToLastUnlockedQuestion - If true, scrolls to the last unlocked question after removing the blocker. Default is true.\n * @returns\n */\n removeBlocker: (scrollToLastUnlockedQuestion?: boolean) => void;\n updateResponse: (options: {\n responseId: string;\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n timeSpent: number;\n answerChecked?: boolean;\n }) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n setDiscussionQuestionOffset: (responseId: string, offset: number) => void;\n markForReview: (responseId: string, markedForReview: boolean) => void;\n changeQuestion: (questionId: string, shouldScroll?: boolean, scrollDelay?: number) => void;\n setActiveQuestionTool: (tool: EActiveQuestionTool) => void;\n unsetActiveQuestionTool: () => void;\n destroy: () => void;\n}\n\n// Combined store interface\nexport interface IWorksheetStore\n extends IWorksheetStoreState,\n TWorksheetStoreProps,\n IWorksheetStoreActions {}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING","EActiveQuestionTool"],"mappings":"AASY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA,GAujBAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,WAAW,YACXA,EAAA,aAAa,cAHHA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement, ReactNode } from 'react';\n\nimport type { EWorksheetActivity, TNodeTypes } from '../../../types/models/worksheet';\nimport type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\nimport type { TWorksheetBlocker } from './worksheet-blocker/worksheet-blocker-types';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n acknowledgements?: string;\n sample_answer?: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\n\nexport type TItemType =\n | 'overview'\n | 'learning'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\ninterface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n /**\n * If true, the question is not a question, but a content only item\n * e.g. Intro, Overview, Instruction etc.\n */\n is_non_question?: boolean;\n concept_intro_stimulus?: string; // Content for concept intro widget\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n /**\n * if true, scribbler button will be shown on the question\n */\n can_scribble: boolean; // If true, the question can be scribbled on\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\ninterface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n /**\n * For non question questions, when user click on start, responseGiven will be true\n */\n responseGiven?: boolean;\n retryEnabled?: boolean;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n discussionQuestionOffset?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, after the question is system validated, teacher discussion button will be shown when the question has discussion points.\n */\n teacherDiscussionEnabled?: boolean;\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * This needs teacherValidationEnabled to be true\n * TODO: Consider changing to accept validation type: 'system' | 'teacher' | undefined instead of boolean\n */\n canTeacherValidate: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, solution wont be shown to the user.\n */\n solutionHidden?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n\n /**\n * After attemptsAfterTeacherInterventionNeeded incorrect attempts, retry button will be disabled in class, move ahead button will show ouside class.\n */\n attemptsAfterTeacherInterventionNeeded?: number;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n\n // If true, canvas is enabled and user can use canvas to scribble on the worksheet by toggling the scribble button\n canvasEnabled?: boolean;\n\n // If true, the user can scribble on workheet\n canScribble?: boolean;\n}\n\nexport type TWORKSHEET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onAllowRetry?: (questionId: string) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (\n responses: Record<string, IWorksheetResponse>,\n questions: IWorksheetQuestion[],\n ) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n onResolveDoubt?: (responseId: string) => void;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n}\n\ninterface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\ninterface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\ninterface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n background?: 'none' | 'paper';\n questionPadding: number;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n initialResponseId?: string;\n initialItemIndex?: number;\n layout: IWorksheetLayout;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n canResolveDoubt?: boolean;\n canShowActionBar?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n activityType: EWorksheetActivity | null;\n isDesmosEnabled?: boolean; // If true, the worksheet can show desmos calculator\n nodeType: TNodeTypes; // NodeType of the worksheet\n mode: 'resume' | 'review' | 'preview'; // mode of the worksheet\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n behaviorOverride?: Partial<IWorksheetBehavior>;\n}\n\ninterface IWorksheetPlugins {\n plugins?: {\n stickers?: ReactNode;\n };\n}\n\ninterface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\ninterface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n allowRetry: (responseId: string) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n\nexport type TWorksheetStoreProps = Omit<\n IBaseWorksheetProps,\n 'studentName' | 'canShowActionBar' | 'itemsSignedRequest' | 'mode'\n> &\n Required<Pick<IBaseWorksheetProps, 'studentName' | 'canShowActionBar'>> &\n Omit<IWorksheetCallbackProps, 'onLoaded' | 'onErrored'> &\n ICueCanvasProps &\n ICueCanvasCallbackProps &\n IPointerSyncCallbackProps &\n IWorksheetPlugins & {\n behavior: IWorksheetBehavior;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n };\n\nexport enum EActiveQuestionTool {\n TEACHING_TOOLS = 'TEACHING_TOOLS',\n SOLUTION = 'SOLUTION',\n DISCUSSION = 'DISCUSSION',\n}\n\nexport interface IWorksheetStoreState {\n questions: IWorksheetQuestion[];\n renderableQuestions: IWorksheetQuestion[];\n responses: Record<string, IWorksheetResponse>;\n lastUnlockedQuestionIndex: number;\n initialQuestionId: string;\n activeQuestionId: string;\n activeQuestionIndex: number;\n questionsContainerWidth: number;\n maxQuestionWidth: number;\n actionbarHeight: number;\n summaryVisible: boolean;\n calculatorVisible: boolean;\n scribblingEnabled: boolean;\n activeQuestionTool?: EActiveQuestionTool;\n blocker?: TWorksheetBlocker;\n scrolledToInitialQuestion: boolean;\n}\n\n// Actions interface - contains all the methods\ninterface IWorksheetStoreActions {\n mergeWorksheetProps: (data: TWorksheetStoreProps) => void;\n setResponses: (\n responses:\n | IWorksheetStore['responses']\n | ((prevResponses: IWorksheetStore['responses']) => IWorksheetStore['responses']),\n ) => void;\n showSummary: () => void;\n hideSummary: () => void;\n toggleSummary: () => void;\n toggleCalculator: () => void;\n toggleScribble: () => void;\n setBlocker: (blocker?: TWorksheetBlocker) => void;\n /**\n *\n * @param scrollToLastUnlockedQuestion - If true, scrolls to the last unlocked question after removing the blocker. Default is true.\n * @returns\n */\n removeBlocker: (scrollToLastUnlockedQuestion?: boolean) => void;\n updateResponse: (options: {\n responseId: string;\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n timeSpent: number;\n answerChecked?: boolean;\n }) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHEET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n setDiscussionQuestionOffset: (responseId: string, offset: number) => void;\n markForReview: (responseId: string, markedForReview: boolean) => void;\n changeQuestion: (questionId: string, shouldScroll?: boolean, scrollDelay?: number) => void;\n setActiveQuestionTool: (tool: EActiveQuestionTool) => void;\n unsetActiveQuestionTool: () => void;\n destroy: () => void;\n}\n\n// Combined store interface\nexport interface IWorksheetStore\n extends IWorksheetStoreState,\n TWorksheetStoreProps,\n IWorksheetStoreActions {}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING","EActiveQuestionTool"],"mappings":"AASY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA,GAwjBAC,sBAAAA,OACVA,EAAA,iBAAiB,kBACjBA,EAAA,WAAW,YACXA,EAAA,aAAa,cAHHA,IAAAA,KAAA,CAAA,CAAA;"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
-
import { memo as P, forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
2
|
+
import { memo as P, forwardRef as D, useMemo as I, useCallback as N, useEffect as l } from "react";
|
|
3
|
+
import V from "../../cue-canvas/cue-canvas-provider.js";
|
|
4
|
+
import x from "../constants/events.js";
|
|
5
|
+
import H from "./hooks/use-learnosity.js";
|
|
6
|
+
import O from "./hooks/use-worksheet-data-helper.js";
|
|
7
7
|
import { getWorksheetBehaviour as _ } from "./worksheet-behavior-helper.js";
|
|
8
8
|
import j from "./worksheet-provider.js";
|
|
9
9
|
import K from "./worksheet-view.js";
|
|
10
10
|
const M = P(
|
|
11
|
-
|
|
11
|
+
D((R, S) => {
|
|
12
12
|
const {
|
|
13
|
-
attemptId:
|
|
14
|
-
itemsSignedRequest:
|
|
13
|
+
attemptId: w,
|
|
14
|
+
itemsSignedRequest: W,
|
|
15
15
|
questionsSignedRequest: h,
|
|
16
16
|
onLoaded: t,
|
|
17
17
|
onErrored: n,
|
|
18
18
|
onResponsesLoaded: m,
|
|
19
|
-
loggerRef:
|
|
19
|
+
loggerRef: r,
|
|
20
20
|
userType: i,
|
|
21
21
|
worksheetCompleted: d,
|
|
22
22
|
inClass: c,
|
|
@@ -24,10 +24,11 @@ const M = P(
|
|
|
24
24
|
mode: k,
|
|
25
25
|
activityType: p,
|
|
26
26
|
isDesmosEnabled: g = !1,
|
|
27
|
-
studentName:
|
|
28
|
-
canShowActionBar:
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
studentName: C,
|
|
28
|
+
canShowActionBar: T,
|
|
29
|
+
behaviorOverride: v,
|
|
30
|
+
...b
|
|
31
|
+
} = R, q = I(
|
|
31
32
|
() => _({
|
|
32
33
|
nodeType: u,
|
|
33
34
|
inClass: c,
|
|
@@ -35,14 +36,24 @@ const M = P(
|
|
|
35
36
|
isDesmosEnabled: g,
|
|
36
37
|
mode: k,
|
|
37
38
|
userType: i,
|
|
38
|
-
worksheetCompleted: d
|
|
39
|
+
worksheetCompleted: d,
|
|
40
|
+
behaviorOverride: v
|
|
39
41
|
}),
|
|
40
|
-
[
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
[
|
|
43
|
+
u,
|
|
44
|
+
c,
|
|
45
|
+
p,
|
|
46
|
+
g,
|
|
47
|
+
k,
|
|
48
|
+
i,
|
|
49
|
+
d,
|
|
50
|
+
v
|
|
51
|
+
]
|
|
52
|
+
), { loadingState: o, data: e, error: E } = O({
|
|
53
|
+
attemptId: w,
|
|
54
|
+
signedRequest: W,
|
|
55
|
+
loggerRef: r
|
|
56
|
+
}), A = N(
|
|
46
57
|
(a) => {
|
|
47
58
|
n({
|
|
48
59
|
code: a.code,
|
|
@@ -50,29 +61,29 @@ const M = P(
|
|
|
50
61
|
});
|
|
51
62
|
},
|
|
52
63
|
[n]
|
|
53
|
-
), { learnosity:
|
|
64
|
+
), { learnosity: s, appendedQuestionIds: B } = H(
|
|
54
65
|
h,
|
|
55
66
|
A,
|
|
56
|
-
|
|
67
|
+
r
|
|
57
68
|
), y = (() => {
|
|
58
|
-
if (o === "success" && e &&
|
|
69
|
+
if (o === "success" && e && s) {
|
|
59
70
|
const { learnosityItems: a, responses: L } = e;
|
|
60
71
|
return {
|
|
61
72
|
learnosityItems: a,
|
|
62
73
|
learnosityResponses: L,
|
|
63
74
|
behavior: q,
|
|
64
|
-
studentName:
|
|
65
|
-
canShowActionBar:
|
|
75
|
+
studentName: C ?? "Student",
|
|
76
|
+
canShowActionBar: T ?? !0,
|
|
66
77
|
userType: i,
|
|
67
78
|
questionsSignedRequest: h,
|
|
68
79
|
worksheetCompleted: d,
|
|
69
|
-
learnosity:
|
|
70
|
-
loggerRef:
|
|
80
|
+
learnosity: s,
|
|
81
|
+
loggerRef: r,
|
|
71
82
|
appendedQuestionIds: B,
|
|
72
83
|
nodeType: u,
|
|
73
84
|
activityType: p,
|
|
74
85
|
inClass: c,
|
|
75
|
-
...
|
|
86
|
+
...b
|
|
76
87
|
};
|
|
77
88
|
}
|
|
78
89
|
return null;
|
|
@@ -82,13 +93,13 @@ const M = P(
|
|
|
82
93
|
message: E ?? "Error loading worksheet"
|
|
83
94
|
});
|
|
84
95
|
}, [o, E, t, n]), l(() => {
|
|
85
|
-
|
|
86
|
-
}, [
|
|
96
|
+
s && o === "success" && t && (r.current(x.WORKSHEET_V3_READY), t());
|
|
97
|
+
}, [s, o, r, t]), l(() => {
|
|
87
98
|
e != null && e.responses && m && m(e.responses ?? {});
|
|
88
|
-
}, [e == null ? void 0 : e.responses, m]), o === "success" && e &&
|
|
99
|
+
}, [e == null ? void 0 : e.responses, m]), o === "success" && e && s && y ? /* @__PURE__ */ f(j, { ...y, children: /* @__PURE__ */ f(V, { userType: i, renderAs: "canvas", children: /* @__PURE__ */ f(K, { ref: S }) }) }) : null;
|
|
89
100
|
})
|
|
90
|
-
),
|
|
101
|
+
), Z = M;
|
|
91
102
|
export {
|
|
92
|
-
|
|
103
|
+
Z as default
|
|
93
104
|
};
|
|
94
105
|
//# sourceMappingURL=worksheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worksheet.js","sources":["../../../../src/features/worksheet/worksheet/worksheet.tsx"],"sourcesContent":["import { forwardRef, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport CueCanvasProvider from '../../cue-canvas/cue-canvas-provider';\nimport EVENTS from '../constants/events';\nimport useLearnosity from './hooks/use-learnosity';\nimport useWorksheetDataHelper from './hooks/use-worksheet-data-helper';\nimport { getWorksheetBehaviour } from './worksheet-behavior-helper';\nimport WorksheetProvider from './worksheet-provider';\nimport type {\n ILearnosityError,\n IWorksheetProps,\n IWorksheetRef,\n TWorksheetStoreProps,\n} from './worksheet-types';\nimport WorksheetView from './worksheet-view';\n\nconst Worksheet = memo(\n forwardRef<IWorksheetRef, IWorksheetProps>((props, ref) => {\n const {\n attemptId,\n itemsSignedRequest,\n questionsSignedRequest,\n onLoaded,\n onErrored,\n onResponsesLoaded,\n loggerRef,\n userType,\n worksheetCompleted,\n inClass,\n nodeType,\n mode,\n activityType,\n isDesmosEnabled = false,\n studentName,\n canShowActionBar,\n ...otherProps\n } = props;\n\n const worksheetBehavior = useMemo(\n () =>\n getWorksheetBehaviour({\n nodeType,\n inClass,\n activityType,\n isDesmosEnabled,\n mode,\n userType,\n worksheetCompleted,\n }),\n [nodeType
|
|
1
|
+
{"version":3,"file":"worksheet.js","sources":["../../../../src/features/worksheet/worksheet/worksheet.tsx"],"sourcesContent":["import { forwardRef, memo, useCallback, useEffect, useMemo } from 'react';\n\nimport CueCanvasProvider from '../../cue-canvas/cue-canvas-provider';\nimport EVENTS from '../constants/events';\nimport useLearnosity from './hooks/use-learnosity';\nimport useWorksheetDataHelper from './hooks/use-worksheet-data-helper';\nimport { getWorksheetBehaviour } from './worksheet-behavior-helper';\nimport WorksheetProvider from './worksheet-provider';\nimport type {\n ILearnosityError,\n IWorksheetProps,\n IWorksheetRef,\n TWorksheetStoreProps,\n} from './worksheet-types';\nimport WorksheetView from './worksheet-view';\n\nconst Worksheet = memo(\n forwardRef<IWorksheetRef, IWorksheetProps>((props, ref) => {\n const {\n attemptId,\n itemsSignedRequest,\n questionsSignedRequest,\n onLoaded,\n onErrored,\n onResponsesLoaded,\n loggerRef,\n userType,\n worksheetCompleted,\n inClass,\n nodeType,\n mode,\n activityType,\n isDesmosEnabled = false,\n studentName,\n canShowActionBar,\n behaviorOverride,\n ...otherProps\n } = props;\n\n const worksheetBehavior = useMemo(\n () =>\n getWorksheetBehaviour({\n nodeType,\n inClass,\n activityType,\n isDesmosEnabled,\n mode,\n userType,\n worksheetCompleted,\n behaviorOverride,\n }),\n [\n nodeType,\n inClass,\n activityType,\n isDesmosEnabled,\n mode,\n userType,\n worksheetCompleted,\n behaviorOverride,\n ],\n );\n\n const { loadingState, data, error } = useWorksheetDataHelper({\n attemptId,\n signedRequest: itemsSignedRequest,\n loggerRef,\n });\n\n const onLearnosityErrored = useCallback(\n (err: ILearnosityError) => {\n onErrored({\n code: err.code,\n message: err.detail,\n });\n },\n [onErrored],\n );\n\n const { learnosity, appendedQuestionIds } = useLearnosity(\n questionsSignedRequest,\n onLearnosityErrored,\n loggerRef,\n );\n\n const worksheetStoreProps: TWorksheetStoreProps | null = (() => {\n if (loadingState === 'success' && data && learnosity) {\n const { learnosityItems, responses } = data;\n\n return {\n learnosityItems,\n learnosityResponses: responses,\n behavior: worksheetBehavior,\n studentName: studentName ?? 'Student',\n canShowActionBar: canShowActionBar ?? true,\n userType,\n questionsSignedRequest,\n worksheetCompleted,\n learnosity,\n loggerRef,\n appendedQuestionIds,\n nodeType,\n activityType,\n inClass,\n ...otherProps,\n };\n }\n\n return null;\n })();\n\n useEffect(() => {\n if (loadingState === 'error') {\n onErrored({\n message: error ?? 'Error loading worksheet',\n });\n }\n }, [loadingState, error, onLoaded, onErrored]);\n\n useEffect(() => {\n if (learnosity && loadingState === 'success' && onLoaded) {\n loggerRef.current(EVENTS.WORKSHEET_V3_READY);\n onLoaded();\n }\n }, [learnosity, loadingState, loggerRef, onLoaded]);\n\n useEffect(() => {\n if (data?.responses && onResponsesLoaded) {\n onResponsesLoaded(data.responses ?? {});\n }\n }, [data?.responses, onResponsesLoaded]);\n\n if (loadingState === 'success' && data && learnosity && worksheetStoreProps) {\n return (\n <WorksheetProvider {...worksheetStoreProps}>\n <CueCanvasProvider userType={userType} renderAs=\"canvas\">\n <WorksheetView ref={ref} />\n </CueCanvasProvider>\n </WorksheetProvider>\n );\n }\n\n return null;\n }),\n);\n\nexport default Worksheet;\n"],"names":["Worksheet","memo","forwardRef","props","ref","attemptId","itemsSignedRequest","questionsSignedRequest","onLoaded","onErrored","onResponsesLoaded","loggerRef","userType","worksheetCompleted","inClass","nodeType","mode","activityType","isDesmosEnabled","studentName","canShowActionBar","behaviorOverride","otherProps","worksheetBehavior","useMemo","getWorksheetBehaviour","loadingState","data","error","useWorksheetDataHelper","onLearnosityErrored","useCallback","err","learnosity","appendedQuestionIds","useLearnosity","worksheetStoreProps","learnosityItems","responses","useEffect","EVENTS","jsx","WorksheetProvider","CueCanvasProvider","WorksheetView","Worksheet$1"],"mappings":"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"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { QUESTIONS_GAP as
|
|
3
|
-
const
|
|
1
|
+
import { useMemo as A } from "react";
|
|
2
|
+
import { QUESTIONS_GAP as N, WORKSHEET_NUDGE_BANNER_HEIGHT as D, TOP_NAVIGATION_HEIGHT as h } from "../../worksheet/constants.js";
|
|
3
|
+
const C = ({
|
|
4
4
|
userType: c,
|
|
5
5
|
nodeType: t,
|
|
6
6
|
isSATAssessment: o,
|
|
7
|
-
showNudgeBanner:
|
|
8
|
-
topOffset:
|
|
9
|
-
imageHue: n
|
|
7
|
+
showNudgeBanner: L,
|
|
8
|
+
topOffset: r,
|
|
9
|
+
imageHue: n,
|
|
10
|
+
layoutOverride: E = {}
|
|
10
11
|
}) => {
|
|
11
|
-
const
|
|
12
|
+
const a = t === "PUZZLE_CARD", I = A(() => {
|
|
12
13
|
if (o) return "bottom";
|
|
13
14
|
switch (t) {
|
|
14
15
|
case "PUZZLE_CARD":
|
|
@@ -20,39 +21,41 @@ const e = ({
|
|
|
20
21
|
default:
|
|
21
22
|
return "top";
|
|
22
23
|
}
|
|
23
|
-
}, [o, t]),
|
|
24
|
-
return
|
|
24
|
+
}, [o, t]), R = I === "top" ? h : 0, _ = `calc(100vh - ${r + R}px)`, u = `calc(100vh - ${r + R}px)`, i = L ? r + D : r;
|
|
25
|
+
return A(
|
|
25
26
|
() => ({
|
|
26
|
-
containerStyle: o ||
|
|
27
|
+
containerStyle: o || a ? "none" : "card",
|
|
27
28
|
//* The width of the container is set based on the user type and whether it is a SAT assessment
|
|
28
29
|
//* For Puzzle sheets, on student side we are showing a header with 800px fixed width.
|
|
29
30
|
containerWidth: o ? "1024px" : c === "TEACHER" ? "100%" : "800px",
|
|
30
31
|
actionBar: "bottom",
|
|
31
|
-
topOffset:
|
|
32
|
+
topOffset: i,
|
|
32
33
|
navigationBar: I,
|
|
33
34
|
questionsScrollable: !(o || t === "TRIAL_DIAGNOSTIC" || t === "TRIAL_BASIC" || t === "TRIAL_INTERMEDIATE" || t === "TRIAL_ADVANCED"),
|
|
34
|
-
minQuestionHeight:
|
|
35
|
-
minSummaryHeight:
|
|
35
|
+
minQuestionHeight: _,
|
|
36
|
+
minSummaryHeight: u,
|
|
36
37
|
renderSideBar: c === "TEACHER" && !o,
|
|
37
|
-
renderQuestionHeader: !
|
|
38
|
+
renderQuestionHeader: !a,
|
|
38
39
|
imageHue: n,
|
|
39
|
-
background: o ||
|
|
40
|
-
questionPadding:
|
|
40
|
+
background: o || a ? "none" : "paper",
|
|
41
|
+
questionPadding: a ? 0 : N,
|
|
42
|
+
...E
|
|
41
43
|
}),
|
|
42
44
|
[
|
|
43
45
|
o,
|
|
44
|
-
|
|
46
|
+
a,
|
|
45
47
|
c,
|
|
46
|
-
|
|
48
|
+
i,
|
|
47
49
|
I,
|
|
48
50
|
t,
|
|
49
|
-
R,
|
|
50
51
|
_,
|
|
51
|
-
|
|
52
|
+
u,
|
|
53
|
+
n,
|
|
54
|
+
E
|
|
52
55
|
]
|
|
53
56
|
);
|
|
54
|
-
},
|
|
57
|
+
}, l = C;
|
|
55
58
|
export {
|
|
56
|
-
|
|
59
|
+
l as default
|
|
57
60
|
};
|
|
58
61
|
//# sourceMappingURL=use-worksheet-layout.js.map
|