catchup-library-web 2.0.18 → 2.0.20
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +24 -32
- package/dist/index.mjs +24 -32
- package/package.json +1 -1
- package/src/components/activities/ActivityPreviewByAnswerData.tsx +5 -7
- package/src/properties/ActivityProperties.ts +1 -2
- package/src/utilization/CatchtivityUtilization.ts +19 -27
package/dist/index.d.mts
CHANGED
|
@@ -231,7 +231,7 @@ interface IActivityPreviewByAnswerDataProps {
|
|
|
231
231
|
answerType?: string | null;
|
|
232
232
|
showType?: boolean;
|
|
233
233
|
showDescription?: boolean;
|
|
234
|
-
|
|
234
|
+
typeList?: any[];
|
|
235
235
|
showSolution?: boolean;
|
|
236
236
|
showEvaluationRubric?: boolean;
|
|
237
237
|
showDifficulty?: boolean;
|
|
@@ -265,7 +265,7 @@ declare const ActivityEvaluationRubricContent: ({ activityTemplateType, data, }:
|
|
|
265
265
|
|
|
266
266
|
declare const ActivityPreviewByData: ({ data, showType, showDescription, lockedType, typeOptionList, showSolution, showEvaluationRubric, showDifficulty, isFullScreen, }: IActivityPreviewByDataProps) => react_jsx_runtime.JSX.Element | undefined;
|
|
267
267
|
|
|
268
|
-
declare const ActivityPreviewByAnswerData: ({ data, answerType, showType, showDescription,
|
|
268
|
+
declare const ActivityPreviewByAnswerData: ({ data, answerType, showType, showDescription, typeList, showSolution, showEvaluationRubric, showDifficulty, isFullScreen, showCorrectAnswer, }: IActivityPreviewByAnswerDataProps) => react_jsx_runtime.JSX.Element | null;
|
|
269
269
|
|
|
270
270
|
interface IStatusErrorProperties {
|
|
271
271
|
statusCode?: string;
|
|
@@ -564,7 +564,7 @@ declare const constructActivityItemListForSolution: (bodyMap: any, materialMap:
|
|
|
564
564
|
}[];
|
|
565
565
|
declare const retrieveActivityTemplateDTOOptionList: (activityTemplateSet: any) => any;
|
|
566
566
|
declare const retrieveCurrentDefaultDataMap: (activityTemplateType: any, activityData: any) => any;
|
|
567
|
-
declare const constructActivityAnswerMap: (
|
|
567
|
+
declare const constructActivityAnswerMap: (activityTemplateType: string, activityData: any) => any;
|
|
568
568
|
declare const ignoreMathematicalExpression: (inputText: string) => string;
|
|
569
569
|
declare const constructActivityAnswerStateList: (answerList: any[], activityList: any[]) => any;
|
|
570
570
|
declare const retrieveActivityAnswerFromAnswerList: (answerList: any[], activity: any) => any;
|
package/dist/index.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ interface IActivityPreviewByAnswerDataProps {
|
|
|
231
231
|
answerType?: string | null;
|
|
232
232
|
showType?: boolean;
|
|
233
233
|
showDescription?: boolean;
|
|
234
|
-
|
|
234
|
+
typeList?: any[];
|
|
235
235
|
showSolution?: boolean;
|
|
236
236
|
showEvaluationRubric?: boolean;
|
|
237
237
|
showDifficulty?: boolean;
|
|
@@ -265,7 +265,7 @@ declare const ActivityEvaluationRubricContent: ({ activityTemplateType, data, }:
|
|
|
265
265
|
|
|
266
266
|
declare const ActivityPreviewByData: ({ data, showType, showDescription, lockedType, typeOptionList, showSolution, showEvaluationRubric, showDifficulty, isFullScreen, }: IActivityPreviewByDataProps) => react_jsx_runtime.JSX.Element | undefined;
|
|
267
267
|
|
|
268
|
-
declare const ActivityPreviewByAnswerData: ({ data, answerType, showType, showDescription,
|
|
268
|
+
declare const ActivityPreviewByAnswerData: ({ data, answerType, showType, showDescription, typeList, showSolution, showEvaluationRubric, showDifficulty, isFullScreen, showCorrectAnswer, }: IActivityPreviewByAnswerDataProps) => react_jsx_runtime.JSX.Element | null;
|
|
269
269
|
|
|
270
270
|
interface IStatusErrorProperties {
|
|
271
271
|
statusCode?: string;
|
|
@@ -564,7 +564,7 @@ declare const constructActivityItemListForSolution: (bodyMap: any, materialMap:
|
|
|
564
564
|
}[];
|
|
565
565
|
declare const retrieveActivityTemplateDTOOptionList: (activityTemplateSet: any) => any;
|
|
566
566
|
declare const retrieveCurrentDefaultDataMap: (activityTemplateType: any, activityData: any) => any;
|
|
567
|
-
declare const constructActivityAnswerMap: (
|
|
567
|
+
declare const constructActivityAnswerMap: (activityTemplateType: string, activityData: any) => any;
|
|
568
568
|
declare const ignoreMathematicalExpression: (inputText: string) => string;
|
|
569
569
|
declare const constructActivityAnswerStateList: (answerList: any[], activityList: any[]) => any;
|
|
570
570
|
declare const retrieveActivityAnswerFromAnswerList: (answerList: any[], activity: any) => any;
|
package/dist/index.js
CHANGED
|
@@ -2373,35 +2373,34 @@ var retrieveCurrentDefaultDataMap = (activityTemplateType, activityData) => {
|
|
|
2373
2373
|
}
|
|
2374
2374
|
return {};
|
|
2375
2375
|
};
|
|
2376
|
-
var constructActivityAnswerMap = (
|
|
2377
|
-
|
|
2378
|
-
if (type === "ORDERING") {
|
|
2376
|
+
var constructActivityAnswerMap = (activityTemplateType, activityData) => {
|
|
2377
|
+
if (activityTemplateType === "ORDERING") {
|
|
2379
2378
|
return retrieveDefaultOrderingDataMap(
|
|
2380
2379
|
JSON.parse(activityData.orderingMaterialMap)
|
|
2381
2380
|
);
|
|
2382
|
-
} else if (
|
|
2381
|
+
} else if (activityTemplateType === "DROPDOWN") {
|
|
2383
2382
|
return retrieveDefaultDropdownMap(
|
|
2384
2383
|
JSON.parse(activityData.dropdownMaterialMap)
|
|
2385
2384
|
);
|
|
2386
|
-
} else if (
|
|
2385
|
+
} else if (activityTemplateType === "MCSA") {
|
|
2387
2386
|
return retrieveDefaultMCSAMap(JSON.parse(activityData.MCSAMaterialMap));
|
|
2388
|
-
} else if (
|
|
2387
|
+
} else if (activityTemplateType === "MCMA") {
|
|
2389
2388
|
return retrieveDefaultMCMAMap(JSON.parse(activityData.MCMAMaterialMap));
|
|
2390
|
-
} else if (
|
|
2389
|
+
} else if (activityTemplateType === "MATCHING") {
|
|
2391
2390
|
return retrieveDefaultMatchingMap(
|
|
2392
2391
|
JSON.parse(activityData.matchingMaterialMap)
|
|
2393
2392
|
);
|
|
2394
|
-
} else if (
|
|
2393
|
+
} else if (activityTemplateType === "GROUPING") {
|
|
2395
2394
|
return retrieveDefaultGroupingMap(
|
|
2396
2395
|
JSON.parse(activityData.groupingMaterialMap)
|
|
2397
2396
|
);
|
|
2398
|
-
} else if (
|
|
2397
|
+
} else if (activityTemplateType === "FILL_IN_THE_BLANKS") {
|
|
2399
2398
|
return retrieveDefaultFillInTheBlanksMap(
|
|
2400
2399
|
JSON.parse(activityData.fillInTheBlanksMaterialMap)
|
|
2401
2400
|
);
|
|
2402
|
-
} else if (
|
|
2401
|
+
} else if (activityTemplateType === "OPEN_ENDED") {
|
|
2403
2402
|
return retrieveDefaultOpenEndedMap();
|
|
2404
|
-
} else if (
|
|
2403
|
+
} else if (activityTemplateType === "TRUE_FALSE") {
|
|
2405
2404
|
return retrieveDefaultTrueFalseMap();
|
|
2406
2405
|
}
|
|
2407
2406
|
return {};
|
|
@@ -2969,37 +2968,31 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2969
2968
|
var constructAnswerBasedOnData = (data) => {
|
|
2970
2969
|
if (Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2971
2970
|
return constructActivityAnswerMap(
|
|
2972
|
-
|
|
2971
|
+
"ORDERING",
|
|
2973
2972
|
JSON.parse(JSON.stringify(data))
|
|
2974
2973
|
);
|
|
2975
2974
|
}
|
|
2976
2975
|
if (Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2977
2976
|
return constructActivityAnswerMap(
|
|
2978
|
-
|
|
2977
|
+
"DROPDOWN",
|
|
2979
2978
|
JSON.parse(JSON.stringify(data))
|
|
2980
2979
|
);
|
|
2981
2980
|
}
|
|
2982
2981
|
if (Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2983
|
-
return constructActivityAnswerMap(
|
|
2984
|
-
{ type: "MCSA" },
|
|
2985
|
-
JSON.parse(JSON.stringify(data))
|
|
2986
|
-
);
|
|
2982
|
+
return constructActivityAnswerMap("MCSA", JSON.parse(JSON.stringify(data)));
|
|
2987
2983
|
}
|
|
2988
2984
|
if (Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2989
|
-
return constructActivityAnswerMap(
|
|
2990
|
-
{ type: "MCMA" },
|
|
2991
|
-
JSON.parse(JSON.stringify(data))
|
|
2992
|
-
);
|
|
2985
|
+
return constructActivityAnswerMap("MCMA", JSON.parse(JSON.stringify(data)));
|
|
2993
2986
|
}
|
|
2994
2987
|
if (Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
2995
2988
|
return constructActivityAnswerMap(
|
|
2996
|
-
|
|
2989
|
+
"MATCHING",
|
|
2997
2990
|
JSON.parse(JSON.stringify(data))
|
|
2998
2991
|
);
|
|
2999
2992
|
}
|
|
3000
2993
|
if (Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
3001
2994
|
return constructActivityAnswerMap(
|
|
3002
|
-
|
|
2995
|
+
"GROUPING",
|
|
3003
2996
|
JSON.parse(JSON.stringify(data))
|
|
3004
2997
|
);
|
|
3005
2998
|
}
|
|
@@ -3007,19 +3000,19 @@ var constructAnswerBasedOnData = (data) => {
|
|
|
3007
3000
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
3008
3001
|
)) {
|
|
3009
3002
|
return constructActivityAnswerMap(
|
|
3010
|
-
|
|
3003
|
+
"FILL_IN_THE_BLANKS",
|
|
3011
3004
|
JSON.parse(JSON.stringify(data))
|
|
3012
3005
|
);
|
|
3013
3006
|
}
|
|
3014
3007
|
if (Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
3015
3008
|
return constructActivityAnswerMap(
|
|
3016
|
-
|
|
3009
|
+
"OPEN_ENDED",
|
|
3017
3010
|
JSON.parse(JSON.stringify(data))
|
|
3018
3011
|
);
|
|
3019
3012
|
}
|
|
3020
3013
|
if (Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
3021
3014
|
return constructActivityAnswerMap(
|
|
3022
|
-
|
|
3015
|
+
"TRUE_FALSE",
|
|
3023
3016
|
JSON.parse(JSON.stringify(data))
|
|
3024
3017
|
);
|
|
3025
3018
|
}
|
|
@@ -7454,7 +7447,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7454
7447
|
answerType = null,
|
|
7455
7448
|
showType = true,
|
|
7456
7449
|
showDescription = true,
|
|
7457
|
-
|
|
7450
|
+
typeList = [],
|
|
7458
7451
|
showSolution = false,
|
|
7459
7452
|
showEvaluationRubric = false,
|
|
7460
7453
|
showDifficulty = true,
|
|
@@ -7470,9 +7463,9 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7470
7463
|
let currentActivityTemplateMapList = JSON.parse(
|
|
7471
7464
|
JSON.stringify(ACTIVITY_TEMPLATE_LIST)
|
|
7472
7465
|
);
|
|
7473
|
-
if (
|
|
7466
|
+
if (typeList.length > 0) {
|
|
7474
7467
|
currentActivityTemplateMapList = currentActivityTemplateMapList.filter(
|
|
7475
|
-
(activityTemplateMap) =>
|
|
7468
|
+
(activityTemplateMap) => typeList.includes(activityTemplateMap.type)
|
|
7476
7469
|
);
|
|
7477
7470
|
}
|
|
7478
7471
|
const currentActivityTemplateTypeList = [];
|
|
@@ -7482,7 +7475,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7482
7475
|
}
|
|
7483
7476
|
}
|
|
7484
7477
|
setActivityTemplateTypeList(currentActivityTemplateMapList);
|
|
7485
|
-
}, [data, answerType,
|
|
7478
|
+
}, [data, answerType, typeList]);
|
|
7486
7479
|
(0, import_react26.useEffect)(() => {
|
|
7487
7480
|
if (activityTemplateTypeList.length === 0) return;
|
|
7488
7481
|
const currentOptionList = [];
|
|
@@ -7511,12 +7504,11 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7511
7504
|
if (activityTemplateTypeList.length === 0) return;
|
|
7512
7505
|
const currentAnswerMapMap = {};
|
|
7513
7506
|
for (const activityTemplateMap of activityTemplateTypeList) {
|
|
7514
|
-
console.log(activityTemplateMap, answerType);
|
|
7515
7507
|
if (answerType === activityTemplateMap.type) {
|
|
7516
7508
|
currentAnswerMapMap[activityTemplateMap.type] = data.answerMap;
|
|
7517
7509
|
} else {
|
|
7518
7510
|
currentAnswerMapMap[activityTemplateMap.type] = constructActivityAnswerMap(
|
|
7519
|
-
|
|
7511
|
+
activityTemplateMap.type,
|
|
7520
7512
|
JSON.parse(JSON.stringify(data))
|
|
7521
7513
|
);
|
|
7522
7514
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -2151,35 +2151,34 @@ var retrieveCurrentDefaultDataMap = (activityTemplateType, activityData) => {
|
|
|
2151
2151
|
}
|
|
2152
2152
|
return {};
|
|
2153
2153
|
};
|
|
2154
|
-
var constructActivityAnswerMap = (
|
|
2155
|
-
|
|
2156
|
-
if (type === "ORDERING") {
|
|
2154
|
+
var constructActivityAnswerMap = (activityTemplateType, activityData) => {
|
|
2155
|
+
if (activityTemplateType === "ORDERING") {
|
|
2157
2156
|
return retrieveDefaultOrderingDataMap(
|
|
2158
2157
|
JSON.parse(activityData.orderingMaterialMap)
|
|
2159
2158
|
);
|
|
2160
|
-
} else if (
|
|
2159
|
+
} else if (activityTemplateType === "DROPDOWN") {
|
|
2161
2160
|
return retrieveDefaultDropdownMap(
|
|
2162
2161
|
JSON.parse(activityData.dropdownMaterialMap)
|
|
2163
2162
|
);
|
|
2164
|
-
} else if (
|
|
2163
|
+
} else if (activityTemplateType === "MCSA") {
|
|
2165
2164
|
return retrieveDefaultMCSAMap(JSON.parse(activityData.MCSAMaterialMap));
|
|
2166
|
-
} else if (
|
|
2165
|
+
} else if (activityTemplateType === "MCMA") {
|
|
2167
2166
|
return retrieveDefaultMCMAMap(JSON.parse(activityData.MCMAMaterialMap));
|
|
2168
|
-
} else if (
|
|
2167
|
+
} else if (activityTemplateType === "MATCHING") {
|
|
2169
2168
|
return retrieveDefaultMatchingMap(
|
|
2170
2169
|
JSON.parse(activityData.matchingMaterialMap)
|
|
2171
2170
|
);
|
|
2172
|
-
} else if (
|
|
2171
|
+
} else if (activityTemplateType === "GROUPING") {
|
|
2173
2172
|
return retrieveDefaultGroupingMap(
|
|
2174
2173
|
JSON.parse(activityData.groupingMaterialMap)
|
|
2175
2174
|
);
|
|
2176
|
-
} else if (
|
|
2175
|
+
} else if (activityTemplateType === "FILL_IN_THE_BLANKS") {
|
|
2177
2176
|
return retrieveDefaultFillInTheBlanksMap(
|
|
2178
2177
|
JSON.parse(activityData.fillInTheBlanksMaterialMap)
|
|
2179
2178
|
);
|
|
2180
|
-
} else if (
|
|
2179
|
+
} else if (activityTemplateType === "OPEN_ENDED") {
|
|
2181
2180
|
return retrieveDefaultOpenEndedMap();
|
|
2182
|
-
} else if (
|
|
2181
|
+
} else if (activityTemplateType === "TRUE_FALSE") {
|
|
2183
2182
|
return retrieveDefaultTrueFalseMap();
|
|
2184
2183
|
}
|
|
2185
2184
|
return {};
|
|
@@ -2747,37 +2746,31 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2747
2746
|
var constructAnswerBasedOnData = (data) => {
|
|
2748
2747
|
if (Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2749
2748
|
return constructActivityAnswerMap(
|
|
2750
|
-
|
|
2749
|
+
"ORDERING",
|
|
2751
2750
|
JSON.parse(JSON.stringify(data))
|
|
2752
2751
|
);
|
|
2753
2752
|
}
|
|
2754
2753
|
if (Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2755
2754
|
return constructActivityAnswerMap(
|
|
2756
|
-
|
|
2755
|
+
"DROPDOWN",
|
|
2757
2756
|
JSON.parse(JSON.stringify(data))
|
|
2758
2757
|
);
|
|
2759
2758
|
}
|
|
2760
2759
|
if (Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2761
|
-
return constructActivityAnswerMap(
|
|
2762
|
-
{ type: "MCSA" },
|
|
2763
|
-
JSON.parse(JSON.stringify(data))
|
|
2764
|
-
);
|
|
2760
|
+
return constructActivityAnswerMap("MCSA", JSON.parse(JSON.stringify(data)));
|
|
2765
2761
|
}
|
|
2766
2762
|
if (Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2767
|
-
return constructActivityAnswerMap(
|
|
2768
|
-
{ type: "MCMA" },
|
|
2769
|
-
JSON.parse(JSON.stringify(data))
|
|
2770
|
-
);
|
|
2763
|
+
return constructActivityAnswerMap("MCMA", JSON.parse(JSON.stringify(data)));
|
|
2771
2764
|
}
|
|
2772
2765
|
if (Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
2773
2766
|
return constructActivityAnswerMap(
|
|
2774
|
-
|
|
2767
|
+
"MATCHING",
|
|
2775
2768
|
JSON.parse(JSON.stringify(data))
|
|
2776
2769
|
);
|
|
2777
2770
|
}
|
|
2778
2771
|
if (Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
2779
2772
|
return constructActivityAnswerMap(
|
|
2780
|
-
|
|
2773
|
+
"GROUPING",
|
|
2781
2774
|
JSON.parse(JSON.stringify(data))
|
|
2782
2775
|
);
|
|
2783
2776
|
}
|
|
@@ -2785,19 +2778,19 @@ var constructAnswerBasedOnData = (data) => {
|
|
|
2785
2778
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
2786
2779
|
)) {
|
|
2787
2780
|
return constructActivityAnswerMap(
|
|
2788
|
-
|
|
2781
|
+
"FILL_IN_THE_BLANKS",
|
|
2789
2782
|
JSON.parse(JSON.stringify(data))
|
|
2790
2783
|
);
|
|
2791
2784
|
}
|
|
2792
2785
|
if (Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
2793
2786
|
return constructActivityAnswerMap(
|
|
2794
|
-
|
|
2787
|
+
"OPEN_ENDED",
|
|
2795
2788
|
JSON.parse(JSON.stringify(data))
|
|
2796
2789
|
);
|
|
2797
2790
|
}
|
|
2798
2791
|
if (Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
2799
2792
|
return constructActivityAnswerMap(
|
|
2800
|
-
|
|
2793
|
+
"TRUE_FALSE",
|
|
2801
2794
|
JSON.parse(JSON.stringify(data))
|
|
2802
2795
|
);
|
|
2803
2796
|
}
|
|
@@ -7232,7 +7225,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7232
7225
|
answerType = null,
|
|
7233
7226
|
showType = true,
|
|
7234
7227
|
showDescription = true,
|
|
7235
|
-
|
|
7228
|
+
typeList = [],
|
|
7236
7229
|
showSolution = false,
|
|
7237
7230
|
showEvaluationRubric = false,
|
|
7238
7231
|
showDifficulty = true,
|
|
@@ -7248,9 +7241,9 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7248
7241
|
let currentActivityTemplateMapList = JSON.parse(
|
|
7249
7242
|
JSON.stringify(ACTIVITY_TEMPLATE_LIST)
|
|
7250
7243
|
);
|
|
7251
|
-
if (
|
|
7244
|
+
if (typeList.length > 0) {
|
|
7252
7245
|
currentActivityTemplateMapList = currentActivityTemplateMapList.filter(
|
|
7253
|
-
(activityTemplateMap) =>
|
|
7246
|
+
(activityTemplateMap) => typeList.includes(activityTemplateMap.type)
|
|
7254
7247
|
);
|
|
7255
7248
|
}
|
|
7256
7249
|
const currentActivityTemplateTypeList = [];
|
|
@@ -7260,7 +7253,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7260
7253
|
}
|
|
7261
7254
|
}
|
|
7262
7255
|
setActivityTemplateTypeList(currentActivityTemplateMapList);
|
|
7263
|
-
}, [data, answerType,
|
|
7256
|
+
}, [data, answerType, typeList]);
|
|
7264
7257
|
useEffect16(() => {
|
|
7265
7258
|
if (activityTemplateTypeList.length === 0) return;
|
|
7266
7259
|
const currentOptionList = [];
|
|
@@ -7289,12 +7282,11 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7289
7282
|
if (activityTemplateTypeList.length === 0) return;
|
|
7290
7283
|
const currentAnswerMapMap = {};
|
|
7291
7284
|
for (const activityTemplateMap of activityTemplateTypeList) {
|
|
7292
|
-
console.log(activityTemplateMap, answerType);
|
|
7293
7285
|
if (answerType === activityTemplateMap.type) {
|
|
7294
7286
|
currentAnswerMapMap[activityTemplateMap.type] = data.answerMap;
|
|
7295
7287
|
} else {
|
|
7296
7288
|
currentAnswerMapMap[activityTemplateMap.type] = constructActivityAnswerMap(
|
|
7297
|
-
|
|
7289
|
+
activityTemplateMap.type,
|
|
7298
7290
|
JSON.parse(JSON.stringify(data))
|
|
7299
7291
|
);
|
|
7300
7292
|
}
|
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ const ActivityPreviewByAnswerData = ({
|
|
|
40
40
|
answerType = null,
|
|
41
41
|
showType = true,
|
|
42
42
|
showDescription = true,
|
|
43
|
-
|
|
43
|
+
typeList = [],
|
|
44
44
|
showSolution = false,
|
|
45
45
|
showEvaluationRubric = false,
|
|
46
46
|
showDifficulty = true,
|
|
@@ -59,10 +59,9 @@ const ActivityPreviewByAnswerData = ({
|
|
|
59
59
|
let currentActivityTemplateMapList: any[] = JSON.parse(
|
|
60
60
|
JSON.stringify(ACTIVITY_TEMPLATE_LIST)
|
|
61
61
|
);
|
|
62
|
-
if (
|
|
62
|
+
if (typeList.length > 0) {
|
|
63
63
|
currentActivityTemplateMapList = currentActivityTemplateMapList.filter(
|
|
64
|
-
(activityTemplateMap) =>
|
|
65
|
-
lockedTypeList.includes(activityTemplateMap.type)
|
|
64
|
+
(activityTemplateMap) => typeList.includes(activityTemplateMap.type)
|
|
66
65
|
);
|
|
67
66
|
}
|
|
68
67
|
const currentActivityTemplateTypeList = [];
|
|
@@ -72,7 +71,7 @@ const ActivityPreviewByAnswerData = ({
|
|
|
72
71
|
}
|
|
73
72
|
}
|
|
74
73
|
setActivityTemplateTypeList(currentActivityTemplateMapList);
|
|
75
|
-
}, [data, answerType,
|
|
74
|
+
}, [data, answerType, typeList]);
|
|
76
75
|
|
|
77
76
|
useEffect(() => {
|
|
78
77
|
if (activityTemplateTypeList.length === 0) return;
|
|
@@ -104,13 +103,12 @@ const ActivityPreviewByAnswerData = ({
|
|
|
104
103
|
if (activityTemplateTypeList.length === 0) return;
|
|
105
104
|
const currentAnswerMapMap: any = {};
|
|
106
105
|
for (const activityTemplateMap of activityTemplateTypeList) {
|
|
107
|
-
console.log(activityTemplateMap, answerType);
|
|
108
106
|
if (answerType === activityTemplateMap.type) {
|
|
109
107
|
currentAnswerMapMap[activityTemplateMap.type] = data.answerMap;
|
|
110
108
|
} else {
|
|
111
109
|
currentAnswerMapMap[activityTemplateMap.type] =
|
|
112
110
|
constructActivityAnswerMap(
|
|
113
|
-
|
|
111
|
+
activityTemplateMap.type,
|
|
114
112
|
JSON.parse(JSON.stringify(data))
|
|
115
113
|
);
|
|
116
114
|
}
|
|
@@ -235,8 +235,7 @@ export interface IActivityPreviewByAnswerDataProps {
|
|
|
235
235
|
answerType?: string | null;
|
|
236
236
|
showType?: boolean;
|
|
237
237
|
showDescription?: boolean;
|
|
238
|
-
|
|
239
|
-
// typeOptionList?: any[];
|
|
238
|
+
typeList?: any[];
|
|
240
239
|
showSolution?: boolean;
|
|
241
240
|
showEvaluationRubric?: boolean;
|
|
242
241
|
showDifficulty?: boolean;
|
|
@@ -1206,38 +1206,36 @@ export const retrieveCurrentDefaultDataMap = (
|
|
|
1206
1206
|
};
|
|
1207
1207
|
|
|
1208
1208
|
export const constructActivityAnswerMap = (
|
|
1209
|
-
|
|
1209
|
+
activityTemplateType: string,
|
|
1210
1210
|
activityData: any
|
|
1211
1211
|
) => {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
if (type === "ORDERING") {
|
|
1212
|
+
if (activityTemplateType === "ORDERING") {
|
|
1215
1213
|
return retrieveDefaultOrderingDataMap(
|
|
1216
1214
|
JSON.parse(activityData.orderingMaterialMap)
|
|
1217
1215
|
);
|
|
1218
|
-
} else if (
|
|
1216
|
+
} else if (activityTemplateType === "DROPDOWN") {
|
|
1219
1217
|
return retrieveDefaultDropdownMap(
|
|
1220
1218
|
JSON.parse(activityData.dropdownMaterialMap)
|
|
1221
1219
|
);
|
|
1222
|
-
} else if (
|
|
1220
|
+
} else if (activityTemplateType === "MCSA") {
|
|
1223
1221
|
return retrieveDefaultMCSAMap(JSON.parse(activityData.MCSAMaterialMap));
|
|
1224
|
-
} else if (
|
|
1222
|
+
} else if (activityTemplateType === "MCMA") {
|
|
1225
1223
|
return retrieveDefaultMCMAMap(JSON.parse(activityData.MCMAMaterialMap));
|
|
1226
|
-
} else if (
|
|
1224
|
+
} else if (activityTemplateType === "MATCHING") {
|
|
1227
1225
|
return retrieveDefaultMatchingMap(
|
|
1228
1226
|
JSON.parse(activityData.matchingMaterialMap)
|
|
1229
1227
|
);
|
|
1230
|
-
} else if (
|
|
1228
|
+
} else if (activityTemplateType === "GROUPING") {
|
|
1231
1229
|
return retrieveDefaultGroupingMap(
|
|
1232
1230
|
JSON.parse(activityData.groupingMaterialMap)
|
|
1233
1231
|
);
|
|
1234
|
-
} else if (
|
|
1232
|
+
} else if (activityTemplateType === "FILL_IN_THE_BLANKS") {
|
|
1235
1233
|
return retrieveDefaultFillInTheBlanksMap(
|
|
1236
1234
|
JSON.parse(activityData.fillInTheBlanksMaterialMap)
|
|
1237
1235
|
);
|
|
1238
|
-
} else if (
|
|
1236
|
+
} else if (activityTemplateType === "OPEN_ENDED") {
|
|
1239
1237
|
return retrieveDefaultOpenEndedMap();
|
|
1240
|
-
} else if (
|
|
1238
|
+
} else if (activityTemplateType === "TRUE_FALSE") {
|
|
1241
1239
|
return retrieveDefaultTrueFalseMap();
|
|
1242
1240
|
}
|
|
1243
1241
|
return {};
|
|
@@ -1919,37 +1917,31 @@ export const constructActivityData = (
|
|
|
1919
1917
|
export const constructAnswerBasedOnData = (data: any) => {
|
|
1920
1918
|
if (Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
1921
1919
|
return constructActivityAnswerMap(
|
|
1922
|
-
|
|
1920
|
+
"ORDERING",
|
|
1923
1921
|
JSON.parse(JSON.stringify(data))
|
|
1924
1922
|
);
|
|
1925
1923
|
}
|
|
1926
1924
|
if (Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
1927
1925
|
return constructActivityAnswerMap(
|
|
1928
|
-
|
|
1926
|
+
"DROPDOWN",
|
|
1929
1927
|
JSON.parse(JSON.stringify(data))
|
|
1930
1928
|
);
|
|
1931
1929
|
}
|
|
1932
1930
|
if (Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
1933
|
-
return constructActivityAnswerMap(
|
|
1934
|
-
{ type: "MCSA" },
|
|
1935
|
-
JSON.parse(JSON.stringify(data))
|
|
1936
|
-
);
|
|
1931
|
+
return constructActivityAnswerMap("MCSA", JSON.parse(JSON.stringify(data)));
|
|
1937
1932
|
}
|
|
1938
1933
|
if (Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
1939
|
-
return constructActivityAnswerMap(
|
|
1940
|
-
{ type: "MCMA" },
|
|
1941
|
-
JSON.parse(JSON.stringify(data))
|
|
1942
|
-
);
|
|
1934
|
+
return constructActivityAnswerMap("MCMA", JSON.parse(JSON.stringify(data)));
|
|
1943
1935
|
}
|
|
1944
1936
|
if (Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
1945
1937
|
return constructActivityAnswerMap(
|
|
1946
|
-
|
|
1938
|
+
"MATCHING",
|
|
1947
1939
|
JSON.parse(JSON.stringify(data))
|
|
1948
1940
|
);
|
|
1949
1941
|
}
|
|
1950
1942
|
if (Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
1951
1943
|
return constructActivityAnswerMap(
|
|
1952
|
-
|
|
1944
|
+
"GROUPING",
|
|
1953
1945
|
JSON.parse(JSON.stringify(data))
|
|
1954
1946
|
);
|
|
1955
1947
|
}
|
|
@@ -1959,19 +1951,19 @@ export const constructAnswerBasedOnData = (data: any) => {
|
|
|
1959
1951
|
)
|
|
1960
1952
|
) {
|
|
1961
1953
|
return constructActivityAnswerMap(
|
|
1962
|
-
|
|
1954
|
+
"FILL_IN_THE_BLANKS",
|
|
1963
1955
|
JSON.parse(JSON.stringify(data))
|
|
1964
1956
|
);
|
|
1965
1957
|
}
|
|
1966
1958
|
if (Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
1967
1959
|
return constructActivityAnswerMap(
|
|
1968
|
-
|
|
1960
|
+
"OPEN_ENDED",
|
|
1969
1961
|
JSON.parse(JSON.stringify(data))
|
|
1970
1962
|
);
|
|
1971
1963
|
}
|
|
1972
1964
|
if (Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
1973
1965
|
return constructActivityAnswerMap(
|
|
1974
|
-
|
|
1966
|
+
"TRUE_FALSE",
|
|
1975
1967
|
JSON.parse(JSON.stringify(data))
|
|
1976
1968
|
);
|
|
1977
1969
|
}
|