catchup-library-web 2.1.2 → 2.1.4
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/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +26 -45
- package/dist/index.mjs +26 -45
- package/package.json +1 -1
- package/src/components/activities/ActivityPreviewByData.tsx +128 -128
- package/src/utilization/CatchtivityUtilization.ts +43 -39
package/dist/index.d.mts
CHANGED
|
@@ -596,7 +596,7 @@ declare const convertToBodyMapString: (type: string, bodyMap: any) => any;
|
|
|
596
596
|
declare const convertToSolutionMapString: (type: string, solutionMap: any) => any;
|
|
597
597
|
declare const convertToEvaluationRubricMapString: (type: string, evaluationRubricMap: any) => any;
|
|
598
598
|
declare const constructActivityData: (activityTemplateType: string, contentMap: any, bodyMap: any, materialMap: any, solutionMap: any, difficulty: string, evaluationRubricMap: any) => any;
|
|
599
|
-
declare const constructAnswerBasedOnData: (data: any) => any;
|
|
599
|
+
declare const constructAnswerBasedOnData: (type: string, data: any) => any;
|
|
600
600
|
declare const constructActivityItemListBodyOnly: (bodyMap: any) => any;
|
|
601
601
|
declare const constructActivityItemListMaterialOnly: (materialMap: any, type: string) => {
|
|
602
602
|
type: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -596,7 +596,7 @@ declare const convertToBodyMapString: (type: string, bodyMap: any) => any;
|
|
|
596
596
|
declare const convertToSolutionMapString: (type: string, solutionMap: any) => any;
|
|
597
597
|
declare const convertToEvaluationRubricMapString: (type: string, evaluationRubricMap: any) => any;
|
|
598
598
|
declare const constructActivityData: (activityTemplateType: string, contentMap: any, bodyMap: any, materialMap: any, solutionMap: any, difficulty: string, evaluationRubricMap: any) => any;
|
|
599
|
-
declare const constructAnswerBasedOnData: (data: any) => any;
|
|
599
|
+
declare const constructAnswerBasedOnData: (type: string, data: any) => any;
|
|
600
600
|
declare const constructActivityItemListBodyOnly: (bodyMap: any) => any;
|
|
601
601
|
declare const constructActivityItemListMaterialOnly: (materialMap: any, type: string) => {
|
|
602
602
|
type: string;
|
package/dist/index.js
CHANGED
|
@@ -2979,56 +2979,35 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2979
2979
|
}
|
|
2980
2980
|
return constructedData;
|
|
2981
2981
|
};
|
|
2982
|
-
var constructAnswerBasedOnData = (data) => {
|
|
2983
|
-
if (Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2984
|
-
return constructActivityAnswerMap(
|
|
2985
|
-
"ORDERING",
|
|
2986
|
-
JSON.parse(JSON.stringify(data))
|
|
2987
|
-
);
|
|
2982
|
+
var constructAnswerBasedOnData = (type, data) => {
|
|
2983
|
+
if (type === "ORDERING" && Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2984
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2988
2985
|
}
|
|
2989
|
-
if (Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2990
|
-
return constructActivityAnswerMap(
|
|
2991
|
-
"DROPDOWN",
|
|
2992
|
-
JSON.parse(JSON.stringify(data))
|
|
2993
|
-
);
|
|
2986
|
+
if (type === "DROPDOWN" && Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2987
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2994
2988
|
}
|
|
2995
|
-
if (Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2996
|
-
return constructActivityAnswerMap(
|
|
2989
|
+
if (type === "MCSA" && Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2990
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2997
2991
|
}
|
|
2998
|
-
if (Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2999
|
-
return constructActivityAnswerMap(
|
|
2992
|
+
if (type === "MCMA" && Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2993
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3000
2994
|
}
|
|
3001
|
-
if (Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
3002
|
-
return constructActivityAnswerMap(
|
|
3003
|
-
"MATCHING",
|
|
3004
|
-
JSON.parse(JSON.stringify(data))
|
|
3005
|
-
);
|
|
2995
|
+
if (type === "MATCHING" && Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
2996
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3006
2997
|
}
|
|
3007
|
-
if (Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
3008
|
-
return constructActivityAnswerMap(
|
|
3009
|
-
"GROUPING",
|
|
3010
|
-
JSON.parse(JSON.stringify(data))
|
|
3011
|
-
);
|
|
2998
|
+
if (type === "GROUPING" && Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
2999
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3012
3000
|
}
|
|
3013
|
-
if (Object.keys(data).find(
|
|
3001
|
+
if (type === "FILL_IN_THE_BLANKS" && Object.keys(data).find(
|
|
3014
3002
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
3015
3003
|
)) {
|
|
3016
|
-
return constructActivityAnswerMap(
|
|
3017
|
-
"FILL_IN_THE_BLANKS",
|
|
3018
|
-
JSON.parse(JSON.stringify(data))
|
|
3019
|
-
);
|
|
3004
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3020
3005
|
}
|
|
3021
|
-
if (Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
3022
|
-
return constructActivityAnswerMap(
|
|
3023
|
-
"OPEN_ENDED",
|
|
3024
|
-
JSON.parse(JSON.stringify(data))
|
|
3025
|
-
);
|
|
3006
|
+
if (type === "OPEN_ENDED" && Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
3007
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3026
3008
|
}
|
|
3027
|
-
if (Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
3028
|
-
return constructActivityAnswerMap(
|
|
3029
|
-
"TRUE_FALSE",
|
|
3030
|
-
JSON.parse(JSON.stringify(data))
|
|
3031
|
-
);
|
|
3009
|
+
if (type === "TRUE_FALSE" && Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
3010
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3032
3011
|
}
|
|
3033
3012
|
return {};
|
|
3034
3013
|
};
|
|
@@ -7281,7 +7260,9 @@ var ActivityPreviewByData = ({
|
|
|
7281
7260
|
}
|
|
7282
7261
|
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
7283
7262
|
if (!data) return;
|
|
7284
|
-
|
|
7263
|
+
if (!selectedType) return;
|
|
7264
|
+
const answerMap = constructAnswerBasedOnData(selectedType, data);
|
|
7265
|
+
console.log("answer map: ", answerMap);
|
|
7285
7266
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
|
|
7286
7267
|
showType ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
7287
7268
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mb-4", children: [
|
|
@@ -7299,7 +7280,7 @@ var ActivityPreviewByData = ({
|
|
|
7299
7280
|
] }),
|
|
7300
7281
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DividerLine_default, {})
|
|
7301
7282
|
] }) : null,
|
|
7302
|
-
|
|
7283
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "", children: selectedType === "ORDERING" && data["orderingBodyMap"] != null && data["orderingMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7303
7284
|
OrderingActivityContent_default,
|
|
7304
7285
|
{
|
|
7305
7286
|
answerMap,
|
|
@@ -7420,15 +7401,15 @@ var ActivityPreviewByData = ({
|
|
|
7420
7401
|
showCorrectAnswer: true,
|
|
7421
7402
|
isFullScreen
|
|
7422
7403
|
}
|
|
7423
|
-
) : null }, selectedType)
|
|
7424
|
-
|
|
7404
|
+
) : null }, selectedType),
|
|
7405
|
+
showSolution ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "my-4", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7425
7406
|
ActivitySolutionContent_default,
|
|
7426
7407
|
{
|
|
7427
7408
|
activityTemplateType: selectedType,
|
|
7428
7409
|
data
|
|
7429
7410
|
}
|
|
7430
7411
|
) }) : null,
|
|
7431
|
-
|
|
7412
|
+
showEvaluationRubric ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "my-4", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7432
7413
|
ActivityEvaluationRubricContent_default,
|
|
7433
7414
|
{
|
|
7434
7415
|
activityTemplateType: selectedType,
|
package/dist/index.mjs
CHANGED
|
@@ -2755,56 +2755,35 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2755
2755
|
}
|
|
2756
2756
|
return constructedData;
|
|
2757
2757
|
};
|
|
2758
|
-
var constructAnswerBasedOnData = (data) => {
|
|
2759
|
-
if (Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2760
|
-
return constructActivityAnswerMap(
|
|
2761
|
-
"ORDERING",
|
|
2762
|
-
JSON.parse(JSON.stringify(data))
|
|
2763
|
-
);
|
|
2758
|
+
var constructAnswerBasedOnData = (type, data) => {
|
|
2759
|
+
if (type === "ORDERING" && Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2760
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2764
2761
|
}
|
|
2765
|
-
if (Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2766
|
-
return constructActivityAnswerMap(
|
|
2767
|
-
"DROPDOWN",
|
|
2768
|
-
JSON.parse(JSON.stringify(data))
|
|
2769
|
-
);
|
|
2762
|
+
if (type === "DROPDOWN" && Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2763
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2770
2764
|
}
|
|
2771
|
-
if (Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2772
|
-
return constructActivityAnswerMap(
|
|
2765
|
+
if (type === "MCSA" && Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2766
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2773
2767
|
}
|
|
2774
|
-
if (Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2775
|
-
return constructActivityAnswerMap(
|
|
2768
|
+
if (type === "MCMA" && Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2769
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2776
2770
|
}
|
|
2777
|
-
if (Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
2778
|
-
return constructActivityAnswerMap(
|
|
2779
|
-
"MATCHING",
|
|
2780
|
-
JSON.parse(JSON.stringify(data))
|
|
2781
|
-
);
|
|
2771
|
+
if (type === "MATCHING" && Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
2772
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2782
2773
|
}
|
|
2783
|
-
if (Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
2784
|
-
return constructActivityAnswerMap(
|
|
2785
|
-
"GROUPING",
|
|
2786
|
-
JSON.parse(JSON.stringify(data))
|
|
2787
|
-
);
|
|
2774
|
+
if (type === "GROUPING" && Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
2775
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2788
2776
|
}
|
|
2789
|
-
if (Object.keys(data).find(
|
|
2777
|
+
if (type === "FILL_IN_THE_BLANKS" && Object.keys(data).find(
|
|
2790
2778
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
2791
2779
|
)) {
|
|
2792
|
-
return constructActivityAnswerMap(
|
|
2793
|
-
"FILL_IN_THE_BLANKS",
|
|
2794
|
-
JSON.parse(JSON.stringify(data))
|
|
2795
|
-
);
|
|
2780
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2796
2781
|
}
|
|
2797
|
-
if (Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
2798
|
-
return constructActivityAnswerMap(
|
|
2799
|
-
"OPEN_ENDED",
|
|
2800
|
-
JSON.parse(JSON.stringify(data))
|
|
2801
|
-
);
|
|
2782
|
+
if (type === "OPEN_ENDED" && Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
2783
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2802
2784
|
}
|
|
2803
|
-
if (Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
2804
|
-
return constructActivityAnswerMap(
|
|
2805
|
-
"TRUE_FALSE",
|
|
2806
|
-
JSON.parse(JSON.stringify(data))
|
|
2807
|
-
);
|
|
2785
|
+
if (type === "TRUE_FALSE" && Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
2786
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2808
2787
|
}
|
|
2809
2788
|
return {};
|
|
2810
2789
|
};
|
|
@@ -7057,7 +7036,9 @@ var ActivityPreviewByData = ({
|
|
|
7057
7036
|
}
|
|
7058
7037
|
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
7059
7038
|
if (!data) return;
|
|
7060
|
-
|
|
7039
|
+
if (!selectedType) return;
|
|
7040
|
+
const answerMap = constructAnswerBasedOnData(selectedType, data);
|
|
7041
|
+
console.log("answer map: ", answerMap);
|
|
7061
7042
|
return /* @__PURE__ */ jsxs36("div", { children: [
|
|
7062
7043
|
showType ? /* @__PURE__ */ jsxs36(Fragment11, { children: [
|
|
7063
7044
|
/* @__PURE__ */ jsxs36("div", { className: "mb-4", children: [
|
|
@@ -7075,7 +7056,7 @@ var ActivityPreviewByData = ({
|
|
|
7075
7056
|
] }),
|
|
7076
7057
|
/* @__PURE__ */ jsx47(DividerLine_default, {})
|
|
7077
7058
|
] }) : null,
|
|
7078
|
-
|
|
7059
|
+
/* @__PURE__ */ jsx47("div", { className: "", children: selectedType === "ORDERING" && data["orderingBodyMap"] != null && data["orderingMaterialMap"] != null ? /* @__PURE__ */ jsx47(
|
|
7079
7060
|
OrderingActivityContent_default,
|
|
7080
7061
|
{
|
|
7081
7062
|
answerMap,
|
|
@@ -7196,15 +7177,15 @@ var ActivityPreviewByData = ({
|
|
|
7196
7177
|
showCorrectAnswer: true,
|
|
7197
7178
|
isFullScreen
|
|
7198
7179
|
}
|
|
7199
|
-
) : null }, selectedType)
|
|
7200
|
-
|
|
7180
|
+
) : null }, selectedType),
|
|
7181
|
+
showSolution ? /* @__PURE__ */ jsx47("div", { className: "my-4", children: /* @__PURE__ */ jsx47(
|
|
7201
7182
|
ActivitySolutionContent_default,
|
|
7202
7183
|
{
|
|
7203
7184
|
activityTemplateType: selectedType,
|
|
7204
7185
|
data
|
|
7205
7186
|
}
|
|
7206
7187
|
) }) : null,
|
|
7207
|
-
|
|
7188
|
+
showEvaluationRubric ? /* @__PURE__ */ jsx47("div", { className: "my-4", children: /* @__PURE__ */ jsx47(
|
|
7208
7189
|
ActivityEvaluationRubricContent_default,
|
|
7209
7190
|
{
|
|
7210
7191
|
activityTemplateType: selectedType,
|
package/package.json
CHANGED
|
@@ -80,7 +80,9 @@ const ActivityPreviewByData = ({
|
|
|
80
80
|
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
81
81
|
|
|
82
82
|
if (!data) return;
|
|
83
|
-
|
|
83
|
+
if (!selectedType) return;
|
|
84
|
+
const answerMap = constructAnswerBasedOnData(selectedType, data);
|
|
85
|
+
console.log("answer map: ", answerMap);
|
|
84
86
|
|
|
85
87
|
return (
|
|
86
88
|
<div key={key}>
|
|
@@ -106,132 +108,130 @@ const ActivityPreviewByData = ({
|
|
|
106
108
|
<DividerLine />
|
|
107
109
|
</>
|
|
108
110
|
) : null}
|
|
109
|
-
{selectedType
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
) : null}
|
|
234
|
-
{selectedType && showSolution ? (
|
|
111
|
+
<div key={selectedType} className="">
|
|
112
|
+
{selectedType === "ORDERING" &&
|
|
113
|
+
data["orderingBodyMap"] != null &&
|
|
114
|
+
data["orderingMaterialMap"] != null ? (
|
|
115
|
+
<OrderingActivityContent
|
|
116
|
+
answerMap={answerMap}
|
|
117
|
+
changeAnswer={() => {}}
|
|
118
|
+
canAnswerQuestion={() => {
|
|
119
|
+
return true;
|
|
120
|
+
}}
|
|
121
|
+
data={data}
|
|
122
|
+
isPreview={true}
|
|
123
|
+
showCorrectAnswer={true}
|
|
124
|
+
/>
|
|
125
|
+
) : selectedType === "DROPDOWN" &&
|
|
126
|
+
data["dropdownBodyMap"] != null &&
|
|
127
|
+
data["dropdownMaterialMap"] != null ? (
|
|
128
|
+
<DropdownActivityContent
|
|
129
|
+
answerMap={answerMap}
|
|
130
|
+
changeAnswer={() => {}}
|
|
131
|
+
canAnswerQuestion={() => {
|
|
132
|
+
return true;
|
|
133
|
+
}}
|
|
134
|
+
data={data}
|
|
135
|
+
isPreview={true}
|
|
136
|
+
showCorrectAnswer={true}
|
|
137
|
+
isFullScreen={isFullScreen}
|
|
138
|
+
/>
|
|
139
|
+
) : selectedType === "MCSA" &&
|
|
140
|
+
data["MCSABodyMap"] != null &&
|
|
141
|
+
data["MCSAMaterialMap"] != null ? (
|
|
142
|
+
<MCSAActivityContent
|
|
143
|
+
answerMap={answerMap}
|
|
144
|
+
changeAnswer={() => {}}
|
|
145
|
+
canAnswerQuestion={() => {
|
|
146
|
+
return true;
|
|
147
|
+
}}
|
|
148
|
+
data={data}
|
|
149
|
+
isPreview={true}
|
|
150
|
+
showCorrectAnswer={true}
|
|
151
|
+
isFullScreen={isFullScreen}
|
|
152
|
+
/>
|
|
153
|
+
) : selectedType === "MCMA" &&
|
|
154
|
+
data["MCMABodyMap"] != null &&
|
|
155
|
+
data["MCMAMaterialMap"] != null ? (
|
|
156
|
+
<MCMAActivityContent
|
|
157
|
+
answerMap={answerMap}
|
|
158
|
+
changeAnswer={() => {}}
|
|
159
|
+
canAnswerQuestion={() => {
|
|
160
|
+
return true;
|
|
161
|
+
}}
|
|
162
|
+
data={data}
|
|
163
|
+
isPreview={true}
|
|
164
|
+
showCorrectAnswer={true}
|
|
165
|
+
isFullScreen={isFullScreen}
|
|
166
|
+
/>
|
|
167
|
+
) : selectedType === "MATCHING" &&
|
|
168
|
+
data["matchingBodyMap"] != null &&
|
|
169
|
+
data["matchingMaterialMap"] != null ? (
|
|
170
|
+
<MatchingActivityContent
|
|
171
|
+
answerMap={answerMap}
|
|
172
|
+
changeAnswer={() => {}}
|
|
173
|
+
canAnswerQuestion={() => {
|
|
174
|
+
return true;
|
|
175
|
+
}}
|
|
176
|
+
data={data}
|
|
177
|
+
isPreview={true}
|
|
178
|
+
showCorrectAnswer={true}
|
|
179
|
+
/>
|
|
180
|
+
) : selectedType === "GROUPING" &&
|
|
181
|
+
data["groupingBodyMap"] != null &&
|
|
182
|
+
data["groupingMaterialMap"] != null ? (
|
|
183
|
+
<GroupingActivityContent
|
|
184
|
+
answerMap={answerMap}
|
|
185
|
+
changeAnswer={() => {}}
|
|
186
|
+
canAnswerQuestion={() => {
|
|
187
|
+
return true;
|
|
188
|
+
}}
|
|
189
|
+
data={data}
|
|
190
|
+
isPreview={true}
|
|
191
|
+
showCorrectAnswer={true}
|
|
192
|
+
/>
|
|
193
|
+
) : selectedType === "FILL_IN_THE_BLANKS" &&
|
|
194
|
+
data["fillInTheBlanksBodyMap"] != null &&
|
|
195
|
+
data["fillInTheBlanksMaterialMap"] != null ? (
|
|
196
|
+
<FillInTheBlanksActivityContent
|
|
197
|
+
answerMap={answerMap}
|
|
198
|
+
changeAnswer={() => {}}
|
|
199
|
+
canAnswerQuestion={() => {
|
|
200
|
+
return true;
|
|
201
|
+
}}
|
|
202
|
+
data={data}
|
|
203
|
+
isPreview={true}
|
|
204
|
+
showCorrectAnswer={true}
|
|
205
|
+
isFullScreen={isFullScreen}
|
|
206
|
+
/>
|
|
207
|
+
) : selectedType === "OPEN_ENDED" &&
|
|
208
|
+
data["openEndedBodyMap"] != null ? (
|
|
209
|
+
<OpenEndedActivityContent
|
|
210
|
+
answerMap={answerMap}
|
|
211
|
+
canAnswerQuestion={() => false}
|
|
212
|
+
changeAnswer={() => {}}
|
|
213
|
+
showMaterialContent={true}
|
|
214
|
+
data={data}
|
|
215
|
+
isPreview={true}
|
|
216
|
+
isFullScreen={isFullScreen}
|
|
217
|
+
/>
|
|
218
|
+
) : selectedType === "TRUE_FALSE" &&
|
|
219
|
+
data["trueFalseBodyMap"] != null &&
|
|
220
|
+
data["trueFalseMaterialMap"] != null ? (
|
|
221
|
+
<TrueFalseActivityContent
|
|
222
|
+
answerMap={answerMap}
|
|
223
|
+
changeAnswer={() => {}}
|
|
224
|
+
canAnswerQuestion={() => {
|
|
225
|
+
return true;
|
|
226
|
+
}}
|
|
227
|
+
data={data}
|
|
228
|
+
isPreview={true}
|
|
229
|
+
showCorrectAnswer={true}
|
|
230
|
+
isFullScreen={isFullScreen}
|
|
231
|
+
/>
|
|
232
|
+
) : null}
|
|
233
|
+
</div>
|
|
234
|
+
{showSolution ? (
|
|
235
235
|
<div className="my-4">
|
|
236
236
|
<ActivitySolutionContent
|
|
237
237
|
activityTemplateType={selectedType}
|
|
@@ -239,7 +239,7 @@ const ActivityPreviewByData = ({
|
|
|
239
239
|
/>
|
|
240
240
|
</div>
|
|
241
241
|
) : null}
|
|
242
|
-
{
|
|
242
|
+
{showEvaluationRubric ? (
|
|
243
243
|
<div className="my-4">
|
|
244
244
|
<ActivityEvaluationRubricContent
|
|
245
245
|
activityTemplateType={selectedType}
|
|
@@ -1928,58 +1928,62 @@ export const constructActivityData = (
|
|
|
1928
1928
|
return constructedData;
|
|
1929
1929
|
};
|
|
1930
1930
|
|
|
1931
|
-
export const constructAnswerBasedOnData = (data: any) => {
|
|
1932
|
-
if (
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
);
|
|
1931
|
+
export const constructAnswerBasedOnData = (type: string, data: any) => {
|
|
1932
|
+
if (
|
|
1933
|
+
type === "ORDERING" &&
|
|
1934
|
+
Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")
|
|
1935
|
+
) {
|
|
1936
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1937
1937
|
}
|
|
1938
|
-
if (
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
);
|
|
1938
|
+
if (
|
|
1939
|
+
type === "DROPDOWN" &&
|
|
1940
|
+
Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")
|
|
1941
|
+
) {
|
|
1942
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1943
1943
|
}
|
|
1944
|
-
if (
|
|
1945
|
-
|
|
1944
|
+
if (
|
|
1945
|
+
type === "MCSA" &&
|
|
1946
|
+
Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")
|
|
1947
|
+
) {
|
|
1948
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1946
1949
|
}
|
|
1947
|
-
if (
|
|
1948
|
-
|
|
1950
|
+
if (
|
|
1951
|
+
type === "MCMA" &&
|
|
1952
|
+
Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")
|
|
1953
|
+
) {
|
|
1954
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1949
1955
|
}
|
|
1950
|
-
if (
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
);
|
|
1956
|
+
if (
|
|
1957
|
+
type === "MATCHING" &&
|
|
1958
|
+
Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")
|
|
1959
|
+
) {
|
|
1960
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1955
1961
|
}
|
|
1956
|
-
if (
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
);
|
|
1962
|
+
if (
|
|
1963
|
+
type === "GROUPING" &&
|
|
1964
|
+
Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")
|
|
1965
|
+
) {
|
|
1966
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1961
1967
|
}
|
|
1962
1968
|
if (
|
|
1969
|
+
type === "FILL_IN_THE_BLANKS" &&
|
|
1963
1970
|
Object.keys(data).find(
|
|
1964
1971
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
1965
1972
|
)
|
|
1966
1973
|
) {
|
|
1967
|
-
return constructActivityAnswerMap(
|
|
1968
|
-
"FILL_IN_THE_BLANKS",
|
|
1969
|
-
JSON.parse(JSON.stringify(data))
|
|
1970
|
-
);
|
|
1974
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1971
1975
|
}
|
|
1972
|
-
if (
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
);
|
|
1976
|
+
if (
|
|
1977
|
+
type === "OPEN_ENDED" &&
|
|
1978
|
+
Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")
|
|
1979
|
+
) {
|
|
1980
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1977
1981
|
}
|
|
1978
|
-
if (
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
);
|
|
1982
|
+
if (
|
|
1983
|
+
type === "TRUE_FALSE" &&
|
|
1984
|
+
Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")
|
|
1985
|
+
) {
|
|
1986
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1983
1987
|
}
|
|
1984
1988
|
return {};
|
|
1985
1989
|
};
|