catchup-library-web 2.0.6 → 2.0.8
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 +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.js +286 -472
- package/dist/index.mjs +286 -472
- package/package.json +1 -1
- package/src/components/activities/ActivityPreviewByAnswerData.tsx +118 -121
- package/src/components/activities/ActivityPreviewByData.tsx +10 -10
- package/src/components/activities/DropdownActivityContent.tsx +9 -35
- package/src/components/activities/FillInTheBlanksActivityContent.tsx +9 -34
- package/src/components/activities/GroupingActivityContent.tsx +4 -8
- package/src/components/activities/MCMAActivityContent.tsx +8 -8
- package/src/components/activities/MCSAActivityContent.tsx +8 -8
- package/src/components/activities/MatchingActivityContent.tsx +4 -8
- package/src/components/activities/OpenEndedActivityContent.tsx +4 -8
- package/src/components/activities/OrderingActivityContent.tsx +4 -8
- package/src/components/activities/TrueFalseActivityContent.tsx +4 -12
- package/src/components/activities/material-contents/DropdownActivityMaterialContent.tsx +9 -19
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +9 -24
- package/src/components/activities/material-contents/GroupingActivityMaterialContent.tsx +7 -18
- package/src/components/activities/material-contents/MCMAActivityMaterialContent.tsx +2 -10
- package/src/components/activities/material-contents/MCSAActivityMaterialContent.tsx +2 -10
- package/src/components/activities/material-contents/MatchingActivityMaterialContent.tsx +7 -17
- package/src/components/activities/material-contents/OpenEndedActivityMaterialContent.tsx +2 -21
- package/src/components/activities/material-contents/OrderingActivityMaterialContent.tsx +4 -16
- package/src/components/activities/material-contents/TrueFalseActivityMaterialContent.tsx +4 -27
- package/src/properties/ActivityProperties.ts +21 -20
- package/src/utilization/CatchtivityUtilization.ts +49 -84
- package/src/utilization/ManagementUtilization.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -2350,45 +2350,29 @@ var retrieveDefaultOpenEndedMap = () => {
|
|
|
2350
2350
|
var retrieveDefaultTrueFalseMap = () => {
|
|
2351
2351
|
return { trueList: [], falseList: [] };
|
|
2352
2352
|
};
|
|
2353
|
-
var retrieveCurrentDefaultDataMap = (
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
if (
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
);
|
|
2362
|
-
} else if (
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
);
|
|
2366
|
-
} else if (
|
|
2367
|
-
|
|
2368
|
-
activityData.MCSAMaterialMap
|
|
2369
|
-
);
|
|
2370
|
-
} else if (activityTemplate.type === "MCMA") {
|
|
2371
|
-
defaultDataMap.answerMap = retrieveDefaultMCMAMap(
|
|
2372
|
-
activityData.MCMAMaterialMap
|
|
2373
|
-
);
|
|
2374
|
-
} else if (activityTemplate.type === "MATCHING") {
|
|
2375
|
-
defaultDataMap.answerMap = retrieveDefaultMatchingMap(
|
|
2376
|
-
activityData.matchingMaterialMap
|
|
2377
|
-
);
|
|
2378
|
-
} else if (activityTemplate.type === "GROUPING") {
|
|
2379
|
-
defaultDataMap.answerMap = retrieveDefaultGroupingMap(
|
|
2380
|
-
activityData.groupingMaterialMap
|
|
2381
|
-
);
|
|
2382
|
-
} else if (activityTemplate.type === "FILL_IN_THE_BLANKS") {
|
|
2383
|
-
defaultDataMap.answerMap = retrieveDefaultFillInTheBlanksMap(
|
|
2353
|
+
var retrieveCurrentDefaultDataMap = (activityTemplateType, activityData) => {
|
|
2354
|
+
if (activityTemplateType === "ORDERING") {
|
|
2355
|
+
return retrieveDefaultOrderingDataMap(activityData.orderingMaterialMap);
|
|
2356
|
+
} else if (activityTemplateType === "DROPDOWN") {
|
|
2357
|
+
return retrieveDefaultDropdownMap(activityData.dropdownMaterialMap);
|
|
2358
|
+
} else if (activityTemplateType === "MCSA") {
|
|
2359
|
+
return retrieveDefaultMCSAMap(activityData.MCSAMaterialMap);
|
|
2360
|
+
} else if (activityTemplateType === "MCMA") {
|
|
2361
|
+
return retrieveDefaultMCMAMap(activityData.MCMAMaterialMap);
|
|
2362
|
+
} else if (activityTemplateType === "MATCHING") {
|
|
2363
|
+
return retrieveDefaultMatchingMap(activityData.matchingMaterialMap);
|
|
2364
|
+
} else if (activityTemplateType === "GROUPING") {
|
|
2365
|
+
return retrieveDefaultGroupingMap(activityData.groupingMaterialMap);
|
|
2366
|
+
} else if (activityTemplateType === "FILL_IN_THE_BLANKS") {
|
|
2367
|
+
return retrieveDefaultFillInTheBlanksMap(
|
|
2384
2368
|
activityData.fillInTheBlanksMaterialMap
|
|
2385
2369
|
);
|
|
2386
|
-
} else if (
|
|
2387
|
-
|
|
2388
|
-
} else if (
|
|
2389
|
-
|
|
2370
|
+
} else if (activityTemplateType === "OPEN_ENDED") {
|
|
2371
|
+
return retrieveDefaultOpenEndedMap();
|
|
2372
|
+
} else if (activityTemplateType === "TRUE_FALSE") {
|
|
2373
|
+
return retrieveDefaultTrueFalseMap();
|
|
2390
2374
|
}
|
|
2391
|
-
return
|
|
2375
|
+
return {};
|
|
2392
2376
|
};
|
|
2393
2377
|
var constructActivityAnswerMap = (activityTemplate, activityData) => {
|
|
2394
2378
|
if (activityTemplate.type === "ORDERING") {
|
|
@@ -2420,7 +2404,7 @@ var constructActivityAnswerMap = (activityTemplate, activityData) => {
|
|
|
2420
2404
|
} else if (activityTemplate.type === "TRUE_FALSE") {
|
|
2421
2405
|
activityData.trueFalseMaterialMap = { trueList: [], falseList: [] };
|
|
2422
2406
|
}
|
|
2423
|
-
return retrieveCurrentDefaultDataMap(activityTemplate, activityData);
|
|
2407
|
+
return retrieveCurrentDefaultDataMap(activityTemplate.type, activityData);
|
|
2424
2408
|
};
|
|
2425
2409
|
var ignoreMathematicalExpression = (inputText) => {
|
|
2426
2410
|
return inputText.replaceAll("{", "").replaceAll("}", "").replaceAll("_", "").replaceAll("^", "").replaceAll("\\frac", "").replaceAll("\\text", "").replaceAll("\\sqrt", "");
|
|
@@ -3042,82 +3026,63 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
3042
3026
|
return constructedData;
|
|
3043
3027
|
};
|
|
3044
3028
|
var constructAnswerBasedOnData = (data) => {
|
|
3045
|
-
const answer = { data: [] };
|
|
3046
3029
|
if (Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
JSON.parse(JSON.stringify(data))
|
|
3051
|
-
)
|
|
3030
|
+
return constructActivityAnswerMap(
|
|
3031
|
+
{ type: "ORDERING" },
|
|
3032
|
+
JSON.parse(JSON.stringify(data))
|
|
3052
3033
|
);
|
|
3053
3034
|
}
|
|
3054
3035
|
if (Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
JSON.parse(JSON.stringify(data))
|
|
3059
|
-
)
|
|
3036
|
+
return constructActivityAnswerMap(
|
|
3037
|
+
{ type: "DROPDOWN" },
|
|
3038
|
+
JSON.parse(JSON.stringify(data))
|
|
3060
3039
|
);
|
|
3061
3040
|
}
|
|
3062
3041
|
if (Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
JSON.parse(JSON.stringify(data))
|
|
3067
|
-
)
|
|
3042
|
+
return constructActivityAnswerMap(
|
|
3043
|
+
{ type: "MCSA" },
|
|
3044
|
+
JSON.parse(JSON.stringify(data))
|
|
3068
3045
|
);
|
|
3069
3046
|
}
|
|
3070
3047
|
if (Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
JSON.parse(JSON.stringify(data))
|
|
3075
|
-
)
|
|
3048
|
+
return constructActivityAnswerMap(
|
|
3049
|
+
{ type: "MCMA" },
|
|
3050
|
+
JSON.parse(JSON.stringify(data))
|
|
3076
3051
|
);
|
|
3077
3052
|
}
|
|
3078
3053
|
if (Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
JSON.parse(JSON.stringify(data))
|
|
3083
|
-
)
|
|
3054
|
+
return constructActivityAnswerMap(
|
|
3055
|
+
{ type: "MATCHING" },
|
|
3056
|
+
JSON.parse(JSON.stringify(data))
|
|
3084
3057
|
);
|
|
3085
3058
|
}
|
|
3086
3059
|
if (Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
JSON.parse(JSON.stringify(data))
|
|
3091
|
-
)
|
|
3060
|
+
return constructActivityAnswerMap(
|
|
3061
|
+
{ type: "GROUPING" },
|
|
3062
|
+
JSON.parse(JSON.stringify(data))
|
|
3092
3063
|
);
|
|
3093
3064
|
}
|
|
3094
3065
|
if (Object.keys(data).find(
|
|
3095
3066
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
3096
3067
|
)) {
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
JSON.parse(JSON.stringify(data))
|
|
3101
|
-
)
|
|
3068
|
+
return constructActivityAnswerMap(
|
|
3069
|
+
{ type: "FILL_IN_THE_BLANKS" },
|
|
3070
|
+
JSON.parse(JSON.stringify(data))
|
|
3102
3071
|
);
|
|
3103
3072
|
}
|
|
3104
3073
|
if (Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
JSON.parse(JSON.stringify(data))
|
|
3109
|
-
)
|
|
3074
|
+
return constructActivityAnswerMap(
|
|
3075
|
+
{ type: "OPEN_ENDED" },
|
|
3076
|
+
JSON.parse(JSON.stringify(data))
|
|
3110
3077
|
);
|
|
3111
3078
|
}
|
|
3112
3079
|
if (Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
JSON.parse(JSON.stringify(data))
|
|
3117
|
-
)
|
|
3080
|
+
return constructActivityAnswerMap(
|
|
3081
|
+
{ type: "TRUE_FALSE" },
|
|
3082
|
+
JSON.parse(JSON.stringify(data))
|
|
3118
3083
|
);
|
|
3119
3084
|
}
|
|
3120
|
-
return
|
|
3085
|
+
return {};
|
|
3121
3086
|
};
|
|
3122
3087
|
var constructActivityItemListBodyOnly = (bodyMap) => {
|
|
3123
3088
|
const itemList = [];
|
|
@@ -4668,7 +4633,7 @@ var ShowMaterialMediaByContentType_default = ShowMaterialMediaByContentType;
|
|
|
4668
4633
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4669
4634
|
var DropdownActivityMaterialContent = ({
|
|
4670
4635
|
uniqueValue,
|
|
4671
|
-
|
|
4636
|
+
answerMap,
|
|
4672
4637
|
materialMap,
|
|
4673
4638
|
contentMap,
|
|
4674
4639
|
checkCanAnswerQuestion,
|
|
@@ -4679,27 +4644,16 @@ var DropdownActivityMaterialContent = ({
|
|
|
4679
4644
|
const [updated, setUpdated] = (0, import_react16.useState)(false);
|
|
4680
4645
|
(0, import_react15.useEffect)(() => {
|
|
4681
4646
|
if (!showCorrectAnswer) return;
|
|
4682
|
-
|
|
4683
|
-
(answerData) => answerData.type === "DROPDOWN"
|
|
4684
|
-
);
|
|
4685
|
-
if (foundAnswer.answerMap.length === 0) return;
|
|
4686
|
-
if (Object.keys(materialMap).length === 0) return;
|
|
4687
|
-
foundAnswer.answerMap = Object.keys(materialMap).map(
|
|
4647
|
+
answerMap = Object.keys(materialMap).map(
|
|
4688
4648
|
(materialMapKey, index) => Object.keys(materialMap[materialMapKey])[0]
|
|
4689
4649
|
);
|
|
4690
|
-
onChange(
|
|
4650
|
+
onChange(answerMap, 0, Object.keys(materialMap[0])[0]);
|
|
4691
4651
|
setUpdated(true);
|
|
4692
4652
|
}, [showCorrectAnswer]);
|
|
4693
4653
|
(0, import_react15.useEffect)(() => {
|
|
4694
4654
|
if (!updated) return;
|
|
4695
4655
|
setUpdated(false);
|
|
4696
4656
|
}, [updated]);
|
|
4697
|
-
const retrieveAnswerMap = () => {
|
|
4698
|
-
const foundIndex = answer.data.findIndex(
|
|
4699
|
-
(answerData) => answerData.type === "DROPDOWN"
|
|
4700
|
-
);
|
|
4701
|
-
return answer.data[foundIndex].answerMap;
|
|
4702
|
-
};
|
|
4703
4657
|
const checkAnswerState = (correctAnswer, learnerAnswer) => {
|
|
4704
4658
|
if (!isPreview) return null;
|
|
4705
4659
|
if (correctAnswer === learnerAnswer) {
|
|
@@ -4707,7 +4661,6 @@ var DropdownActivityMaterialContent = ({
|
|
|
4707
4661
|
}
|
|
4708
4662
|
return "INCORRECT";
|
|
4709
4663
|
};
|
|
4710
|
-
const answerMap = retrieveAnswerMap();
|
|
4711
4664
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-row flex-wrap items-center", children: [
|
|
4712
4665
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_dropdown_text") }) }),
|
|
4713
4666
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(DividerLine_default, {}) }),
|
|
@@ -4749,7 +4702,11 @@ var DropdownActivityMaterialContent = ({
|
|
|
4749
4702
|
value: materialOption
|
|
4750
4703
|
})),
|
|
4751
4704
|
onChange: (e) => {
|
|
4752
|
-
onChange(
|
|
4705
|
+
onChange(
|
|
4706
|
+
answerMap,
|
|
4707
|
+
materialKey,
|
|
4708
|
+
e.target.value
|
|
4709
|
+
);
|
|
4753
4710
|
}
|
|
4754
4711
|
}
|
|
4755
4712
|
) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
@@ -4779,7 +4736,7 @@ var DropdownActivityMaterialContent = ({
|
|
|
4779
4736
|
) }, index2),
|
|
4780
4737
|
onClick: (e) => {
|
|
4781
4738
|
onChange(
|
|
4782
|
-
|
|
4739
|
+
answerMap,
|
|
4783
4740
|
materialKey,
|
|
4784
4741
|
e.target.currentSrc
|
|
4785
4742
|
);
|
|
@@ -4823,7 +4780,7 @@ var DropdownActivityMaterialContent_default = DropdownActivityMaterialContent;
|
|
|
4823
4780
|
var import_react17 = require("react");
|
|
4824
4781
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
4825
4782
|
var DropdownActivityContent = ({
|
|
4826
|
-
|
|
4783
|
+
answerMap,
|
|
4827
4784
|
data,
|
|
4828
4785
|
canAnswerQuestion,
|
|
4829
4786
|
changeAnswer,
|
|
@@ -4834,35 +4791,15 @@ var DropdownActivityContent = ({
|
|
|
4834
4791
|
const contentMap = parseContentMapFromData(data);
|
|
4835
4792
|
const dropdownBodyMap = parseBodyMapFromData(data, "DROPDOWN");
|
|
4836
4793
|
const dropdownMaterialMap = parseMaterialMapFromData(data, "DROPDOWN");
|
|
4837
|
-
const [currentAnswerMap, setCurrentAnswerMap] = (0, import_react17.useState)(
|
|
4838
|
-
return retrieveCurrentAnswerMap();
|
|
4839
|
-
});
|
|
4840
|
-
function retrieveCurrentAnswerMap() {
|
|
4841
|
-
let foundIndex = answer.data.findIndex(
|
|
4842
|
-
(answerData) => answerData.type === "DROPDOWN"
|
|
4843
|
-
);
|
|
4844
|
-
return answer.data[foundIndex].answerMap;
|
|
4845
|
-
}
|
|
4794
|
+
const [currentAnswerMap, setCurrentAnswerMap] = (0, import_react17.useState)(answerMap);
|
|
4846
4795
|
(0, import_react17.useEffect)(() => {
|
|
4847
|
-
setCurrentAnswerMap(
|
|
4848
|
-
}, [
|
|
4849
|
-
const handleDropdownAnswerOnChange = (
|
|
4796
|
+
setCurrentAnswerMap(answerMap);
|
|
4797
|
+
}, [answerMap]);
|
|
4798
|
+
const handleDropdownAnswerOnChange = (answerMap2, key, value) => {
|
|
4850
4799
|
if (isPreview) return;
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
return __spreadProps(__spreadValues({}, item), {
|
|
4855
|
-
answerMap: __spreadProps(__spreadValues({}, item.answerMap), {
|
|
4856
|
-
[key]: value
|
|
4857
|
-
})
|
|
4858
|
-
});
|
|
4859
|
-
}
|
|
4860
|
-
return item;
|
|
4861
|
-
})
|
|
4862
|
-
});
|
|
4863
|
-
const newAnswerMap = __spreadProps(__spreadValues({}, currentAnswerMap), { [key]: value });
|
|
4864
|
-
setCurrentAnswerMap(newAnswerMap);
|
|
4865
|
-
changeAnswer(newAnswer);
|
|
4800
|
+
answerMap2 = __spreadProps(__spreadValues({}, currentAnswerMap), { [key]: value });
|
|
4801
|
+
setCurrentAnswerMap(answerMap2);
|
|
4802
|
+
changeAnswer(answerMap2);
|
|
4866
4803
|
};
|
|
4867
4804
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
4868
4805
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[60%]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
@@ -4880,7 +4817,7 @@ var DropdownActivityContent = ({
|
|
|
4880
4817
|
DropdownActivityMaterialContent_default,
|
|
4881
4818
|
{
|
|
4882
4819
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
4883
|
-
|
|
4820
|
+
answerMap,
|
|
4884
4821
|
materialMap: dropdownMaterialMap,
|
|
4885
4822
|
contentMap,
|
|
4886
4823
|
checkCanAnswerQuestion: canAnswerQuestion,
|
|
@@ -4925,7 +4862,7 @@ var InputWithSpecialExpression_default = InputWithSpecialExpression;
|
|
|
4925
4862
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4926
4863
|
var FillInTheBlanksActivityMaterialContent = ({
|
|
4927
4864
|
uniqueValue,
|
|
4928
|
-
|
|
4865
|
+
answerMap,
|
|
4929
4866
|
optionList,
|
|
4930
4867
|
materialMap,
|
|
4931
4868
|
contentMap,
|
|
@@ -4955,22 +4892,11 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4955
4892
|
}, [optionList]);
|
|
4956
4893
|
(0, import_react18.useEffect)(() => {
|
|
4957
4894
|
if (!showCorrectAnswer) return;
|
|
4958
|
-
|
|
4959
|
-
(answerData) => answerData.type === "FILL_IN_THE_BLANKS"
|
|
4960
|
-
);
|
|
4961
|
-
if (!foundAnswer || foundAnswer.answerMap.length === 0) return;
|
|
4962
|
-
if (Object.keys(materialMap).length === 0) return;
|
|
4963
|
-
foundAnswer.answerMap = Object.keys(materialMap).map(
|
|
4895
|
+
answerMap = Object.keys(materialMap).map(
|
|
4964
4896
|
(materialMapKey) => JSON.parse(materialMap[materialMapKey])[0]
|
|
4965
4897
|
);
|
|
4966
|
-
onChange(
|
|
4967
|
-
}, [showCorrectAnswer
|
|
4968
|
-
const retrieveAnswerMap = () => {
|
|
4969
|
-
const foundIndex = answer.data.findIndex(
|
|
4970
|
-
(answerData) => answerData.type === "FILL_IN_THE_BLANKS"
|
|
4971
|
-
);
|
|
4972
|
-
return answer.data[foundIndex].answerMap;
|
|
4973
|
-
};
|
|
4898
|
+
onChange(answerMap, 0, JSON.parse(materialMap[0])[0]);
|
|
4899
|
+
}, [showCorrectAnswer]);
|
|
4974
4900
|
const checkAnswerState = (correctAnswerList, learnerAnswer) => {
|
|
4975
4901
|
if (!isPreview) return null;
|
|
4976
4902
|
const foundIndex = correctAnswerList.findIndex(
|
|
@@ -5004,7 +4930,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
5004
4930
|
};
|
|
5005
4931
|
const handleMouseUp = () => {
|
|
5006
4932
|
if (dropTargetIndex !== null && draggedOption !== null) {
|
|
5007
|
-
onChange(
|
|
4933
|
+
onChange(answerMap, dropTargetIndex, draggedOption);
|
|
5008
4934
|
}
|
|
5009
4935
|
setDraggedOption(null);
|
|
5010
4936
|
setDropTargetIndex(null);
|
|
@@ -5035,7 +4961,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
5035
4961
|
};
|
|
5036
4962
|
const handleTouchEnd = () => {
|
|
5037
4963
|
if (dropTargetIndex !== null && draggedOption !== null) {
|
|
5038
|
-
onChange(
|
|
4964
|
+
onChange(answerMap, dropTargetIndex, draggedOption);
|
|
5039
4965
|
}
|
|
5040
4966
|
setDraggedOption(null);
|
|
5041
4967
|
setDropTargetIndex(null);
|
|
@@ -5048,11 +4974,10 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
5048
4974
|
};
|
|
5049
4975
|
const handleDropZoneClick = (index) => {
|
|
5050
4976
|
if (selectedOption !== null) {
|
|
5051
|
-
onChange(
|
|
4977
|
+
onChange(answerMap, index, selectedOption);
|
|
5052
4978
|
setSelectedOption(null);
|
|
5053
4979
|
}
|
|
5054
4980
|
};
|
|
5055
|
-
const answerMap = retrieveAnswerMap();
|
|
5056
4981
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5057
4982
|
"div",
|
|
5058
4983
|
{
|
|
@@ -5191,7 +5116,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
5191
5116
|
onClick: (e) => {
|
|
5192
5117
|
if (answerMap[materialKey]) {
|
|
5193
5118
|
e.stopPropagation();
|
|
5194
|
-
onChange(
|
|
5119
|
+
onChange(answerMap, materialKey, "");
|
|
5195
5120
|
}
|
|
5196
5121
|
},
|
|
5197
5122
|
children: answerMap[materialKey] ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
@@ -5230,7 +5155,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
5230
5155
|
className: "flex-1 cursor-pointer",
|
|
5231
5156
|
onClick: (e) => {
|
|
5232
5157
|
e.stopPropagation();
|
|
5233
|
-
onChange(
|
|
5158
|
+
onChange(answerMap, materialKey, "");
|
|
5234
5159
|
},
|
|
5235
5160
|
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5236
5161
|
ShowMaterialMediaByContentType_default,
|
|
@@ -5266,7 +5191,7 @@ var FillInTheBlanksActivityMaterialContent_default = FillInTheBlanksActivityMate
|
|
|
5266
5191
|
var import_react19 = require("react");
|
|
5267
5192
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5268
5193
|
var FillInTheBlanksActivityContent = ({
|
|
5269
|
-
|
|
5194
|
+
answerMap,
|
|
5270
5195
|
data,
|
|
5271
5196
|
canAnswerQuestion,
|
|
5272
5197
|
changeAnswer,
|
|
@@ -5284,18 +5209,10 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5284
5209
|
"FILL_IN_THE_BLANKS"
|
|
5285
5210
|
);
|
|
5286
5211
|
const fillInTheBlanksIncorrectList = data.fillInTheBlanksIncorrectList ? JSON.parse(data.fillInTheBlanksIncorrectList) : [];
|
|
5287
|
-
const [currentAnswerMap, setCurrentAnswerMap] = (0, import_react19.useState)(
|
|
5288
|
-
return retrieveCurrentAnswerMap();
|
|
5289
|
-
});
|
|
5290
|
-
function retrieveCurrentAnswerMap() {
|
|
5291
|
-
let foundIndex = answer.data.findIndex(
|
|
5292
|
-
(answerData) => answerData.type === "FILL_IN_THE_BLANKS"
|
|
5293
|
-
);
|
|
5294
|
-
return answer.data[foundIndex].answerMap;
|
|
5295
|
-
}
|
|
5212
|
+
const [currentAnswerMap, setCurrentAnswerMap] = (0, import_react19.useState)(answerMap);
|
|
5296
5213
|
(0, import_react19.useEffect)(() => {
|
|
5297
|
-
setCurrentAnswerMap(
|
|
5298
|
-
}, [
|
|
5214
|
+
setCurrentAnswerMap(answerMap);
|
|
5215
|
+
}, [answerMap]);
|
|
5299
5216
|
const constructAnswerOptionList = () => {
|
|
5300
5217
|
const optionList = [];
|
|
5301
5218
|
Object.keys(fillInTheBlanksMaterialMap).forEach((key) => {
|
|
@@ -5314,23 +5231,11 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5314
5231
|
});
|
|
5315
5232
|
return optionList;
|
|
5316
5233
|
};
|
|
5317
|
-
const handleFillInTheBlanksAnswerOnChange = (
|
|
5234
|
+
const handleFillInTheBlanksAnswerOnChange = (answerMap2, key, value) => {
|
|
5318
5235
|
if (isPreview) return;
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
return __spreadProps(__spreadValues({}, item), {
|
|
5323
|
-
answerMap: __spreadProps(__spreadValues({}, item.answerMap), {
|
|
5324
|
-
[key]: value
|
|
5325
|
-
})
|
|
5326
|
-
});
|
|
5327
|
-
}
|
|
5328
|
-
return item;
|
|
5329
|
-
})
|
|
5330
|
-
});
|
|
5331
|
-
const newAnswerMap = __spreadProps(__spreadValues({}, currentAnswerMap), { [key]: value });
|
|
5332
|
-
setCurrentAnswerMap(newAnswerMap);
|
|
5333
|
-
changeAnswer(newAnswer);
|
|
5236
|
+
answerMap2 = __spreadProps(__spreadValues({}, currentAnswerMap), { [key]: value });
|
|
5237
|
+
setCurrentAnswerMap(answerMap2);
|
|
5238
|
+
changeAnswer(answerMap2);
|
|
5334
5239
|
};
|
|
5335
5240
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
5336
5241
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[60%]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
@@ -5348,7 +5253,7 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5348
5253
|
FillInTheBlanksActivityMaterialContent_default,
|
|
5349
5254
|
{
|
|
5350
5255
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
5351
|
-
|
|
5256
|
+
answerMap,
|
|
5352
5257
|
optionList: constructAnswerOptionList(),
|
|
5353
5258
|
materialMap: fillInTheBlanksMaterialMap,
|
|
5354
5259
|
contentMap,
|
|
@@ -5368,7 +5273,7 @@ var import_react_katex5 = require("react-katex");
|
|
|
5368
5273
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5369
5274
|
var GroupingActivityMaterialContent = ({
|
|
5370
5275
|
uniqueValue,
|
|
5371
|
-
|
|
5276
|
+
answerMap,
|
|
5372
5277
|
materialMap,
|
|
5373
5278
|
contentMap,
|
|
5374
5279
|
checkCanAnswerQuestion,
|
|
@@ -5418,10 +5323,8 @@ var GroupingActivityMaterialContent = ({
|
|
|
5418
5323
|
}, [materialMap, isShuffled]);
|
|
5419
5324
|
(0, import_react20.useEffect)(() => {
|
|
5420
5325
|
if (!showCorrectAnswer) return;
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
).answerMap = materialMap;
|
|
5424
|
-
}, [showCorrectAnswer, answer, materialMap]);
|
|
5326
|
+
answerMap = materialMap;
|
|
5327
|
+
}, [showCorrectAnswer, answerMap, materialMap]);
|
|
5425
5328
|
(0, import_react20.useEffect)(() => {
|
|
5426
5329
|
if (!dropTargetKey || !dropZoneRefs.current[dropTargetKey]) return;
|
|
5427
5330
|
const dropZoneElement = dropZoneRefs.current[dropTargetKey];
|
|
@@ -5466,13 +5369,6 @@ var GroupingActivityMaterialContent = ({
|
|
|
5466
5369
|
};
|
|
5467
5370
|
requestAnimationFrame(animate);
|
|
5468
5371
|
}, [dropTargetKey]);
|
|
5469
|
-
const retrieveAnswerMap = () => {
|
|
5470
|
-
const foundIndex = answer.data.findIndex(
|
|
5471
|
-
(answerData) => answerData.type === "GROUPING"
|
|
5472
|
-
);
|
|
5473
|
-
const answerMap2 = answer.data[foundIndex].answerMap;
|
|
5474
|
-
return answerMap2;
|
|
5475
|
-
};
|
|
5476
5372
|
const retrieveFilteredMaterialList = (answerMap2) => {
|
|
5477
5373
|
const selectedValueList = [];
|
|
5478
5374
|
Object.keys(answerMap2).forEach((key) => {
|
|
@@ -5517,7 +5413,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5517
5413
|
};
|
|
5518
5414
|
const handleMouseUp = () => {
|
|
5519
5415
|
if (dropTargetKey !== null && draggedValue !== null) {
|
|
5520
|
-
onChange(
|
|
5416
|
+
onChange(answerMap, dropTargetKey, draggedValue, null);
|
|
5521
5417
|
}
|
|
5522
5418
|
setDraggedValue(null);
|
|
5523
5419
|
setDropTargetKey(null);
|
|
@@ -5549,7 +5445,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5549
5445
|
};
|
|
5550
5446
|
const handleTouchEnd = () => {
|
|
5551
5447
|
if (dropTargetKey !== null && draggedValue !== null) {
|
|
5552
|
-
onChange(
|
|
5448
|
+
onChange(answerMap, dropTargetKey, draggedValue, null);
|
|
5553
5449
|
}
|
|
5554
5450
|
setDraggedValue(null);
|
|
5555
5451
|
setDropTargetKey(null);
|
|
@@ -5563,11 +5459,10 @@ var GroupingActivityMaterialContent = ({
|
|
|
5563
5459
|
};
|
|
5564
5460
|
const handleDropZoneClick = (answerMapKey) => {
|
|
5565
5461
|
if (selectedValue !== null) {
|
|
5566
|
-
onChange(
|
|
5462
|
+
onChange(answerMap, answerMapKey, selectedValue, null);
|
|
5567
5463
|
setSelectedValue(null);
|
|
5568
5464
|
}
|
|
5569
5465
|
};
|
|
5570
|
-
const answerMap = retrieveAnswerMap();
|
|
5571
5466
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5572
5467
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5573
5468
|
draggedValue && mousePosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
@@ -5715,7 +5610,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5715
5610
|
e.stopPropagation();
|
|
5716
5611
|
if (checkCanAnswerQuestion()) {
|
|
5717
5612
|
onChange(
|
|
5718
|
-
|
|
5613
|
+
answerMap,
|
|
5719
5614
|
answerMapKey,
|
|
5720
5615
|
null,
|
|
5721
5616
|
answerMapIndex
|
|
@@ -5762,7 +5657,7 @@ var GroupingActivityMaterialContent_default = GroupingActivityMaterialContent;
|
|
|
5762
5657
|
// src/components/activities/GroupingActivityContent.tsx
|
|
5763
5658
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5764
5659
|
var GroupingActivityContent = ({
|
|
5765
|
-
|
|
5660
|
+
answerMap,
|
|
5766
5661
|
data,
|
|
5767
5662
|
canAnswerQuestion,
|
|
5768
5663
|
changeAnswer,
|
|
@@ -5772,18 +5667,14 @@ var GroupingActivityContent = ({
|
|
|
5772
5667
|
const contentMap = parseContentMapFromData(data);
|
|
5773
5668
|
const groupingBodyMap = parseBodyMapFromData(data, "GROUPING");
|
|
5774
5669
|
const groupingMaterialMap = parseMaterialMapFromData(data, "GROUPING");
|
|
5775
|
-
const handleGroupingAnswerOnChange = (
|
|
5670
|
+
const handleGroupingAnswerOnChange = (answerMap2, key, value, index) => {
|
|
5776
5671
|
if (isPreview) return;
|
|
5777
|
-
let foundIndex = answer2.data.findIndex(
|
|
5778
|
-
(answerData) => answerData.type === "GROUPING"
|
|
5779
|
-
);
|
|
5780
|
-
const answerMap = answer2.data[foundIndex].answerMap;
|
|
5781
5672
|
if (value) {
|
|
5782
|
-
|
|
5673
|
+
answerMap2[key].push(value);
|
|
5783
5674
|
} else {
|
|
5784
|
-
|
|
5675
|
+
answerMap2[key].splice(index, 1);
|
|
5785
5676
|
}
|
|
5786
|
-
changeAnswer(
|
|
5677
|
+
changeAnswer(answerMap2);
|
|
5787
5678
|
};
|
|
5788
5679
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
5789
5680
|
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
@@ -5798,7 +5689,7 @@ var GroupingActivityContent = ({
|
|
|
5798
5689
|
GroupingActivityMaterialContent_default,
|
|
5799
5690
|
{
|
|
5800
5691
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
5801
|
-
|
|
5692
|
+
answerMap,
|
|
5802
5693
|
materialMap: groupingMaterialMap,
|
|
5803
5694
|
contentMap,
|
|
5804
5695
|
checkCanAnswerQuestion: canAnswerQuestion,
|
|
@@ -5817,7 +5708,7 @@ var import_react_katex6 = require("react-katex");
|
|
|
5817
5708
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5818
5709
|
var MatchingActivityMaterialContent = ({
|
|
5819
5710
|
uniqueValue,
|
|
5820
|
-
|
|
5711
|
+
answerMap,
|
|
5821
5712
|
materialMap,
|
|
5822
5713
|
contentMap,
|
|
5823
5714
|
checkCanAnswerQuestion,
|
|
@@ -5865,10 +5756,8 @@ var MatchingActivityMaterialContent = ({
|
|
|
5865
5756
|
}, [materialMap, isShuffled]);
|
|
5866
5757
|
(0, import_react21.useEffect)(() => {
|
|
5867
5758
|
if (!showCorrectAnswer) return;
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
).answerMap = materialMap;
|
|
5871
|
-
}, [showCorrectAnswer, answer, materialMap]);
|
|
5759
|
+
answerMap = materialMap;
|
|
5760
|
+
}, [showCorrectAnswer]);
|
|
5872
5761
|
(0, import_react21.useEffect)(() => {
|
|
5873
5762
|
if (!dropTargetKey || !dropZoneRefs.current[dropTargetKey]) return;
|
|
5874
5763
|
const dropZoneElement = dropZoneRefs.current[dropTargetKey];
|
|
@@ -5913,12 +5802,6 @@ var MatchingActivityMaterialContent = ({
|
|
|
5913
5802
|
};
|
|
5914
5803
|
requestAnimationFrame(animate);
|
|
5915
5804
|
}, [dropTargetKey]);
|
|
5916
|
-
const retrieveAnswerMap = () => {
|
|
5917
|
-
const foundIndex = answer.data.findIndex(
|
|
5918
|
-
(answerData) => answerData.type === "MATCHING"
|
|
5919
|
-
);
|
|
5920
|
-
return answer.data[foundIndex].answerMap;
|
|
5921
|
-
};
|
|
5922
5805
|
const retrieveFilteredMaterialList = (answerMap2) => {
|
|
5923
5806
|
const selectedValueList = [];
|
|
5924
5807
|
Object.keys(answerMap2).forEach((key) => {
|
|
@@ -5957,7 +5840,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5957
5840
|
};
|
|
5958
5841
|
const handleMouseUp = () => {
|
|
5959
5842
|
if (dropTargetKey !== null && draggedValue !== null) {
|
|
5960
|
-
onChange(
|
|
5843
|
+
onChange(answerMap, dropTargetKey, draggedValue);
|
|
5961
5844
|
}
|
|
5962
5845
|
setDraggedValue(null);
|
|
5963
5846
|
setDropTargetKey(null);
|
|
@@ -5989,7 +5872,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5989
5872
|
};
|
|
5990
5873
|
const handleTouchEnd = () => {
|
|
5991
5874
|
if (dropTargetKey !== null && draggedValue !== null) {
|
|
5992
|
-
onChange(
|
|
5875
|
+
onChange(answerMap, dropTargetKey, draggedValue);
|
|
5993
5876
|
}
|
|
5994
5877
|
setDraggedValue(null);
|
|
5995
5878
|
setDropTargetKey(null);
|
|
@@ -6003,11 +5886,10 @@ var MatchingActivityMaterialContent = ({
|
|
|
6003
5886
|
};
|
|
6004
5887
|
const handleDropZoneClick = (answerMapKey) => {
|
|
6005
5888
|
if (selectedValue !== null) {
|
|
6006
|
-
onChange(
|
|
5889
|
+
onChange(answerMap, answerMapKey, selectedValue);
|
|
6007
5890
|
setSelectedValue(null);
|
|
6008
5891
|
}
|
|
6009
5892
|
};
|
|
6010
|
-
const answerMap = retrieveAnswerMap();
|
|
6011
5893
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
6012
5894
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
6013
5895
|
draggedValue && mousePosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
@@ -6154,7 +6036,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
6154
6036
|
onClick: (e) => {
|
|
6155
6037
|
e.stopPropagation();
|
|
6156
6038
|
if (checkCanAnswerQuestion() && answerMap[answerMapKey]) {
|
|
6157
|
-
onChange(
|
|
6039
|
+
onChange(answerMap, answerMapKey, null);
|
|
6158
6040
|
setSelectedValue(null);
|
|
6159
6041
|
}
|
|
6160
6042
|
},
|
|
@@ -6189,7 +6071,7 @@ var MatchingActivityMaterialContent_default = MatchingActivityMaterialContent;
|
|
|
6189
6071
|
// src/components/activities/MatchingActivityContent.tsx
|
|
6190
6072
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6191
6073
|
var MatchingActivityContent = ({
|
|
6192
|
-
|
|
6074
|
+
answerMap,
|
|
6193
6075
|
data,
|
|
6194
6076
|
canAnswerQuestion,
|
|
6195
6077
|
changeAnswer,
|
|
@@ -6199,14 +6081,10 @@ var MatchingActivityContent = ({
|
|
|
6199
6081
|
const contentMap = parseContentMapFromData(data);
|
|
6200
6082
|
const matchingBodyMap = parseBodyMapFromData(data, "MATCHING");
|
|
6201
6083
|
const matchingMaterialMap = parseMaterialMapFromData(data, "MATCHING");
|
|
6202
|
-
const handleMatchingAnswerOnChange = (
|
|
6084
|
+
const handleMatchingAnswerOnChange = (answerMap2, key, value) => {
|
|
6203
6085
|
if (isPreview) return;
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
);
|
|
6207
|
-
const answerMap = answer2.data[foundIndex].answerMap;
|
|
6208
|
-
answerMap[key] = value;
|
|
6209
|
-
changeAnswer(answer2);
|
|
6086
|
+
answerMap2[key] = value;
|
|
6087
|
+
changeAnswer(answerMap2);
|
|
6210
6088
|
};
|
|
6211
6089
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
6212
6090
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
@@ -6221,7 +6099,7 @@ var MatchingActivityContent = ({
|
|
|
6221
6099
|
MatchingActivityMaterialContent_default,
|
|
6222
6100
|
{
|
|
6223
6101
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
6224
|
-
|
|
6102
|
+
answerMap,
|
|
6225
6103
|
materialMap: matchingMaterialMap,
|
|
6226
6104
|
contentMap,
|
|
6227
6105
|
checkCanAnswerQuestion: canAnswerQuestion,
|
|
@@ -6239,19 +6117,13 @@ var import_react_katex7 = require("react-katex");
|
|
|
6239
6117
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
6240
6118
|
var MCMAActivityMaterialContent = ({
|
|
6241
6119
|
uniqueValue,
|
|
6242
|
-
|
|
6120
|
+
answerMap,
|
|
6243
6121
|
materialMap,
|
|
6244
6122
|
contentMap,
|
|
6245
6123
|
checkCanAnswerQuestion,
|
|
6246
6124
|
onChange,
|
|
6247
6125
|
isPreview
|
|
6248
6126
|
}) => {
|
|
6249
|
-
const retrieveAnswerMap = () => {
|
|
6250
|
-
const foundIndex = answer.data.findIndex(
|
|
6251
|
-
(answerData) => answerData.type === "MCMA"
|
|
6252
|
-
);
|
|
6253
|
-
return answer.data[foundIndex].answerMap;
|
|
6254
|
-
};
|
|
6255
6127
|
const retrieveCorrectAnswerList = () => {
|
|
6256
6128
|
return JSON.parse(Object.keys(materialMap)[0]);
|
|
6257
6129
|
};
|
|
@@ -6266,7 +6138,6 @@ var MCMAActivityMaterialContent = ({
|
|
|
6266
6138
|
}
|
|
6267
6139
|
return "INCORRECT";
|
|
6268
6140
|
};
|
|
6269
|
-
const answerMap = retrieveAnswerMap();
|
|
6270
6141
|
const correctAnswerList = retrieveCorrectAnswerList();
|
|
6271
6142
|
return Object.keys(materialMap).map((materialKey, index) => {
|
|
6272
6143
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex flex-row items-center my-1", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex-1 flex flex-col justify-center border-catchup-lighter-gray rounded-catchup-xlarge px-5 md:px-0", children: [
|
|
@@ -6290,7 +6161,7 @@ var MCMAActivityMaterialContent = ({
|
|
|
6290
6161
|
{
|
|
6291
6162
|
className: `w-full flex flex-row items-center justify-center cursor-pointer my-2 gap-x-2 ${learnerAnswerState === "EMPTY" && foundIndex !== -1 || learnerAnswerState === "CORRECT" ? "border-2 border-catchup-green rounded-catchup-xlarge p-2" : learnerAnswerState === "INCORRECT" ? "border-2 border-catchup-red rounded-catchup-xlarge p-2" : ""}`,
|
|
6292
6163
|
onClick: () => {
|
|
6293
|
-
onChange(
|
|
6164
|
+
onChange(answerMap, materialKey, materialSubKey);
|
|
6294
6165
|
},
|
|
6295
6166
|
children: [
|
|
6296
6167
|
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
@@ -6344,7 +6215,7 @@ var MCMAActivityMaterialContent_default = MCMAActivityMaterialContent;
|
|
|
6344
6215
|
// src/components/activities/MCMAActivityContent.tsx
|
|
6345
6216
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6346
6217
|
var MCMAActivityContent = ({
|
|
6347
|
-
|
|
6218
|
+
answerMap,
|
|
6348
6219
|
data,
|
|
6349
6220
|
canAnswerQuestion,
|
|
6350
6221
|
changeAnswer,
|
|
@@ -6354,21 +6225,17 @@ var MCMAActivityContent = ({
|
|
|
6354
6225
|
const contentMap = parseContentMapFromData(data);
|
|
6355
6226
|
const MCMABodyMap = parseBodyMapFromData(data, "MCMA");
|
|
6356
6227
|
const MCMAMaterialMap = parseMaterialMapFromData(data, "MCMA");
|
|
6357
|
-
const handleMCMAAnswerOnChange = (
|
|
6228
|
+
const handleMCMAAnswerOnChange = (answerMap2, key, value) => {
|
|
6358
6229
|
if (isPreview) return;
|
|
6359
|
-
|
|
6360
|
-
(answerData) => answerData.type === "MCMA"
|
|
6361
|
-
);
|
|
6362
|
-
const answerMap = answer2.data[foundIndex].answerMap;
|
|
6363
|
-
const foundSubIndex = answerMap[key].findIndex(
|
|
6230
|
+
const foundSubIndex = answerMap2[key].findIndex(
|
|
6364
6231
|
(answerMaterialKey) => answerMaterialKey === value
|
|
6365
6232
|
);
|
|
6366
6233
|
if (foundSubIndex === -1) {
|
|
6367
|
-
|
|
6234
|
+
answerMap2[key].push(value);
|
|
6368
6235
|
} else {
|
|
6369
|
-
|
|
6236
|
+
answerMap2[key].splice(foundSubIndex, 1);
|
|
6370
6237
|
}
|
|
6371
|
-
changeAnswer(
|
|
6238
|
+
changeAnswer(answerMap2);
|
|
6372
6239
|
};
|
|
6373
6240
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
6374
6241
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[60%]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ActivityBodyContent_default, { bodyMap: MCMABodyMap, templateType: "MCMA" }) }),
|
|
@@ -6378,7 +6245,7 @@ var MCMAActivityContent = ({
|
|
|
6378
6245
|
MCMAActivityMaterialContent_default,
|
|
6379
6246
|
{
|
|
6380
6247
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
6381
|
-
|
|
6248
|
+
answerMap,
|
|
6382
6249
|
materialMap: MCMAMaterialMap,
|
|
6383
6250
|
contentMap,
|
|
6384
6251
|
checkCanAnswerQuestion: canAnswerQuestion,
|
|
@@ -6395,19 +6262,13 @@ var import_react_katex8 = require("react-katex");
|
|
|
6395
6262
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6396
6263
|
var MCSAActivityMaterialContent = ({
|
|
6397
6264
|
uniqueValue,
|
|
6398
|
-
|
|
6265
|
+
answerMap,
|
|
6399
6266
|
materialMap,
|
|
6400
6267
|
contentMap,
|
|
6401
6268
|
checkCanAnswerQuestion,
|
|
6402
6269
|
onChange,
|
|
6403
6270
|
isPreview
|
|
6404
6271
|
}) => {
|
|
6405
|
-
const retrieveAnswerMap = () => {
|
|
6406
|
-
const foundIndex = answer.data.findIndex(
|
|
6407
|
-
(answerData) => answerData.type === "MCSA"
|
|
6408
|
-
);
|
|
6409
|
-
return answer.data[foundIndex].answerMap;
|
|
6410
|
-
};
|
|
6411
6272
|
const retrieveCorrectAnswer = () => {
|
|
6412
6273
|
return Object.keys(materialMap)[0];
|
|
6413
6274
|
};
|
|
@@ -6419,7 +6280,6 @@ var MCSAActivityMaterialContent = ({
|
|
|
6419
6280
|
}
|
|
6420
6281
|
return "INCORRECT";
|
|
6421
6282
|
};
|
|
6422
|
-
const answerMap = retrieveAnswerMap();
|
|
6423
6283
|
const correctAnswer = retrieveCorrectAnswer();
|
|
6424
6284
|
return Object.keys(materialMap).map((materialKey, index) => {
|
|
6425
6285
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex flex-row items-center my-1", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex-1 flex flex-col justify-center border-catchup-lighter-gray rounded-catchup-xlarge px-5 md:px-0", children: [
|
|
@@ -6441,7 +6301,7 @@ var MCSAActivityMaterialContent = ({
|
|
|
6441
6301
|
{
|
|
6442
6302
|
className: `w-full flex flex-row items-center justify-center cursor-pointer my-2 gap-x-2 ${learnerAnswerState === "EMPTY" && materialSubKey === correctAnswer || learnerAnswerState === "CORRECT" ? "border-2 border-catchup-green rounded-catchup-xlarge p-2" : learnerAnswerState === "INCORRECT" ? "border-2 border-catchup-red rounded-catchup-xlarge p-2" : ""}`,
|
|
6443
6303
|
onClick: () => {
|
|
6444
|
-
onChange(
|
|
6304
|
+
onChange(answerMap, materialKey, materialSubKey);
|
|
6445
6305
|
},
|
|
6446
6306
|
children: [
|
|
6447
6307
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
@@ -6497,7 +6357,7 @@ var MCSAActivityMaterialContent_default = MCSAActivityMaterialContent;
|
|
|
6497
6357
|
// src/components/activities/MCSAActivityContent.tsx
|
|
6498
6358
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6499
6359
|
var MCSAActivityContent = ({
|
|
6500
|
-
|
|
6360
|
+
answerMap,
|
|
6501
6361
|
data,
|
|
6502
6362
|
canAnswerQuestion,
|
|
6503
6363
|
changeAnswer,
|
|
@@ -6507,14 +6367,10 @@ var MCSAActivityContent = ({
|
|
|
6507
6367
|
const contentMap = parseContentMapFromData(data);
|
|
6508
6368
|
const MCSABodyMap = parseBodyMapFromData(data, "MCSA");
|
|
6509
6369
|
const MCSAMaterialMap = parseMaterialMapFromData(data, "MCSA");
|
|
6510
|
-
const handleMCSAAnswerOnChange = (
|
|
6370
|
+
const handleMCSAAnswerOnChange = (answerMap2, key, value) => {
|
|
6511
6371
|
if (isPreview) return;
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
);
|
|
6515
|
-
const answerMap = answer2.data[foundIndex].answerMap;
|
|
6516
|
-
answerMap[key] = value;
|
|
6517
|
-
changeAnswer(answer2);
|
|
6372
|
+
answerMap2[key] = value;
|
|
6373
|
+
changeAnswer(answerMap2);
|
|
6518
6374
|
};
|
|
6519
6375
|
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
6520
6376
|
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[60%]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(ActivityBodyContent_default, { bodyMap: MCSABodyMap, templateType: "MCSA" }) }),
|
|
@@ -6524,7 +6380,7 @@ var MCSAActivityContent = ({
|
|
|
6524
6380
|
MCSAActivityMaterialContent_default,
|
|
6525
6381
|
{
|
|
6526
6382
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
6527
|
-
|
|
6383
|
+
answerMap,
|
|
6528
6384
|
materialMap: MCSAMaterialMap,
|
|
6529
6385
|
contentMap,
|
|
6530
6386
|
checkCanAnswerQuestion: canAnswerQuestion,
|
|
@@ -6567,26 +6423,11 @@ var retrieveDocumentTypeFromExtension = (format) => {
|
|
|
6567
6423
|
// src/components/activities/material-contents/OpenEndedActivityMaterialContent.tsx
|
|
6568
6424
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6569
6425
|
var OpenEndedActivityMaterialContent = ({
|
|
6570
|
-
|
|
6426
|
+
answerMap,
|
|
6571
6427
|
contentMap,
|
|
6572
6428
|
checkCanAnswerQuestion,
|
|
6573
6429
|
onChange
|
|
6574
6430
|
}) => {
|
|
6575
|
-
const retrieveAnswer = () => {
|
|
6576
|
-
if (!answer)
|
|
6577
|
-
return {
|
|
6578
|
-
answerMap: {
|
|
6579
|
-
ANSWER: ""
|
|
6580
|
-
}
|
|
6581
|
-
};
|
|
6582
|
-
return answer.data.find(
|
|
6583
|
-
(answerData) => answerData.type === "OPEN_ENDED"
|
|
6584
|
-
);
|
|
6585
|
-
};
|
|
6586
|
-
const retrieveAnswerMap = () => {
|
|
6587
|
-
const { answerMap: answerMap2 } = retrieveAnswer();
|
|
6588
|
-
return answerMap2;
|
|
6589
|
-
};
|
|
6590
6431
|
const RenderTextContent = (answerMap2) => {
|
|
6591
6432
|
const answerMapAnswer = answerMap2["ANSWER"];
|
|
6592
6433
|
let documentType = "TEXT";
|
|
@@ -6626,7 +6467,7 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6626
6467
|
useMinHeight: true,
|
|
6627
6468
|
onChange: (e) => {
|
|
6628
6469
|
if (checkCanAnswerQuestion()) {
|
|
6629
|
-
onChange(
|
|
6470
|
+
onChange(answerMap2, e.target.value);
|
|
6630
6471
|
}
|
|
6631
6472
|
}
|
|
6632
6473
|
}
|
|
@@ -6660,7 +6501,6 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6660
6501
|
}
|
|
6661
6502
|
) });
|
|
6662
6503
|
};
|
|
6663
|
-
const answerMap = retrieveAnswerMap();
|
|
6664
6504
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "", children: [
|
|
6665
6505
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_open_ended_text") }) }),
|
|
6666
6506
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DividerLine_default, {}) }),
|
|
@@ -6672,7 +6512,7 @@ var OpenEndedActivityMaterialContent_default = OpenEndedActivityMaterialContent;
|
|
|
6672
6512
|
// src/components/activities/OpenEndedActivityContent.tsx
|
|
6673
6513
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6674
6514
|
var OpenEndedActivityContent = ({
|
|
6675
|
-
|
|
6515
|
+
answerMap,
|
|
6676
6516
|
data,
|
|
6677
6517
|
changeAnswer,
|
|
6678
6518
|
canAnswerQuestion,
|
|
@@ -6682,14 +6522,10 @@ var OpenEndedActivityContent = ({
|
|
|
6682
6522
|
}) => {
|
|
6683
6523
|
const contentMap = parseContentMapFromData(data);
|
|
6684
6524
|
const openEndedBodyMap = parseBodyMapFromData(data, "OPEN_ENDED");
|
|
6685
|
-
const handleOpenEndedAnswerOnChange = (
|
|
6525
|
+
const handleOpenEndedAnswerOnChange = (answerMap2, value) => {
|
|
6686
6526
|
if (isPreview) return;
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
);
|
|
6690
|
-
const answerMap = answer2.data[foundIndex].answerMap;
|
|
6691
|
-
answerMap["ANSWER"] = value;
|
|
6692
|
-
changeAnswer(answer2);
|
|
6527
|
+
answerMap2["ANSWER"] = value;
|
|
6528
|
+
changeAnswer(answerMap2);
|
|
6693
6529
|
};
|
|
6694
6530
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
6695
6531
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
@@ -6717,7 +6553,7 @@ var OpenEndedActivityContent = ({
|
|
|
6717
6553
|
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6718
6554
|
OpenEndedActivityMaterialContent_default,
|
|
6719
6555
|
{
|
|
6720
|
-
|
|
6556
|
+
answerMap,
|
|
6721
6557
|
contentMap,
|
|
6722
6558
|
checkCanAnswerQuestion: canAnswerQuestion,
|
|
6723
6559
|
onChange: handleOpenEndedAnswerOnChange
|
|
@@ -6771,7 +6607,7 @@ var useScreenSize_default = useScreenSize;
|
|
|
6771
6607
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6772
6608
|
var OrderingActivityMaterialContent = ({
|
|
6773
6609
|
uniqueValue,
|
|
6774
|
-
|
|
6610
|
+
answerMap,
|
|
6775
6611
|
materialMap,
|
|
6776
6612
|
contentMap,
|
|
6777
6613
|
checkCanAnswerQuestion,
|
|
@@ -6806,19 +6642,10 @@ var OrderingActivityMaterialContent = ({
|
|
|
6806
6642
|
}, [screenSize]);
|
|
6807
6643
|
(0, import_react23.useEffect)(() => {
|
|
6808
6644
|
if (!showCorrectAnswer) return;
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
).answerMap;
|
|
6812
|
-
Object.keys(answerMap2).forEach((answerKey, index) => {
|
|
6813
|
-
answerMap2[answerKey] = index;
|
|
6645
|
+
Object.keys(answerMap).forEach((answerKey, index) => {
|
|
6646
|
+
answerMap[answerKey] = index;
|
|
6814
6647
|
});
|
|
6815
6648
|
}, [showCorrectAnswer]);
|
|
6816
|
-
const retrieveAnswerMap = () => {
|
|
6817
|
-
const foundIndex = answer.data.findIndex(
|
|
6818
|
-
(answerData) => answerData.type === "ORDERING"
|
|
6819
|
-
);
|
|
6820
|
-
return answer.data[foundIndex].answerMap;
|
|
6821
|
-
};
|
|
6822
6649
|
const checkAnswerState = (correctAnswer, learnerAnswer) => {
|
|
6823
6650
|
if (!isPreview) return null;
|
|
6824
6651
|
if (correctAnswer === learnerAnswer) {
|
|
@@ -6867,7 +6694,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6867
6694
|
};
|
|
6868
6695
|
const handleMouseUp = () => {
|
|
6869
6696
|
if (dropTargetKey !== null && draggedKey !== null && dropTargetKey !== draggedKey) {
|
|
6870
|
-
onChange(
|
|
6697
|
+
onChange(answerMap, draggedKey, dropTargetKey);
|
|
6871
6698
|
}
|
|
6872
6699
|
setDraggedKey(null);
|
|
6873
6700
|
setDropTargetKey(null);
|
|
@@ -6899,7 +6726,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6899
6726
|
};
|
|
6900
6727
|
const handleTouchEnd = () => {
|
|
6901
6728
|
if (dropTargetKey !== null && draggedKey !== null && dropTargetKey !== draggedKey) {
|
|
6902
|
-
onChange(
|
|
6729
|
+
onChange(answerMap, draggedKey, dropTargetKey);
|
|
6903
6730
|
}
|
|
6904
6731
|
setDraggedKey(null);
|
|
6905
6732
|
setDropTargetKey(null);
|
|
@@ -6913,12 +6740,11 @@ var OrderingActivityMaterialContent = ({
|
|
|
6913
6740
|
} else if (selectedKey === materialKey) {
|
|
6914
6741
|
setSelectedKey(null);
|
|
6915
6742
|
} else {
|
|
6916
|
-
onChange(
|
|
6743
|
+
onChange(answerMap, selectedKey, materialKey);
|
|
6917
6744
|
setSelectedKey(null);
|
|
6918
6745
|
}
|
|
6919
6746
|
setDraggedKey(null);
|
|
6920
6747
|
};
|
|
6921
|
-
const answerMap = retrieveAnswerMap();
|
|
6922
6748
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6923
6749
|
"div",
|
|
6924
6750
|
{
|
|
@@ -7056,7 +6882,7 @@ var OrderingActivityMaterialContent_default = OrderingActivityMaterialContent;
|
|
|
7056
6882
|
// src/components/activities/OrderingActivityContent.tsx
|
|
7057
6883
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7058
6884
|
var OrderingActivityContent = ({
|
|
7059
|
-
|
|
6885
|
+
answerMap,
|
|
7060
6886
|
data,
|
|
7061
6887
|
canAnswerQuestion,
|
|
7062
6888
|
changeAnswer,
|
|
@@ -7067,16 +6893,12 @@ var OrderingActivityContent = ({
|
|
|
7067
6893
|
const contentMap = parseContentMapFromData(data);
|
|
7068
6894
|
const orderingBodyMap = parseBodyMapFromData(data, "ORDERING");
|
|
7069
6895
|
const orderingMaterialMap = parseMaterialMapFromData(data, "ORDERING");
|
|
7070
|
-
const handleOrderingAnswerOnChange = (
|
|
6896
|
+
const handleOrderingAnswerOnChange = (answerMap2, primaryKey, secondaryKey) => {
|
|
7071
6897
|
if (isPreview) return;
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
const prevValue = answerMap[primaryKey];
|
|
7077
|
-
answerMap[primaryKey] = answerMap[secondaryKey];
|
|
7078
|
-
answerMap[secondaryKey] = prevValue;
|
|
7079
|
-
changeAnswer(answer2);
|
|
6898
|
+
const prevValue = answerMap2[primaryKey];
|
|
6899
|
+
answerMap2[primaryKey] = answerMap2[secondaryKey];
|
|
6900
|
+
answerMap2[secondaryKey] = prevValue;
|
|
6901
|
+
changeAnswer(answerMap2);
|
|
7080
6902
|
};
|
|
7081
6903
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
7082
6904
|
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
@@ -7091,7 +6913,7 @@ var OrderingActivityContent = ({
|
|
|
7091
6913
|
OrderingActivityMaterialContent_default,
|
|
7092
6914
|
{
|
|
7093
6915
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
7094
|
-
|
|
6916
|
+
answerMap,
|
|
7095
6917
|
materialMap: orderingMaterialMap,
|
|
7096
6918
|
contentMap,
|
|
7097
6919
|
checkCanAnswerQuestion: canAnswerQuestion,
|
|
@@ -7110,7 +6932,7 @@ var import_react_katex10 = require("react-katex");
|
|
|
7110
6932
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7111
6933
|
var TrueFalseActivityMaterialContent = ({
|
|
7112
6934
|
uniqueValue,
|
|
7113
|
-
|
|
6935
|
+
answerMap,
|
|
7114
6936
|
materialMap,
|
|
7115
6937
|
contentMap,
|
|
7116
6938
|
checkCanAnswerQuestion,
|
|
@@ -7118,7 +6940,6 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
7118
6940
|
isPreview,
|
|
7119
6941
|
showCorrectAnswer
|
|
7120
6942
|
}) => {
|
|
7121
|
-
const { screenSize } = useScreenSize_default();
|
|
7122
6943
|
const [shuffleOptionList, setShuffleOptionList] = (0, import_react24.useState)([]);
|
|
7123
6944
|
(0, import_react24.useEffect)(() => {
|
|
7124
6945
|
const optionList = [];
|
|
@@ -7132,26 +6953,8 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
7132
6953
|
}, []);
|
|
7133
6954
|
(0, import_react24.useEffect)(() => {
|
|
7134
6955
|
if (!showCorrectAnswer) return;
|
|
7135
|
-
|
|
7136
|
-
(answerData) => answerData.type === "TRUE_FALSE"
|
|
7137
|
-
).answerMap = materialMap;
|
|
6956
|
+
answerMap = materialMap;
|
|
7138
6957
|
}, [showCorrectAnswer]);
|
|
7139
|
-
const retrieveAnswer = () => {
|
|
7140
|
-
if (!answer)
|
|
7141
|
-
return {
|
|
7142
|
-
answerMap: {
|
|
7143
|
-
trueList: [],
|
|
7144
|
-
falseList: []
|
|
7145
|
-
}
|
|
7146
|
-
};
|
|
7147
|
-
return answer.data.find(
|
|
7148
|
-
(answerData) => answerData.type === "TRUE_FALSE"
|
|
7149
|
-
);
|
|
7150
|
-
};
|
|
7151
|
-
const retrieveAnswerMap = () => {
|
|
7152
|
-
const { answerMap: answerMap2 } = retrieveAnswer();
|
|
7153
|
-
return answerMap2;
|
|
7154
|
-
};
|
|
7155
6958
|
const checkAnswerState = (correctAnswer, learnerAnswer) => {
|
|
7156
6959
|
if (!isPreview) return null;
|
|
7157
6960
|
if (correctAnswer === learnerAnswer) {
|
|
@@ -7159,7 +6962,6 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
7159
6962
|
}
|
|
7160
6963
|
return "INCORRECT";
|
|
7161
6964
|
};
|
|
7162
|
-
const answerMap = retrieveAnswerMap();
|
|
7163
6965
|
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "", children: [
|
|
7164
6966
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_true_false_text") }) }),
|
|
7165
6967
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DividerLine_default, {}) }),
|
|
@@ -7209,7 +7011,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
7209
7011
|
alt: "checkbox",
|
|
7210
7012
|
size: "small",
|
|
7211
7013
|
onClick: () => {
|
|
7212
|
-
onChange(
|
|
7014
|
+
onChange(answerMap, "TRUE", shuffleOption);
|
|
7213
7015
|
}
|
|
7214
7016
|
}
|
|
7215
7017
|
) }) }),
|
|
@@ -7220,7 +7022,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
7220
7022
|
alt: "checkbox",
|
|
7221
7023
|
size: "small",
|
|
7222
7024
|
onClick: () => {
|
|
7223
|
-
onChange(
|
|
7025
|
+
onChange(answerMap, "FALSE", shuffleOption);
|
|
7224
7026
|
}
|
|
7225
7027
|
}
|
|
7226
7028
|
) }) })
|
|
@@ -7246,7 +7048,7 @@ var TrueFalseActivityMaterialContent_default = TrueFalseActivityMaterialContent;
|
|
|
7246
7048
|
// src/components/activities/TrueFalseActivityContent.tsx
|
|
7247
7049
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7248
7050
|
var TrueFalseActivityContent = ({
|
|
7249
|
-
|
|
7051
|
+
answerMap,
|
|
7250
7052
|
data,
|
|
7251
7053
|
canAnswerQuestion,
|
|
7252
7054
|
changeAnswer,
|
|
@@ -7257,43 +7059,36 @@ var TrueFalseActivityContent = ({
|
|
|
7257
7059
|
const contentMap = parseContentMapFromData(data);
|
|
7258
7060
|
const trueFalseBodyMap = parseBodyMapFromData(data, "TRUE_FALSE");
|
|
7259
7061
|
const trueFalseMaterialMap = parseMaterialMapFromData(data, "TRUE_FALSE");
|
|
7260
|
-
const
|
|
7261
|
-
let foundIndex = answer.data.findIndex(
|
|
7262
|
-
(answerData) => answerData.type === "TRUE_FALSE"
|
|
7263
|
-
);
|
|
7264
|
-
return answer.data[foundIndex].answerMap;
|
|
7265
|
-
};
|
|
7266
|
-
const handleTrueFalseAnswerOnChange = (answer2, key, value) => {
|
|
7062
|
+
const handleTrueFalseAnswerOnChange = (answerMap2, key, value) => {
|
|
7267
7063
|
if (isPreview) return;
|
|
7268
|
-
const answerMap = retrieveCurrentAnswerMap();
|
|
7269
7064
|
if (key === "TRUE") {
|
|
7270
|
-
const foundFalseIndex =
|
|
7065
|
+
const foundFalseIndex = answerMap2.falseList.findIndex(
|
|
7271
7066
|
(item) => item === value
|
|
7272
7067
|
);
|
|
7273
7068
|
if (foundFalseIndex !== -1) {
|
|
7274
|
-
|
|
7069
|
+
answerMap2.falseList.splice(foundFalseIndex, 1);
|
|
7275
7070
|
}
|
|
7276
|
-
const foundTrueIndex =
|
|
7071
|
+
const foundTrueIndex = answerMap2.falseList.findIndex(
|
|
7277
7072
|
(item) => item === value
|
|
7278
7073
|
);
|
|
7279
7074
|
if (foundTrueIndex === -1) {
|
|
7280
|
-
|
|
7075
|
+
answerMap2.trueList.push(value);
|
|
7281
7076
|
}
|
|
7282
7077
|
} else if (key === "FALSE") {
|
|
7283
|
-
const foundTrueIndex =
|
|
7078
|
+
const foundTrueIndex = answerMap2.trueList.findIndex(
|
|
7284
7079
|
(item) => item === value
|
|
7285
7080
|
);
|
|
7286
7081
|
if (foundTrueIndex !== -1) {
|
|
7287
|
-
|
|
7082
|
+
answerMap2.trueList.splice(foundTrueIndex, 1);
|
|
7288
7083
|
}
|
|
7289
|
-
const foundFalseIndex =
|
|
7084
|
+
const foundFalseIndex = answerMap2.falseList.findIndex(
|
|
7290
7085
|
(item) => item === value
|
|
7291
7086
|
);
|
|
7292
7087
|
if (foundFalseIndex === -1) {
|
|
7293
|
-
|
|
7088
|
+
answerMap2.falseList.push(value);
|
|
7294
7089
|
}
|
|
7295
7090
|
}
|
|
7296
|
-
changeAnswer(
|
|
7091
|
+
changeAnswer(answerMap2);
|
|
7297
7092
|
};
|
|
7298
7093
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
7299
7094
|
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[40%]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
@@ -7309,7 +7104,7 @@ var TrueFalseActivityContent = ({
|
|
|
7309
7104
|
TrueFalseActivityMaterialContent_default,
|
|
7310
7105
|
{
|
|
7311
7106
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
7312
|
-
|
|
7107
|
+
answerMap,
|
|
7313
7108
|
materialMap: trueFalseMaterialMap,
|
|
7314
7109
|
contentMap,
|
|
7315
7110
|
checkCanAnswerQuestion: canAnswerQuestion,
|
|
@@ -7537,7 +7332,7 @@ var ActivityPreviewByData = ({
|
|
|
7537
7332
|
}
|
|
7538
7333
|
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
7539
7334
|
if (!data) return;
|
|
7540
|
-
const
|
|
7335
|
+
const answerMap = constructAnswerBasedOnData(data);
|
|
7541
7336
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
|
|
7542
7337
|
showType ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
7543
7338
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mb-4", children: [
|
|
@@ -7558,7 +7353,7 @@ var ActivityPreviewByData = ({
|
|
|
7558
7353
|
selectedType ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "", children: selectedType === "ORDERING" && data["orderingBodyMap"] != null && data["orderingMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7559
7354
|
OrderingActivityContent_default,
|
|
7560
7355
|
{
|
|
7561
|
-
|
|
7356
|
+
answerMap,
|
|
7562
7357
|
changeAnswer: () => {
|
|
7563
7358
|
},
|
|
7564
7359
|
canAnswerQuestion: () => {
|
|
@@ -7572,7 +7367,7 @@ var ActivityPreviewByData = ({
|
|
|
7572
7367
|
) : selectedType === "DROPDOWN" && data["dropdownBodyMap"] != null && data["dropdownMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7573
7368
|
DropdownActivityContent_default,
|
|
7574
7369
|
{
|
|
7575
|
-
|
|
7370
|
+
answerMap,
|
|
7576
7371
|
changeAnswer: () => {
|
|
7577
7372
|
},
|
|
7578
7373
|
canAnswerQuestion: () => {
|
|
@@ -7586,7 +7381,7 @@ var ActivityPreviewByData = ({
|
|
|
7586
7381
|
) : selectedType === "MCSA" && data["MCSABodyMap"] != null && data["MCSAMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7587
7382
|
MCSAActivityContent_default,
|
|
7588
7383
|
{
|
|
7589
|
-
|
|
7384
|
+
answerMap,
|
|
7590
7385
|
changeAnswer: () => {
|
|
7591
7386
|
},
|
|
7592
7387
|
canAnswerQuestion: () => {
|
|
@@ -7600,7 +7395,7 @@ var ActivityPreviewByData = ({
|
|
|
7600
7395
|
) : selectedType === "MCMA" && data["MCMABodyMap"] != null && data["MCMAMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7601
7396
|
MCMAActivityContent_default,
|
|
7602
7397
|
{
|
|
7603
|
-
|
|
7398
|
+
answerMap,
|
|
7604
7399
|
changeAnswer: () => {
|
|
7605
7400
|
},
|
|
7606
7401
|
canAnswerQuestion: () => {
|
|
@@ -7614,7 +7409,7 @@ var ActivityPreviewByData = ({
|
|
|
7614
7409
|
) : selectedType === "MATCHING" && data["matchingBodyMap"] != null && data["matchingMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7615
7410
|
MatchingActivityContent_default,
|
|
7616
7411
|
{
|
|
7617
|
-
|
|
7412
|
+
answerMap,
|
|
7618
7413
|
changeAnswer: () => {
|
|
7619
7414
|
},
|
|
7620
7415
|
canAnswerQuestion: () => {
|
|
@@ -7627,7 +7422,7 @@ var ActivityPreviewByData = ({
|
|
|
7627
7422
|
) : selectedType === "GROUPING" && data["groupingBodyMap"] != null && data["groupingMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7628
7423
|
GroupingActivityContent_default,
|
|
7629
7424
|
{
|
|
7630
|
-
|
|
7425
|
+
answerMap,
|
|
7631
7426
|
changeAnswer: () => {
|
|
7632
7427
|
},
|
|
7633
7428
|
canAnswerQuestion: () => {
|
|
@@ -7640,7 +7435,7 @@ var ActivityPreviewByData = ({
|
|
|
7640
7435
|
) : selectedType === "FILL_IN_THE_BLANKS" && data["fillInTheBlanksBodyMap"] != null && data["fillInTheBlanksMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7641
7436
|
FillInTheBlanksActivityContent_default,
|
|
7642
7437
|
{
|
|
7643
|
-
|
|
7438
|
+
answerMap,
|
|
7644
7439
|
changeAnswer: () => {
|
|
7645
7440
|
},
|
|
7646
7441
|
canAnswerQuestion: () => {
|
|
@@ -7654,7 +7449,7 @@ var ActivityPreviewByData = ({
|
|
|
7654
7449
|
) : selectedType === "OPEN_ENDED" && data["openEndedBodyMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7655
7450
|
OpenEndedActivityContent_default,
|
|
7656
7451
|
{
|
|
7657
|
-
|
|
7452
|
+
answerMap,
|
|
7658
7453
|
canAnswerQuestion: () => false,
|
|
7659
7454
|
changeAnswer: () => {
|
|
7660
7455
|
},
|
|
@@ -7666,7 +7461,7 @@ var ActivityPreviewByData = ({
|
|
|
7666
7461
|
) : selectedType === "TRUE_FALSE" && data["trueFalseBodyMap"] != null && data["trueFalseMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7667
7462
|
TrueFalseActivityContent_default,
|
|
7668
7463
|
{
|
|
7669
|
-
|
|
7464
|
+
answerMap,
|
|
7670
7465
|
changeAnswer: () => {
|
|
7671
7466
|
},
|
|
7672
7467
|
canAnswerQuestion: () => {
|
|
@@ -7699,135 +7494,157 @@ var ActivityPreviewByData_default = ActivityPreviewByData;
|
|
|
7699
7494
|
// src/components/activities/ActivityPreviewByAnswerData.tsx
|
|
7700
7495
|
var import_react26 = require("react");
|
|
7701
7496
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
7497
|
+
var ACTIVITY_TEMPLATE_LIST = [
|
|
7498
|
+
{ type: "ORDERING", materialMap: "orderingMaterialMap" },
|
|
7499
|
+
{ type: "DROPDOWN", materialMap: "dropdownMaterialMap" },
|
|
7500
|
+
{ type: "MCSA", materialMap: "MCSAMaterialMap" },
|
|
7501
|
+
{ type: "MCMA", materialMap: "MCMAMaterialMap" },
|
|
7502
|
+
{ type: "MATCHING", materialMap: "matchingMaterialMap" },
|
|
7503
|
+
{ type: "GROUPING", materialMap: "groupingMaterialMap" },
|
|
7504
|
+
{
|
|
7505
|
+
type: "FILL_IN_THE_BLANKS",
|
|
7506
|
+
materialMap: "fillInTheBlanksMaterialMap"
|
|
7507
|
+
},
|
|
7508
|
+
{ type: "OPEN_ENDED", materialMap: "openEndedMaterialMap" },
|
|
7509
|
+
{ type: "TRUE_FALSE", materialMap: "trueFalseMaterialMap" }
|
|
7510
|
+
];
|
|
7702
7511
|
var ActivityPreviewByAnswerData = ({
|
|
7703
7512
|
data,
|
|
7513
|
+
answerType = null,
|
|
7704
7514
|
showType = true,
|
|
7705
7515
|
showDescription = true,
|
|
7706
|
-
|
|
7707
|
-
typeOptionList = [],
|
|
7516
|
+
lockedTypeList = [],
|
|
7708
7517
|
showSolution = false,
|
|
7709
7518
|
showEvaluationRubric = false,
|
|
7710
7519
|
showDifficulty = true,
|
|
7711
7520
|
isFullScreen = false,
|
|
7712
7521
|
showCorrectAnswer = false
|
|
7713
7522
|
}) => {
|
|
7714
|
-
var _a;
|
|
7715
|
-
const [key, setKey] = (0, import_react26.useState)((/* @__PURE__ */ new Date()).getTime());
|
|
7716
7523
|
const [selectedType, setSelectedType] = (0, import_react26.useState)(null);
|
|
7717
7524
|
const [optionList, setOptionList] = (0, import_react26.useState)([]);
|
|
7718
|
-
const [
|
|
7525
|
+
const [answerMapMap, setAnswerMapMap] = (0, import_react26.useState)({});
|
|
7526
|
+
const [activityTemplateTypeList, setActivityTemplateTypeList] = (0, import_react26.useState)([]);
|
|
7719
7527
|
(0, import_react26.useEffect)(() => {
|
|
7720
7528
|
if (!data) return;
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
if (
|
|
7725
|
-
|
|
7726
|
-
(
|
|
7529
|
+
let currentActivityTemplateMapList = JSON.parse(
|
|
7530
|
+
JSON.stringify(ACTIVITY_TEMPLATE_LIST)
|
|
7531
|
+
);
|
|
7532
|
+
if (lockedTypeList.length > 0) {
|
|
7533
|
+
currentActivityTemplateMapList = currentActivityTemplateMapList.filter(
|
|
7534
|
+
(activityTemplateMap) => lockedTypeList.includes(activityTemplateMap.type)
|
|
7727
7535
|
);
|
|
7728
|
-
return foundAnswer || null;
|
|
7729
7536
|
}
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
const constructAnswerBasedOnData2 = () => {
|
|
7735
|
-
const newAnswer = { data: [] };
|
|
7736
|
-
const activityTypes = [
|
|
7737
|
-
{ type: "ORDERING", materialMap: "orderingMaterialMap" },
|
|
7738
|
-
{ type: "DROPDOWN", materialMap: "dropdownMaterialMap" },
|
|
7739
|
-
{ type: "MCSA", materialMap: "MCSAMaterialMap" },
|
|
7740
|
-
{ type: "MCMA", materialMap: "MCMAMaterialMap" },
|
|
7741
|
-
{ type: "MATCHING", materialMap: "matchingMaterialMap" },
|
|
7742
|
-
{ type: "GROUPING", materialMap: "groupingMaterialMap" },
|
|
7743
|
-
{
|
|
7744
|
-
type: "FILL_IN_THE_BLANKS",
|
|
7745
|
-
materialMap: "fillInTheBlanksMaterialMap"
|
|
7746
|
-
},
|
|
7747
|
-
{ type: "OPEN_ENDED", materialMap: "openEndedMaterialMap" },
|
|
7748
|
-
{ type: "TRUE_FALSE", materialMap: "trueFalseMaterialMap" }
|
|
7749
|
-
];
|
|
7750
|
-
activityTypes.forEach(({ type, materialMap }) => {
|
|
7751
|
-
if (data[materialMap]) {
|
|
7752
|
-
const foundAnswer = checkAnswerMapExists(type);
|
|
7753
|
-
const answerItem = foundAnswer || constructActivityAnswerMap(
|
|
7754
|
-
{ type },
|
|
7755
|
-
JSON.parse(JSON.stringify(data))
|
|
7756
|
-
);
|
|
7757
|
-
newAnswer.data.push(answerItem);
|
|
7758
|
-
}
|
|
7759
|
-
});
|
|
7760
|
-
setAnswer(newAnswer);
|
|
7761
|
-
if (newAnswer.data.length > 0) {
|
|
7762
|
-
if (lockedType && newAnswer.data.find((item) => item.type === lockedType)) {
|
|
7763
|
-
setSelectedType(lockedType);
|
|
7764
|
-
} else {
|
|
7765
|
-
setSelectedType(newAnswer.data[0].type);
|
|
7766
|
-
}
|
|
7537
|
+
const currentActivityTemplateTypeList = [];
|
|
7538
|
+
for (const activityTemplateMap of currentActivityTemplateMapList) {
|
|
7539
|
+
if (data[activityTemplateMap.materialMap]) {
|
|
7540
|
+
currentActivityTemplateTypeList.push(activityTemplateMap);
|
|
7767
7541
|
}
|
|
7768
|
-
};
|
|
7769
|
-
constructAnswerBasedOnData2();
|
|
7770
|
-
}, [data, lockedType]);
|
|
7771
|
-
(0, import_react26.useEffect)(() => {
|
|
7772
|
-
if (!data || !answer.data.length) return;
|
|
7773
|
-
let currentTypeOptionList = typeOptionList || answer.data.map((item) => ({
|
|
7774
|
-
id: item.type,
|
|
7775
|
-
text: i18n_default.t(item.type)
|
|
7776
|
-
}));
|
|
7777
|
-
if (lockedType) {
|
|
7778
|
-
currentTypeOptionList = currentTypeOptionList.filter(
|
|
7779
|
-
(typeOption) => typeOption.id === lockedType
|
|
7780
|
-
);
|
|
7781
7542
|
}
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7785
|
-
|
|
7786
|
-
|
|
7543
|
+
setActivityTemplateTypeList(currentActivityTemplateMapList);
|
|
7544
|
+
}, [data, answerType, lockedTypeList]);
|
|
7545
|
+
(0, import_react26.useEffect)(() => {
|
|
7546
|
+
if (activityTemplateTypeList.length === 0) return;
|
|
7547
|
+
const currentOptionList = [];
|
|
7548
|
+
for (const activityTemplateType of activityTemplateTypeList) {
|
|
7549
|
+
const currentTypeOption = {
|
|
7550
|
+
id: activityTemplateType.type,
|
|
7551
|
+
value: i18n_default.t(activityTemplateType.type)
|
|
7552
|
+
};
|
|
7553
|
+
if (showDifficulty) {
|
|
7554
|
+
currentTypeOption.subText = i18n_default.t(
|
|
7555
|
+
retrieveDifficultyByActivityTypeFromData(
|
|
7556
|
+
activityTemplateType.type,
|
|
7557
|
+
data
|
|
7787
7558
|
)
|
|
7788
|
-
|
|
7789
|
-
|
|
7790
|
-
|
|
7791
|
-
setOptionList(currentTypeOptionList);
|
|
7559
|
+
);
|
|
7560
|
+
}
|
|
7561
|
+
currentOptionList.push(currentTypeOption);
|
|
7792
7562
|
}
|
|
7793
|
-
|
|
7563
|
+
setOptionList(currentOptionList);
|
|
7564
|
+
}, [activityTemplateTypeList, showDifficulty]);
|
|
7565
|
+
(0, import_react26.useEffect)(() => {
|
|
7566
|
+
if (optionList.length === 0) return;
|
|
7567
|
+
setSelectedType(optionList[0].id);
|
|
7568
|
+
}, [optionList]);
|
|
7569
|
+
(0, import_react26.useEffect)(() => {
|
|
7570
|
+
if (activityTemplateTypeList.length === 0) return;
|
|
7571
|
+
const currentAnswerMapMap = {};
|
|
7572
|
+
for (const activityTemplateMap of activityTemplateTypeList) {
|
|
7573
|
+
if (answerType === activityTemplateMap.type) {
|
|
7574
|
+
currentAnswerMapMap[activityTemplateMap.type] = data.answerMap;
|
|
7575
|
+
} else {
|
|
7576
|
+
currentAnswerMapMap[activityTemplateMap.type] = constructActivityAnswerMap(
|
|
7577
|
+
{ type: activityTemplateMap.type },
|
|
7578
|
+
JSON.parse(JSON.stringify(data))
|
|
7579
|
+
);
|
|
7580
|
+
}
|
|
7581
|
+
}
|
|
7582
|
+
setAnswerMapMap(currentAnswerMapMap);
|
|
7583
|
+
}, [activityTemplateTypeList]);
|
|
7794
7584
|
const RenderSelectedActivityContent = () => {
|
|
7585
|
+
if (!selectedType) return null;
|
|
7795
7586
|
const commonProps = {
|
|
7796
|
-
|
|
7587
|
+
answerMap: answerMapMap[selectedType],
|
|
7797
7588
|
data,
|
|
7798
7589
|
canAnswerQuestion: () => true,
|
|
7799
|
-
// changeAnswer: (newAnswer: Answer) =>
|
|
7800
|
-
// setAnswer(JSON.parse(JSON.stringify(newAnswer))),
|
|
7801
7590
|
changeAnswer: () => {
|
|
7802
7591
|
},
|
|
7803
7592
|
isPreview: true,
|
|
7804
7593
|
showCorrectAnswer,
|
|
7805
7594
|
isFullScreen
|
|
7806
7595
|
};
|
|
7596
|
+
const isEmpty = answerMapMap[selectedType].isEmpty;
|
|
7807
7597
|
switch (selectedType) {
|
|
7808
7598
|
case "ORDERING":
|
|
7809
|
-
return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7599
|
+
return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7600
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7601
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(OrderingActivityContent_default, __spreadValues({}, commonProps))
|
|
7602
|
+
] }) : null;
|
|
7810
7603
|
case "DROPDOWN":
|
|
7811
|
-
return data.dropdownBodyMap && data.dropdownMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7604
|
+
return data.dropdownBodyMap && data.dropdownMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7605
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7606
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DropdownActivityContent_default, __spreadValues({}, commonProps))
|
|
7607
|
+
] }) : null;
|
|
7812
7608
|
case "MCSA":
|
|
7813
|
-
return data.MCSABodyMap && data.MCSAMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7609
|
+
return data.MCSABodyMap && data.MCSAMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7610
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7611
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MCSAActivityContent_default, __spreadValues({}, commonProps))
|
|
7612
|
+
] }) : null;
|
|
7814
7613
|
case "MCMA":
|
|
7815
|
-
return data.MCMABodyMap && data.MCMAMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7614
|
+
return data.MCMABodyMap && data.MCMAMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7615
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7616
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MCMAActivityContent_default, __spreadValues({}, commonProps))
|
|
7617
|
+
] }) : null;
|
|
7816
7618
|
case "MATCHING":
|
|
7817
|
-
return data.matchingBodyMap && data.matchingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7619
|
+
return data.matchingBodyMap && data.matchingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7620
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7621
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MatchingActivityContent_default, __spreadValues({}, commonProps))
|
|
7622
|
+
] }) : null;
|
|
7818
7623
|
case "GROUPING":
|
|
7819
|
-
return data.groupingBodyMap && data.groupingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7624
|
+
return data.groupingBodyMap && data.groupingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7625
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7626
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(GroupingActivityContent_default, __spreadValues({}, commonProps))
|
|
7627
|
+
] }) : null;
|
|
7820
7628
|
case "FILL_IN_THE_BLANKS":
|
|
7821
|
-
return data.fillInTheBlanksBodyMap && data.fillInTheBlanksMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7629
|
+
return data.fillInTheBlanksBodyMap && data.fillInTheBlanksMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7630
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7631
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FillInTheBlanksActivityContent_default, __spreadValues({}, commonProps))
|
|
7632
|
+
] }) : null;
|
|
7822
7633
|
case "OPEN_ENDED":
|
|
7823
|
-
return data.openEndedBodyMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7634
|
+
return data.openEndedBodyMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7635
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7636
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7637
|
+
OpenEndedActivityContent_default,
|
|
7638
|
+
__spreadProps(__spreadValues({}, commonProps), {
|
|
7639
|
+
showMaterialContent: true
|
|
7640
|
+
})
|
|
7641
|
+
)
|
|
7642
|
+
] }) : null;
|
|
7829
7643
|
case "TRUE_FALSE":
|
|
7830
|
-
return data.trueFalseBodyMap && data.trueFalseMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7644
|
+
return data.trueFalseBodyMap && data.trueFalseMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7645
|
+
isEmpty && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}),
|
|
7646
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TrueFalseActivityContent_default, __spreadValues({}, commonProps))
|
|
7647
|
+
] }) : null;
|
|
7831
7648
|
default:
|
|
7832
7649
|
return null;
|
|
7833
7650
|
}
|
|
@@ -7850,10 +7667,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7850
7667
|
] }),
|
|
7851
7668
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DividerLine_default, {})
|
|
7852
7669
|
] }) : null,
|
|
7853
|
-
/* @__PURE__ */ (0, import_jsx_runtime48.
|
|
7854
|
-
((_a = answer == null ? void 0 : answer.data[0]) == null ? void 0 : _a.isEmpty) ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}) : null,
|
|
7855
|
-
selectedType ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { children: RenderSelectedActivityContent() }, selectedType) : null
|
|
7856
|
-
] }),
|
|
7670
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "flex flex-col my-2 w-full p-5", children: RenderSelectedActivityContent() }),
|
|
7857
7671
|
selectedType && showSolution ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "my-4", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7858
7672
|
ActivitySolutionContent_default,
|
|
7859
7673
|
{
|
|
@@ -7868,7 +7682,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7868
7682
|
data
|
|
7869
7683
|
}
|
|
7870
7684
|
) }) : null
|
|
7871
|
-
] }
|
|
7685
|
+
] });
|
|
7872
7686
|
};
|
|
7873
7687
|
var ActivityPreviewByAnswerData_default = ActivityPreviewByAnswerData;
|
|
7874
7688
|
|
|
@@ -8852,7 +8666,7 @@ var retrieveProvinceNameOptionList = () => {
|
|
|
8852
8666
|
{ parent: "TURKEY", value: "BURSA", text: "Bursa", code: "16" },
|
|
8853
8667
|
// { parent: "TURKEY", value: "CANAKKALE", text: "Çanakkale", code: "17" },
|
|
8854
8668
|
// { parent: "TURKEY", value: "CANKIRI", text: "Çankırı", code: "18" },
|
|
8855
|
-
|
|
8669
|
+
{ parent: "TURKEY", value: "CORUM", text: "\xC7orum", code: "19" },
|
|
8856
8670
|
{ parent: "TURKEY", value: "DENIZLI", text: "Denizli", code: "20" },
|
|
8857
8671
|
{ parent: "TURKEY", value: "DIYARBAKIR", text: "Diyarbak\u0131r", code: "21" },
|
|
8858
8672
|
// { parent: "TURKEY", value: "EDIRNE", text: "Edirne", code: "22" },
|