catchup-library-web 1.13.2 → 1.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +13 -33
- package/dist/index.d.ts +13 -33
- package/dist/index.js +94 -191
- package/dist/index.mjs +93 -188
- package/package.json +1 -1
- package/src/components/activities/ActivityPreviewByAnswerData.tsx +10 -41
- package/src/components/activities/ActivityPreviewByData.tsx +8 -32
- package/src/properties/ActivityProperties.ts +2 -2
- package/src/utilization/CatchtivityUtilization.ts +78 -150
- package/src/utilization/IndividualModelUtilization.ts +8 -14
package/dist/index.mjs
CHANGED
|
@@ -1104,63 +1104,6 @@ var retrieveDurationInSecondsOptionList = () => {
|
|
|
1104
1104
|
{ value: 45, text: `45 ${i18n_default.t("seconds")}` }
|
|
1105
1105
|
];
|
|
1106
1106
|
};
|
|
1107
|
-
var retrieveTaxonomyType = () => {
|
|
1108
|
-
return [
|
|
1109
|
-
{
|
|
1110
|
-
value: "BLOOM",
|
|
1111
|
-
text: i18n_default.t("BLOOM")
|
|
1112
|
-
}
|
|
1113
|
-
];
|
|
1114
|
-
};
|
|
1115
|
-
var retrieveTaxonomyGroupName = () => {
|
|
1116
|
-
return [
|
|
1117
|
-
{
|
|
1118
|
-
type: "BLOOM",
|
|
1119
|
-
value: "BLOOM",
|
|
1120
|
-
text: i18n_default.t("BLOOM")
|
|
1121
|
-
}
|
|
1122
|
-
];
|
|
1123
|
-
};
|
|
1124
|
-
var retrieveTaxonomyName = () => {
|
|
1125
|
-
return [
|
|
1126
|
-
{
|
|
1127
|
-
stage: 1,
|
|
1128
|
-
groupName: "BLOOM",
|
|
1129
|
-
value: "REMEMBER",
|
|
1130
|
-
text: i18n_default.t("REMEMBER")
|
|
1131
|
-
},
|
|
1132
|
-
{
|
|
1133
|
-
stage: 2,
|
|
1134
|
-
groupName: "BLOOM",
|
|
1135
|
-
value: "UNDERSTAND",
|
|
1136
|
-
text: i18n_default.t("UNDERSTAND")
|
|
1137
|
-
},
|
|
1138
|
-
{
|
|
1139
|
-
stage: 3,
|
|
1140
|
-
groupName: "BLOOM",
|
|
1141
|
-
value: "APPLY",
|
|
1142
|
-
text: i18n_default.t("APPLY")
|
|
1143
|
-
},
|
|
1144
|
-
{
|
|
1145
|
-
stage: 4,
|
|
1146
|
-
groupName: "BLOOM",
|
|
1147
|
-
value: "ANALYZE",
|
|
1148
|
-
text: i18n_default.t("ANALYZE")
|
|
1149
|
-
},
|
|
1150
|
-
{
|
|
1151
|
-
stage: 5,
|
|
1152
|
-
groupName: "BLOOM",
|
|
1153
|
-
value: "EVALUATE",
|
|
1154
|
-
text: i18n_default.t("EVALUATE")
|
|
1155
|
-
},
|
|
1156
|
-
{
|
|
1157
|
-
stage: 6,
|
|
1158
|
-
groupName: "BLOOM",
|
|
1159
|
-
value: "CREATE",
|
|
1160
|
-
text: i18n_default.t("CREATE")
|
|
1161
|
-
}
|
|
1162
|
-
];
|
|
1163
|
-
};
|
|
1164
1107
|
var constructInputWithSpecialExpressionList = (inputText) => {
|
|
1165
1108
|
const inputPartList = [];
|
|
1166
1109
|
if (!inputText) return [];
|
|
@@ -2254,45 +2197,45 @@ var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
|
|
|
2254
2197
|
const { activityTemplateDTOList, data, coterieType, categoryIdList } = activity;
|
|
2255
2198
|
const parsedData = JSON.parse(data);
|
|
2256
2199
|
const {
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2200
|
+
orderingDifficulty,
|
|
2201
|
+
dropdownDifficulty,
|
|
2202
|
+
MCSADifficulty,
|
|
2203
|
+
MCMADifficulty,
|
|
2204
|
+
matchingDifficulty,
|
|
2205
|
+
groupingDifficulty,
|
|
2206
|
+
fillInTheBlanksDifficulty,
|
|
2207
|
+
openEndedDifficulty,
|
|
2208
|
+
trueFalseDifficulty
|
|
2266
2209
|
} = parsedData;
|
|
2267
|
-
const
|
|
2268
|
-
if (
|
|
2269
|
-
|
|
2210
|
+
const difficultyMap = {};
|
|
2211
|
+
if (orderingDifficulty) {
|
|
2212
|
+
difficultyMap["orderingDifficulty"] = JSON.parse(orderingDifficulty);
|
|
2270
2213
|
}
|
|
2271
|
-
if (
|
|
2272
|
-
|
|
2214
|
+
if (dropdownDifficulty) {
|
|
2215
|
+
difficultyMap["dropdownDifficulty"] = JSON.parse(dropdownDifficulty);
|
|
2273
2216
|
}
|
|
2274
|
-
if (
|
|
2275
|
-
|
|
2217
|
+
if (MCSADifficulty) {
|
|
2218
|
+
difficultyMap["MCSADifficulty"] = JSON.parse(MCSADifficulty);
|
|
2276
2219
|
}
|
|
2277
|
-
if (
|
|
2278
|
-
|
|
2220
|
+
if (MCMADifficulty) {
|
|
2221
|
+
difficultyMap["MCMADifficulty"] = JSON.parse(MCMADifficulty);
|
|
2279
2222
|
}
|
|
2280
|
-
if (
|
|
2281
|
-
|
|
2223
|
+
if (matchingDifficulty) {
|
|
2224
|
+
difficultyMap["matchingDifficulty"] = JSON.parse(matchingDifficulty);
|
|
2282
2225
|
}
|
|
2283
|
-
if (
|
|
2284
|
-
|
|
2226
|
+
if (groupingDifficulty) {
|
|
2227
|
+
difficultyMap["groupingDifficulty"] = JSON.parse(groupingDifficulty);
|
|
2285
2228
|
}
|
|
2286
|
-
if (
|
|
2287
|
-
|
|
2288
|
-
|
|
2229
|
+
if (fillInTheBlanksDifficulty) {
|
|
2230
|
+
difficultyMap["fillInTheBlanksDifficulty"] = JSON.parse(
|
|
2231
|
+
fillInTheBlanksDifficulty
|
|
2289
2232
|
);
|
|
2290
2233
|
}
|
|
2291
|
-
if (
|
|
2292
|
-
|
|
2234
|
+
if (trueFalseDifficulty) {
|
|
2235
|
+
difficultyMap["trueFalseDifficulty"] = JSON.parse(trueFalseDifficulty);
|
|
2293
2236
|
}
|
|
2294
|
-
if (
|
|
2295
|
-
|
|
2237
|
+
if (openEndedDifficulty) {
|
|
2238
|
+
difficultyMap["openEndedDifficulty"] = JSON.parse(openEndedDifficulty);
|
|
2296
2239
|
}
|
|
2297
2240
|
let coterieField = "VERBAL";
|
|
2298
2241
|
if (coterieType === "MATHEMATICS" || coterieType === "BIOLOGY" || coterieType === "PHYSICS" || coterieType === "CHEMISTRY" || coterieType === "SCIENCE") {
|
|
@@ -2320,33 +2263,27 @@ var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
|
|
|
2320
2263
|
const activityTemplateValueMap = {};
|
|
2321
2264
|
for (const activityTemplateDTO of activityTemplateDTOList) {
|
|
2322
2265
|
const { type } = activityTemplateDTO;
|
|
2323
|
-
let
|
|
2266
|
+
let currentDifficulty = "";
|
|
2324
2267
|
if (type === "ORDERING") {
|
|
2325
|
-
|
|
2268
|
+
currentDifficulty = difficultyMap["orderingDifficulty"];
|
|
2326
2269
|
} else if (type === "DROPDOWN") {
|
|
2327
|
-
|
|
2270
|
+
currentDifficulty = difficultyMap["dropdownDifficulty"];
|
|
2328
2271
|
} else if (type === "MCSA") {
|
|
2329
|
-
|
|
2272
|
+
currentDifficulty = difficultyMap["MCSADifficulty"];
|
|
2330
2273
|
} else if (type === "MCMA") {
|
|
2331
|
-
|
|
2274
|
+
currentDifficulty = difficultyMap["MCMADifficulty"];
|
|
2332
2275
|
} else if (type === "MATCHING") {
|
|
2333
|
-
|
|
2276
|
+
currentDifficulty = difficultyMap["matchingDifficulty"];
|
|
2334
2277
|
} else if (type === "GROUPING") {
|
|
2335
|
-
|
|
2278
|
+
currentDifficulty = difficultyMap["groupingDifficulty"];
|
|
2336
2279
|
} else if (type === "FILL_IN_THE_BLANKS") {
|
|
2337
|
-
|
|
2280
|
+
currentDifficulty = difficultyMap["fillInTheBlanksDifficulty"];
|
|
2338
2281
|
} else if (type === "OPEN_ENDED") {
|
|
2339
|
-
|
|
2282
|
+
currentDifficulty = difficultyMap["openEndedDifficulty"];
|
|
2340
2283
|
} else if (type === "TRUE_FALSE") {
|
|
2341
|
-
|
|
2284
|
+
currentDifficulty = difficultyMap["trueFalseDifficulty"];
|
|
2342
2285
|
}
|
|
2343
|
-
const
|
|
2344
|
-
type: taxonomyType,
|
|
2345
|
-
groupName: taxonomyGroupName,
|
|
2346
|
-
name: taxonomyName
|
|
2347
|
-
} = currentTaxonomyMap;
|
|
2348
|
-
const taxonomyString = taxonomyType.toLowerCase() + taxonomyGroupName.toLowerCase().charAt(0).toUpperCase() + taxonomyGroupName.toLowerCase().substring(1) + taxonomyName.toLowerCase().charAt(0).toUpperCase() + taxonomyName.toLowerCase().substring(1);
|
|
2349
|
-
const currentTaxonomyScore = foundModel[taxonomyString];
|
|
2286
|
+
const currentDifficultyScore = foundModel[currentDifficulty];
|
|
2350
2287
|
const splittedTypeList = type.split("_");
|
|
2351
2288
|
let activityTemplateString = "";
|
|
2352
2289
|
for (let i = 0; i < splittedTypeList.length; i++) {
|
|
@@ -2358,7 +2295,7 @@ var findBestFitActivity = (activity, individualModelList, outcomeModelList) => {
|
|
|
2358
2295
|
}
|
|
2359
2296
|
}
|
|
2360
2297
|
const currentActivityTemplateScore = foundModel[activityTemplateString];
|
|
2361
|
-
const currentScore =
|
|
2298
|
+
const currentScore = currentDifficultyScore * currentActivityTemplateScore;
|
|
2362
2299
|
activityTemplateValueMap[type] = currentScore;
|
|
2363
2300
|
if (currentScore < bestScore) {
|
|
2364
2301
|
bestScore = currentScore;
|
|
@@ -2643,7 +2580,7 @@ var convertToEvaluationRubricMapString = (type, evaluationRubricMap) => {
|
|
|
2643
2580
|
}
|
|
2644
2581
|
return convertedEvaluationRubricMap;
|
|
2645
2582
|
};
|
|
2646
|
-
var constructActivityData = (activityTemplateType, contentMap, bodyMap, materialMap, solutionMap,
|
|
2583
|
+
var constructActivityData = (activityTemplateType, contentMap, bodyMap, materialMap, solutionMap, difficulty, evaluationRubricMap) => {
|
|
2647
2584
|
const constructedData = {};
|
|
2648
2585
|
constructedData["contentMap"] = JSON.stringify(contentMap);
|
|
2649
2586
|
if (activityTemplateType === "ORDERING") {
|
|
@@ -2654,7 +2591,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2654
2591
|
convertToSolutionMapString("ORDERING", solutionMap)
|
|
2655
2592
|
);
|
|
2656
2593
|
constructedData["orderingMaterialMap"] = JSON.stringify(materialMap);
|
|
2657
|
-
constructedData["
|
|
2594
|
+
constructedData["orderingDifficulty"] = difficulty;
|
|
2658
2595
|
} else if (activityTemplateType === "DROPDOWN") {
|
|
2659
2596
|
constructedData["dropdownBodyMap"] = JSON.stringify(
|
|
2660
2597
|
convertToBodyMapString("DROPDOWN", bodyMap)
|
|
@@ -2673,7 +2610,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2673
2610
|
constructedData["dropdownMaterialMap"] = JSON.stringify(
|
|
2674
2611
|
convertedDropdownMaterialMap
|
|
2675
2612
|
);
|
|
2676
|
-
constructedData["
|
|
2613
|
+
constructedData["dropdownDifficulty"] = difficulty;
|
|
2677
2614
|
} else if (activityTemplateType === "MCSA") {
|
|
2678
2615
|
constructedData["MCSABodyMap"] = JSON.stringify(
|
|
2679
2616
|
convertToBodyMapString("MCSA", bodyMap)
|
|
@@ -2688,7 +2625,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2688
2625
|
constructedData["MCSAMaterialMap"] = JSON.stringify(
|
|
2689
2626
|
convertedMCSAMaterialMap
|
|
2690
2627
|
);
|
|
2691
|
-
constructedData["
|
|
2628
|
+
constructedData["MCSADifficulty"] = difficulty;
|
|
2692
2629
|
} else if (activityTemplateType === "MCMA") {
|
|
2693
2630
|
constructedData["MCMABodyMap"] = JSON.stringify(
|
|
2694
2631
|
convertToBodyMapString("MCMA", bodyMap)
|
|
@@ -2706,7 +2643,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2706
2643
|
constructedData["MCMAMaterialMap"] = JSON.stringify(
|
|
2707
2644
|
convertedMCMAMaterialMap
|
|
2708
2645
|
);
|
|
2709
|
-
constructedData["
|
|
2646
|
+
constructedData["MCMADifficulty"] = difficulty;
|
|
2710
2647
|
} else if (activityTemplateType === "MATCHING") {
|
|
2711
2648
|
constructedData["matchingBodyMap"] = JSON.stringify(
|
|
2712
2649
|
convertToBodyMapString("MATCHING", bodyMap)
|
|
@@ -2723,7 +2660,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2723
2660
|
constructedData["matchingMaterialMap"] = JSON.stringify(
|
|
2724
2661
|
convertedMatchingMaterialMap
|
|
2725
2662
|
);
|
|
2726
|
-
constructedData["
|
|
2663
|
+
constructedData["matchingDifficulty"] = difficulty;
|
|
2727
2664
|
} else if (activityTemplateType === "GROUPING") {
|
|
2728
2665
|
constructedData["groupingBodyMap"] = JSON.stringify(
|
|
2729
2666
|
convertToBodyMapString("GROUPING", bodyMap)
|
|
@@ -2740,7 +2677,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2740
2677
|
constructedData["groupingMaterialMap"] = JSON.stringify(
|
|
2741
2678
|
convertedGroupingMaterialMap
|
|
2742
2679
|
);
|
|
2743
|
-
constructedData["
|
|
2680
|
+
constructedData["groupingDifficulty"] = difficulty;
|
|
2744
2681
|
} else if (activityTemplateType === "FILL_IN_THE_BLANKS") {
|
|
2745
2682
|
constructedData["fillInTheBlanksBodyMap"] = JSON.stringify(
|
|
2746
2683
|
convertToBodyMapString("FILL_IN_THE_BLANKS", bodyMap)
|
|
@@ -2757,7 +2694,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2757
2694
|
constructedData["fillInTheBlanksMaterialMap"] = JSON.stringify(
|
|
2758
2695
|
convertedFillInTheBlanksMaterialMap
|
|
2759
2696
|
);
|
|
2760
|
-
constructedData["
|
|
2697
|
+
constructedData["fillInTheBlanksDifficulty"] = difficulty;
|
|
2761
2698
|
} else if (activityTemplateType === "OPEN_ENDED") {
|
|
2762
2699
|
constructedData["openEndedBodyMap"] = JSON.stringify(
|
|
2763
2700
|
convertToBodyMapString("OPEN_ENDED", bodyMap)
|
|
@@ -2769,7 +2706,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2769
2706
|
convertToEvaluationRubricMapString("OPEN_ENDED", evaluationRubricMap)
|
|
2770
2707
|
);
|
|
2771
2708
|
constructedData["openEndedMaterialMap"] = JSON.stringify(materialMap);
|
|
2772
|
-
constructedData["
|
|
2709
|
+
constructedData["openEndedDifficulty"] = difficulty;
|
|
2773
2710
|
} else if (activityTemplateType === "TRUE_FALSE") {
|
|
2774
2711
|
constructedData["trueFalseBodyMap"] = JSON.stringify(
|
|
2775
2712
|
convertToBodyMapString("TRUE_FALSE", bodyMap)
|
|
@@ -2784,7 +2721,7 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2784
2721
|
constructedData["trueFalseMaterialMap"] = JSON.stringify(
|
|
2785
2722
|
convertTrueFalseMaterialMap
|
|
2786
2723
|
);
|
|
2787
|
-
constructedData["
|
|
2724
|
+
constructedData["trueFalseDifficulty"] = difficulty;
|
|
2788
2725
|
}
|
|
2789
2726
|
return constructedData;
|
|
2790
2727
|
};
|
|
@@ -3063,6 +3000,29 @@ var constructActivityItemListSolutionOnly = (solutionMap) => {
|
|
|
3063
3000
|
});
|
|
3064
3001
|
return itemList;
|
|
3065
3002
|
};
|
|
3003
|
+
var retrieveDifficultyByActivityTypeFromData = (type, data) => {
|
|
3004
|
+
let difficulty = "";
|
|
3005
|
+
if (type === "ORDERING") {
|
|
3006
|
+
difficulty = data["orderingDifficulty"];
|
|
3007
|
+
} else if (type === "DROPDOWN") {
|
|
3008
|
+
difficulty = data["dropdownDifficulty"];
|
|
3009
|
+
} else if (type === "MCSA") {
|
|
3010
|
+
difficulty = data["MCSADifficulty"];
|
|
3011
|
+
} else if (type === "MCMA") {
|
|
3012
|
+
difficulty = data["MCMADifficulty"];
|
|
3013
|
+
} else if (type === "MATCHING") {
|
|
3014
|
+
difficulty = data["matchingDifficulty"];
|
|
3015
|
+
} else if (type === "GROUPING") {
|
|
3016
|
+
difficulty = data["groupingDifficulty"];
|
|
3017
|
+
} else if (type === "FILL_IN_THE_BLANKS") {
|
|
3018
|
+
difficulty = data["fillInTheBlanksDifficulty"];
|
|
3019
|
+
} else if (type === "OPEN_ENDED") {
|
|
3020
|
+
difficulty = data["openEndedDifficulty"];
|
|
3021
|
+
} else if (type === "TRUE_FALSE") {
|
|
3022
|
+
difficulty = data["trueFalseDifficulty"];
|
|
3023
|
+
}
|
|
3024
|
+
return difficulty;
|
|
3025
|
+
};
|
|
3066
3026
|
|
|
3067
3027
|
// src/components/activities/body-content/ShowBodyMediaByContentType.tsx
|
|
3068
3028
|
import { InlineMath } from "react-katex";
|
|
@@ -6633,7 +6593,7 @@ var ActivityPreviewByData = ({
|
|
|
6633
6593
|
typeOptionList,
|
|
6634
6594
|
showSolution,
|
|
6635
6595
|
showEvaluationRubric,
|
|
6636
|
-
|
|
6596
|
+
showDifficulty,
|
|
6637
6597
|
isFullScreen
|
|
6638
6598
|
}) => {
|
|
6639
6599
|
const [key, setKey] = useState23((/* @__PURE__ */ new Date()).getTime());
|
|
@@ -6659,31 +6619,6 @@ var ActivityPreviewByData = ({
|
|
|
6659
6619
|
}
|
|
6660
6620
|
}, [typeOptionList, lockedType]);
|
|
6661
6621
|
useEffect14(() => {
|
|
6662
|
-
const retrieveTaxonomyNameByActivityTypeFromData = (type) => {
|
|
6663
|
-
let taxonomyMap = {
|
|
6664
|
-
name: ""
|
|
6665
|
-
};
|
|
6666
|
-
if (type === "ORDERING") {
|
|
6667
|
-
taxonomyMap = JSON.parse(data["orderingTaxonomyMap"]);
|
|
6668
|
-
} else if (type === "DROPDOWN") {
|
|
6669
|
-
taxonomyMap = JSON.parse(data["dropdownTaxonomyMap"]);
|
|
6670
|
-
} else if (type === "MCSA") {
|
|
6671
|
-
taxonomyMap = JSON.parse(data["MCSATaxonomyMap"]);
|
|
6672
|
-
} else if (type === "MCMA") {
|
|
6673
|
-
taxonomyMap = JSON.parse(data["MCMATaxonomyMap"]);
|
|
6674
|
-
} else if (type === "MATCHING") {
|
|
6675
|
-
taxonomyMap = JSON.parse(data["matchingTaxonomyMap"]);
|
|
6676
|
-
} else if (type === "GROUPING") {
|
|
6677
|
-
taxonomyMap = JSON.parse(data["groupingTaxonomyMap"]);
|
|
6678
|
-
} else if (type === "FILL_IN_THE_BLANKS") {
|
|
6679
|
-
taxonomyMap = JSON.parse(data["fillInTheBlanksTaxonomyMap"]);
|
|
6680
|
-
} else if (type === "OPEN_ENDED") {
|
|
6681
|
-
taxonomyMap = JSON.parse(data["openEndedTaxonomyMap"]);
|
|
6682
|
-
} else if (type === "TRUE_FALSE") {
|
|
6683
|
-
taxonomyMap = JSON.parse(data["trueFalseTaxonomyMap"]);
|
|
6684
|
-
}
|
|
6685
|
-
return taxonomyMap.name;
|
|
6686
|
-
};
|
|
6687
6622
|
if (!data) return;
|
|
6688
6623
|
if (!typeOptionList) return;
|
|
6689
6624
|
if (typeOptionList.length === 0) return;
|
|
@@ -6693,18 +6628,18 @@ var ActivityPreviewByData = ({
|
|
|
6693
6628
|
(typeOption) => typeOption.id === lockedType
|
|
6694
6629
|
);
|
|
6695
6630
|
}
|
|
6696
|
-
if (
|
|
6631
|
+
if (showDifficulty) {
|
|
6697
6632
|
setOptionList(
|
|
6698
6633
|
currentTypeOptionList.map((typeOption) => __spreadProps(__spreadValues({}, typeOption), {
|
|
6699
6634
|
subText: i18n_default.t(
|
|
6700
|
-
|
|
6635
|
+
retrieveDifficultyByActivityTypeFromData(typeOption.id, data)
|
|
6701
6636
|
)
|
|
6702
6637
|
}))
|
|
6703
6638
|
);
|
|
6704
6639
|
} else {
|
|
6705
6640
|
setOptionList(currentTypeOptionList);
|
|
6706
6641
|
}
|
|
6707
|
-
}, [data, lockedType, typeOptionList,
|
|
6642
|
+
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
6708
6643
|
if (!data) return;
|
|
6709
6644
|
const answer = constructAnswerBasedOnData(data);
|
|
6710
6645
|
return /* @__PURE__ */ jsxs35("div", { children: [
|
|
@@ -6873,7 +6808,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
6873
6808
|
typeOptionList = [],
|
|
6874
6809
|
showSolution = false,
|
|
6875
6810
|
showEvaluationRubric = false,
|
|
6876
|
-
|
|
6811
|
+
showDifficulty = true,
|
|
6877
6812
|
isFullScreen = false,
|
|
6878
6813
|
showCorrectAnswer = false
|
|
6879
6814
|
}) => {
|
|
@@ -6895,30 +6830,6 @@ var ActivityPreviewByAnswerData = ({
|
|
|
6895
6830
|
}
|
|
6896
6831
|
return null;
|
|
6897
6832
|
};
|
|
6898
|
-
const retrieveTaxonomyNameFromActivityType = (type) => {
|
|
6899
|
-
if (!data) return "";
|
|
6900
|
-
let taxonomyMap = { name: "" };
|
|
6901
|
-
const taxonomyMapNames = {
|
|
6902
|
-
ORDERING: "orderingTaxonomyMap",
|
|
6903
|
-
DROPDOWN: "dropdownTaxonomyMap",
|
|
6904
|
-
MCSA: "MCSATaxonomyMap",
|
|
6905
|
-
MCMA: "MCMATaxonomyMap",
|
|
6906
|
-
MATCHING: "matchingTaxonomyMap",
|
|
6907
|
-
GROUPING: "groupingTaxonomyMap",
|
|
6908
|
-
FILL_IN_THE_BLANKS: "fillInTheBlanksTaxonomyMap",
|
|
6909
|
-
OPEN_ENDED: "openEndedTaxonomyMap",
|
|
6910
|
-
TRUE_FALSE: "trueFalseTaxonomyMap"
|
|
6911
|
-
};
|
|
6912
|
-
const mapName = taxonomyMapNames[type];
|
|
6913
|
-
if (mapName && data[mapName]) {
|
|
6914
|
-
try {
|
|
6915
|
-
taxonomyMap = JSON.parse(data[mapName]);
|
|
6916
|
-
} catch (error) {
|
|
6917
|
-
console.error(`Error parsing taxonomy map for ${type}:`, error);
|
|
6918
|
-
}
|
|
6919
|
-
}
|
|
6920
|
-
return taxonomyMap.name || "";
|
|
6921
|
-
};
|
|
6922
6833
|
useEffect15(() => {
|
|
6923
6834
|
if (!data) return;
|
|
6924
6835
|
const constructAnswerBasedOnData2 = () => {
|
|
@@ -6969,16 +6880,18 @@ var ActivityPreviewByAnswerData = ({
|
|
|
6969
6880
|
(typeOption) => typeOption.id === lockedType
|
|
6970
6881
|
);
|
|
6971
6882
|
}
|
|
6972
|
-
if (
|
|
6883
|
+
if (showDifficulty) {
|
|
6973
6884
|
setOptionList(
|
|
6974
6885
|
currentTypeOptionList.map((typeOption) => __spreadProps(__spreadValues({}, typeOption), {
|
|
6975
|
-
subText: i18n_default.t(
|
|
6886
|
+
subText: i18n_default.t(
|
|
6887
|
+
retrieveDifficultyByActivityTypeFromData(typeOption.id, data)
|
|
6888
|
+
)
|
|
6976
6889
|
}))
|
|
6977
6890
|
);
|
|
6978
6891
|
} else {
|
|
6979
6892
|
setOptionList(currentTypeOptionList);
|
|
6980
6893
|
}
|
|
6981
|
-
}, [data, answer.data, lockedType, typeOptionList,
|
|
6894
|
+
}, [data, answer.data, lockedType, typeOptionList, showDifficulty]);
|
|
6982
6895
|
const RenderSelectedActivityContent = () => {
|
|
6983
6896
|
const commonProps = {
|
|
6984
6897
|
answer,
|
|
@@ -9512,17 +9425,14 @@ var retrieveBadgeRuleTextByParams = (coterieType, sourceType, badgeType, level)
|
|
|
9512
9425
|
|
|
9513
9426
|
// src/utilization/IndividualModelUtilization.ts
|
|
9514
9427
|
var NUMBER_OF_ACTIVITY_TEMPLATE = 9;
|
|
9515
|
-
var
|
|
9516
|
-
var
|
|
9428
|
+
var NUMBER_OF_DIFFICULTY = 3;
|
|
9429
|
+
var INITIAL_DIFFICULTY_VALUE = 1 / NUMBER_OF_DIFFICULTY;
|
|
9517
9430
|
var INITIAL_TEMPLATE_VALUE = 1 / NUMBER_OF_ACTIVITY_TEMPLATE;
|
|
9518
9431
|
var constructBaseVerbalIndvidualModel = (userId) => {
|
|
9519
9432
|
return {
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
bloomBloomEvaluate: INITIAL_TAXONOMY_VALUE,
|
|
9524
|
-
bloomBloomRemember: INITIAL_TAXONOMY_VALUE,
|
|
9525
|
-
bloomBloomUnderstand: INITIAL_TAXONOMY_VALUE,
|
|
9433
|
+
easy: INITIAL_DIFFICULTY_VALUE,
|
|
9434
|
+
medium: INITIAL_DIFFICULTY_VALUE,
|
|
9435
|
+
hard: INITIAL_DIFFICULTY_VALUE,
|
|
9526
9436
|
dropdown: INITIAL_TEMPLATE_VALUE,
|
|
9527
9437
|
coterieField: "VERBAL",
|
|
9528
9438
|
fillInTheBlanks: INITIAL_TEMPLATE_VALUE,
|
|
@@ -9538,12 +9448,9 @@ var constructBaseVerbalIndvidualModel = (userId) => {
|
|
|
9538
9448
|
};
|
|
9539
9449
|
var constructBaseNumericIndividualModel = (userId) => {
|
|
9540
9450
|
return {
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
bloomBloomEvaluate: INITIAL_TAXONOMY_VALUE,
|
|
9545
|
-
bloomBloomRemember: INITIAL_TAXONOMY_VALUE,
|
|
9546
|
-
bloomBloomUnderstand: INITIAL_TAXONOMY_VALUE,
|
|
9451
|
+
easy: INITIAL_DIFFICULTY_VALUE,
|
|
9452
|
+
medium: INITIAL_DIFFICULTY_VALUE,
|
|
9453
|
+
hard: INITIAL_DIFFICULTY_VALUE,
|
|
9547
9454
|
dropdown: INITIAL_TEMPLATE_VALUE,
|
|
9548
9455
|
coterieField: "NUMERIC",
|
|
9549
9456
|
fillInTheBlanks: INITIAL_TEMPLATE_VALUE,
|
|
@@ -10145,6 +10052,7 @@ export {
|
|
|
10145
10052
|
retrieveCurrentDefaultDataMap,
|
|
10146
10053
|
retrieveDateIntervalOptionList,
|
|
10147
10054
|
retrieveDefaultUserRoleOptionList,
|
|
10055
|
+
retrieveDifficultyByActivityTypeFromData,
|
|
10148
10056
|
retrieveDistintCoterieTypeFromCatchtivityApplicationDTO,
|
|
10149
10057
|
retrieveDocumentTypeFromAcceptedFormat,
|
|
10150
10058
|
retrieveDocumentTypeFromExtension,
|
|
@@ -10175,9 +10083,6 @@ export {
|
|
|
10175
10083
|
retrieveStandardExamTypeIcon,
|
|
10176
10084
|
retrieveStandardExamTypeOptionList,
|
|
10177
10085
|
retrieveStatusOptionList,
|
|
10178
|
-
retrieveTaxonomyGroupName,
|
|
10179
|
-
retrieveTaxonomyName,
|
|
10180
|
-
retrieveTaxonomyType,
|
|
10181
10086
|
retrieveTeachingMethodologyOptionList,
|
|
10182
10087
|
retrieveTimeFilterOptionList,
|
|
10183
10088
|
retrieveTimeFilterWithLastNOptionList,
|
package/package.json
CHANGED
|
@@ -13,7 +13,10 @@ import ActivitySolutionContent from "./solution-content/ActivitySolutionContent"
|
|
|
13
13
|
import ActivityEvaluationRubricContent from "./evaluation-rubric-content/ActivityEvaluationRubricContent";
|
|
14
14
|
import DividerLine from "../dividers/DividerLine";
|
|
15
15
|
import i18n from "../../language/i18n";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
constructActivityAnswerMap,
|
|
18
|
+
retrieveDifficultyByActivityTypeFromData,
|
|
19
|
+
} from "../../utilization/CatchtivityUtilization";
|
|
17
20
|
import { IActivityPreviewByAnswerDataProps } from "../../properties/ActivityProperties";
|
|
18
21
|
import ActivityEmptyContent from "./empty-content/ActivityEmptyContent";
|
|
19
22
|
|
|
@@ -25,14 +28,13 @@ const ActivityPreviewByAnswerData = ({
|
|
|
25
28
|
typeOptionList = [],
|
|
26
29
|
showSolution = false,
|
|
27
30
|
showEvaluationRubric = false,
|
|
28
|
-
|
|
31
|
+
showDifficulty = true,
|
|
29
32
|
isFullScreen = false,
|
|
30
33
|
showCorrectAnswer = false,
|
|
31
34
|
}: IActivityPreviewByAnswerDataProps) => {
|
|
32
35
|
const [key, setKey] = useState(new Date().getTime());
|
|
33
36
|
const [selectedType, setSelectedType] = useState<string | null>(null);
|
|
34
37
|
const [optionList, setOptionList] = useState<any[]>([]);
|
|
35
|
-
// Define proper types for answer data
|
|
36
38
|
interface AnswerItem {
|
|
37
39
|
type: string;
|
|
38
40
|
isEmpty?: boolean;
|
|
@@ -46,13 +48,11 @@ const ActivityPreviewByAnswerData = ({
|
|
|
46
48
|
|
|
47
49
|
const [answer, setAnswer] = useState<Answer>({ data: [] });
|
|
48
50
|
|
|
49
|
-
// Reset component when data changes
|
|
50
51
|
useEffect(() => {
|
|
51
52
|
if (!data) return;
|
|
52
53
|
setKey(new Date().getTime());
|
|
53
54
|
}, [data]);
|
|
54
55
|
|
|
55
|
-
// Helper function to check if answer map exists for a specific type
|
|
56
56
|
const checkAnswerMapExists = (type: string): AnswerItem | null => {
|
|
57
57
|
if (data && data.answerMap && Array.isArray(data.answerMap)) {
|
|
58
58
|
const foundAnswer = data.answerMap.find(
|
|
@@ -63,37 +63,6 @@ const ActivityPreviewByAnswerData = ({
|
|
|
63
63
|
return null;
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
// Helper function to retrieve taxonomy name from activity type
|
|
67
|
-
const retrieveTaxonomyNameFromActivityType = (type: string) => {
|
|
68
|
-
if (!data) return "";
|
|
69
|
-
|
|
70
|
-
let taxonomyMap = { name: "" };
|
|
71
|
-
|
|
72
|
-
const taxonomyMapNames: { [key: string]: string } = {
|
|
73
|
-
ORDERING: "orderingTaxonomyMap",
|
|
74
|
-
DROPDOWN: "dropdownTaxonomyMap",
|
|
75
|
-
MCSA: "MCSATaxonomyMap",
|
|
76
|
-
MCMA: "MCMATaxonomyMap",
|
|
77
|
-
MATCHING: "matchingTaxonomyMap",
|
|
78
|
-
GROUPING: "groupingTaxonomyMap",
|
|
79
|
-
FILL_IN_THE_BLANKS: "fillInTheBlanksTaxonomyMap",
|
|
80
|
-
OPEN_ENDED: "openEndedTaxonomyMap",
|
|
81
|
-
TRUE_FALSE: "trueFalseTaxonomyMap",
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const mapName = taxonomyMapNames[type];
|
|
85
|
-
if (mapName && data[mapName]) {
|
|
86
|
-
try {
|
|
87
|
-
taxonomyMap = JSON.parse(data[mapName]);
|
|
88
|
-
} catch (error) {
|
|
89
|
-
console.error(`Error parsing taxonomy map for ${type}:`, error);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return taxonomyMap.name || "";
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
// Construct answer data based on available activity types
|
|
97
66
|
useEffect(() => {
|
|
98
67
|
if (!data) return;
|
|
99
68
|
|
|
@@ -146,7 +115,6 @@ const ActivityPreviewByAnswerData = ({
|
|
|
146
115
|
constructAnswerBasedOnData();
|
|
147
116
|
}, [data, lockedType]);
|
|
148
117
|
|
|
149
|
-
// Set up option list for type selection
|
|
150
118
|
useEffect(() => {
|
|
151
119
|
if (!data || !answer.data.length) return;
|
|
152
120
|
|
|
@@ -163,19 +131,20 @@ const ActivityPreviewByAnswerData = ({
|
|
|
163
131
|
);
|
|
164
132
|
}
|
|
165
133
|
|
|
166
|
-
if (
|
|
134
|
+
if (showDifficulty) {
|
|
167
135
|
setOptionList(
|
|
168
136
|
currentTypeOptionList.map((typeOption: any) => ({
|
|
169
137
|
...typeOption,
|
|
170
|
-
subText: i18n.t(
|
|
138
|
+
subText: i18n.t(
|
|
139
|
+
retrieveDifficultyByActivityTypeFromData(typeOption.id, data)
|
|
140
|
+
),
|
|
171
141
|
}))
|
|
172
142
|
);
|
|
173
143
|
} else {
|
|
174
144
|
setOptionList(currentTypeOptionList);
|
|
175
145
|
}
|
|
176
|
-
}, [data, answer.data, lockedType, typeOptionList,
|
|
146
|
+
}, [data, answer.data, lockedType, typeOptionList, showDifficulty]);
|
|
177
147
|
|
|
178
|
-
// Render the appropriate activity content based on selected type
|
|
179
148
|
const RenderSelectedActivityContent = () => {
|
|
180
149
|
const commonProps = {
|
|
181
150
|
answer,
|