catchup-library-web 1.20.35 → 1.21.0
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.js +1056 -823
- package/dist/index.mjs +971 -738
- package/package.json +2 -6
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +62 -2
- package/src/components/activities/material-contents/GroupingActivityMaterialContent.tsx +363 -203
- package/src/components/activities/material-contents/MatchingActivityMaterialContent.tsx +318 -172
- package/src/components/activities/material-contents/OrderingActivityMaterialContent.tsx +76 -2
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent2.tsx +0 -306
- package/src/components/activities/material-contents/OrderingActivityMaterialContent2.tsx +0 -231
- package/src/components/dnds/DraggableDroppableItem.tsx +0 -60
- package/src/components/dnds/DraggableItem.tsx +0 -39
- package/src/components/dnds/DroppableItem.tsx +0 -33
package/dist/index.js
CHANGED
|
@@ -4907,6 +4907,10 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4907
4907
|
null
|
|
4908
4908
|
);
|
|
4909
4909
|
const dragElementRef = (0, import_react18.useRef)(null);
|
|
4910
|
+
const [mousePosition, setMousePosition] = (0, import_react18.useState)({
|
|
4911
|
+
x: 0,
|
|
4912
|
+
y: 0
|
|
4913
|
+
});
|
|
4910
4914
|
const [touchPosition, setTouchPosition] = (0, import_react18.useState)({
|
|
4911
4915
|
x: 0,
|
|
4912
4916
|
y: 0
|
|
@@ -4949,6 +4953,19 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4949
4953
|
e.preventDefault();
|
|
4950
4954
|
setDraggedOption(option);
|
|
4951
4955
|
setSelectedOption(null);
|
|
4956
|
+
setMousePosition({ x: e.clientX, y: e.clientY });
|
|
4957
|
+
};
|
|
4958
|
+
const handleMouseMove = (e) => {
|
|
4959
|
+
if (!draggedOption) return;
|
|
4960
|
+
setMousePosition({ x: e.clientX, y: e.clientY });
|
|
4961
|
+
const elementUnder = document.elementFromPoint(e.clientX, e.clientY);
|
|
4962
|
+
const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-drop-zone]");
|
|
4963
|
+
if (dropZone) {
|
|
4964
|
+
const dropIndex = dropZone.getAttribute("data-drop-zone");
|
|
4965
|
+
setDropTargetIndex(dropIndex);
|
|
4966
|
+
} else {
|
|
4967
|
+
setDropTargetIndex(null);
|
|
4968
|
+
}
|
|
4952
4969
|
};
|
|
4953
4970
|
const handleMouseUp = () => {
|
|
4954
4971
|
if (dropTargetIndex !== null && draggedOption !== null) {
|
|
@@ -4956,6 +4973,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4956
4973
|
}
|
|
4957
4974
|
setDraggedOption(null);
|
|
4958
4975
|
setDropTargetIndex(null);
|
|
4976
|
+
setMousePosition({ x: 0, y: 0 });
|
|
4959
4977
|
};
|
|
4960
4978
|
const handleTouchStart = (e, option, element) => {
|
|
4961
4979
|
const touch = e.touches[0];
|
|
@@ -4987,6 +5005,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4987
5005
|
setDraggedOption(null);
|
|
4988
5006
|
setDropTargetIndex(null);
|
|
4989
5007
|
setDraggedElement(null);
|
|
5008
|
+
setTouchPosition({ x: 0, y: 0 });
|
|
4990
5009
|
};
|
|
4991
5010
|
const handleSelectOption = (option) => {
|
|
4992
5011
|
setSelectedOption(option);
|
|
@@ -4999,178 +5018,212 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4999
5018
|
}
|
|
5000
5019
|
};
|
|
5001
5020
|
const answerMap = retrieveAnswerMap();
|
|
5002
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
},
|
|
5014
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5015
|
-
InputWithSpecialExpression_default,
|
|
5021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
5022
|
+
"div",
|
|
5023
|
+
{
|
|
5024
|
+
className: "flex flex-row flex-wrap items-center",
|
|
5025
|
+
onMouseMove: handleMouseMove,
|
|
5026
|
+
onMouseUp: handleMouseUp,
|
|
5027
|
+
children: [
|
|
5028
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_fill_in_the_blanks_text") }) }),
|
|
5029
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DividerLine_default, {}) }),
|
|
5030
|
+
draggedOption && mousePosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5031
|
+
"div",
|
|
5016
5032
|
{
|
|
5017
|
-
|
|
5018
|
-
|
|
5033
|
+
className: "fixed pointer-events-none z-50 opacity-80",
|
|
5034
|
+
style: {
|
|
5035
|
+
left: `${mousePosition.x}px`,
|
|
5036
|
+
top: `${mousePosition.y}px`,
|
|
5037
|
+
transform: "translate(-50%, -50%)"
|
|
5038
|
+
},
|
|
5039
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5040
|
+
InputWithSpecialExpression_default,
|
|
5041
|
+
{
|
|
5042
|
+
value: draggedOption,
|
|
5043
|
+
showSpecialOnly: false
|
|
5044
|
+
}
|
|
5045
|
+
) }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5046
|
+
ShowMaterialMediaByContentType_default,
|
|
5047
|
+
{
|
|
5048
|
+
contentType: contentMap.type,
|
|
5049
|
+
src: draggedOption,
|
|
5050
|
+
canFullScreen: false
|
|
5051
|
+
},
|
|
5052
|
+
uniqueValue
|
|
5053
|
+
) })
|
|
5019
5054
|
}
|
|
5020
|
-
)
|
|
5021
|
-
|
|
5055
|
+
),
|
|
5056
|
+
draggedOption && touchPosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5057
|
+
"div",
|
|
5022
5058
|
{
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5050
|
-
"div",
|
|
5059
|
+
className: "fixed pointer-events-none z-50 opacity-80",
|
|
5060
|
+
style: {
|
|
5061
|
+
left: `${touchPosition.x}px`,
|
|
5062
|
+
top: `${touchPosition.y}px`,
|
|
5063
|
+
transform: "translate(-50%, -50%)"
|
|
5064
|
+
},
|
|
5065
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5066
|
+
InputWithSpecialExpression_default,
|
|
5067
|
+
{
|
|
5068
|
+
value: draggedOption,
|
|
5069
|
+
showSpecialOnly: false
|
|
5070
|
+
}
|
|
5071
|
+
) }) }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5072
|
+
ShowMaterialMediaByContentType_default,
|
|
5073
|
+
{
|
|
5074
|
+
contentType: contentMap.type,
|
|
5075
|
+
src: draggedOption,
|
|
5076
|
+
canFullScreen: false
|
|
5077
|
+
},
|
|
5078
|
+
uniqueValue
|
|
5079
|
+
) })
|
|
5080
|
+
}
|
|
5081
|
+
),
|
|
5082
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full flex flex-row flex-wrap gap-x-2 gap-y-2 my-2", children: shuffleOptionList.map(
|
|
5083
|
+
(option, index) => checkAnswerProvided(answerMap, option) ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "opacity-30", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5084
|
+
ShowMaterialMediaByContentType_default,
|
|
5051
5085
|
{
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
showSpecialOnly: false
|
|
5059
|
-
}
|
|
5060
|
-
) })
|
|
5061
|
-
}
|
|
5062
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5086
|
+
contentType: contentMap.type,
|
|
5087
|
+
src: option,
|
|
5088
|
+
canFullScreen: true
|
|
5089
|
+
},
|
|
5090
|
+
`${uniqueValue}-${index}`
|
|
5091
|
+
) }, index) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5063
5092
|
"div",
|
|
5064
5093
|
{
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
canFullScreen: true
|
|
5073
|
-
},
|
|
5074
|
-
`${uniqueValue}-${index}`
|
|
5075
|
-
)
|
|
5076
|
-
}
|
|
5077
|
-
)
|
|
5078
|
-
},
|
|
5079
|
-
index
|
|
5080
|
-
)
|
|
5081
|
-
) }),
|
|
5082
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full flex flex-row flex-wrap", onMouseUp: handleMouseUp, children: Object.keys(answerMap).map((materialKey, index) => {
|
|
5083
|
-
const learnerAnswerState = checkAnswerState(
|
|
5084
|
-
JSON.parse(materialMap[materialKey]),
|
|
5085
|
-
answerMap[materialKey]
|
|
5086
|
-
);
|
|
5087
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5088
|
-
"div",
|
|
5089
|
-
{
|
|
5090
|
-
"data-drop-zone": materialKey,
|
|
5091
|
-
onMouseEnter: () => draggedOption && setDropTargetIndex(materialKey),
|
|
5092
|
-
onMouseLeave: () => setDropTargetIndex(null),
|
|
5093
|
-
onClick: () => handleDropZoneClick(materialKey),
|
|
5094
|
-
className: `${dropTargetIndex === materialKey ? "ring-2 ring-blue-400 bg-blue-50" : ""} transition-all duration-200 rounded-lg`,
|
|
5095
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
|
|
5096
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "my-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "text-xl", children: [
|
|
5097
|
-
parseFloat(materialKey) + 1,
|
|
5098
|
-
"."
|
|
5099
|
-
] }) }),
|
|
5100
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1", children: checkCanAnswerQuestion() ? contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "relative", children: [
|
|
5101
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5094
|
+
ref: draggedOption === option ? dragElementRef : null,
|
|
5095
|
+
className: `${draggedOption === option ? "opacity-40" : selectedOption === option ? "ring-2 ring-blue-500" : "opacity-100"} transition-all duration-200`,
|
|
5096
|
+
onMouseDown: (e) => handleMouseDown(e, option),
|
|
5097
|
+
onTouchStart: (e) => handleTouchStart(e, option, e.currentTarget),
|
|
5098
|
+
onTouchMove: handleTouchMove,
|
|
5099
|
+
onTouchEnd: handleTouchEnd,
|
|
5100
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5102
5101
|
"div",
|
|
5103
5102
|
{
|
|
5104
|
-
className:
|
|
5105
|
-
onClick: (
|
|
5106
|
-
|
|
5107
|
-
e.stopPropagation();
|
|
5108
|
-
onChange(answer, materialKey, "");
|
|
5109
|
-
}
|
|
5110
|
-
},
|
|
5111
|
-
children: answerMap[materialKey] ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5103
|
+
className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge cursor-pointer select-none",
|
|
5104
|
+
onClick: () => handleSelectOption(option),
|
|
5105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5112
5106
|
InputWithSpecialExpression_default,
|
|
5113
5107
|
{
|
|
5114
|
-
value:
|
|
5108
|
+
value: option,
|
|
5115
5109
|
showSpecialOnly: false
|
|
5116
5110
|
}
|
|
5117
|
-
)
|
|
5111
|
+
) })
|
|
5118
5112
|
}
|
|
5119
|
-
)
|
|
5120
|
-
|
|
5121
|
-
BaseImage_default,
|
|
5122
|
-
{
|
|
5123
|
-
src: "/icons/checkbox.webp",
|
|
5124
|
-
alt: "checkbox",
|
|
5125
|
-
size: "small"
|
|
5126
|
-
}
|
|
5127
|
-
) }) : learnerAnswerState === "INCORRECT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5128
|
-
BaseImage_default,
|
|
5113
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5114
|
+
"div",
|
|
5129
5115
|
{
|
|
5130
|
-
|
|
5131
|
-
|
|
5132
|
-
|
|
5116
|
+
className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge cursor-pointer select-none",
|
|
5117
|
+
onClick: () => handleSelectOption(option),
|
|
5118
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5119
|
+
ShowMaterialMediaByContentType_default,
|
|
5120
|
+
{
|
|
5121
|
+
contentType: contentMap.type,
|
|
5122
|
+
src: option,
|
|
5123
|
+
canFullScreen: true
|
|
5124
|
+
},
|
|
5125
|
+
`${uniqueValue}-${index}`
|
|
5126
|
+
)
|
|
5133
5127
|
}
|
|
5134
|
-
)
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
)
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5128
|
+
)
|
|
5129
|
+
},
|
|
5130
|
+
index
|
|
5131
|
+
)
|
|
5132
|
+
) }),
|
|
5133
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(answerMap).map((materialKey, index) => {
|
|
5134
|
+
const learnerAnswerState = checkAnswerState(
|
|
5135
|
+
JSON.parse(materialMap[materialKey]),
|
|
5136
|
+
answerMap[materialKey]
|
|
5137
|
+
);
|
|
5138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5139
|
+
"div",
|
|
5140
|
+
{
|
|
5141
|
+
"data-drop-zone": materialKey,
|
|
5142
|
+
onMouseEnter: () => draggedOption && setDropTargetIndex(materialKey),
|
|
5143
|
+
onMouseLeave: () => setDropTargetIndex(null),
|
|
5144
|
+
onClick: () => handleDropZoneClick(materialKey),
|
|
5145
|
+
className: `${dropTargetIndex === materialKey ? "ring-2 ring-blue-400 bg-blue-50" : ""} transition-all duration-200 rounded-lg`,
|
|
5146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
|
|
5147
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "my-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "text-xl", children: [
|
|
5148
|
+
parseFloat(materialKey) + 1,
|
|
5149
|
+
"."
|
|
5150
|
+
] }) }),
|
|
5151
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1", children: checkCanAnswerQuestion() ? contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "relative", children: [
|
|
5152
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5153
|
+
"div",
|
|
5154
|
+
{
|
|
5155
|
+
className: `w-full min-h-[44px] border rounded-lg ${answerMap[materialKey] ? "border-catchup-blue-400 px-2 cursor-pointer" : "bg-catchup-gray-50 border-catchup-gray-200 border-dashed py-2 px-4"}`,
|
|
5156
|
+
onClick: (e) => {
|
|
5157
|
+
if (answerMap[materialKey]) {
|
|
5158
|
+
e.stopPropagation();
|
|
5159
|
+
onChange(answer, materialKey, "");
|
|
5160
|
+
}
|
|
5161
|
+
},
|
|
5162
|
+
children: answerMap[materialKey] ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5163
|
+
InputWithSpecialExpression_default,
|
|
5164
|
+
{
|
|
5165
|
+
value: answerMap[materialKey],
|
|
5166
|
+
showSpecialOnly: false
|
|
5167
|
+
}
|
|
5168
|
+
) : null
|
|
5169
|
+
}
|
|
5170
|
+
) }),
|
|
5171
|
+
learnerAnswerState === "CORRECT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5172
|
+
BaseImage_default,
|
|
5173
|
+
{
|
|
5174
|
+
src: "/icons/checkbox.webp",
|
|
5175
|
+
alt: "checkbox",
|
|
5176
|
+
size: "small"
|
|
5177
|
+
}
|
|
5178
|
+
) }) : learnerAnswerState === "INCORRECT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5179
|
+
BaseImage_default,
|
|
5180
|
+
{
|
|
5181
|
+
src: "/icons/cross-red.webp",
|
|
5182
|
+
alt: "cross-red",
|
|
5183
|
+
size: "small"
|
|
5184
|
+
}
|
|
5185
|
+
) }) : null
|
|
5186
|
+
] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5187
|
+
"div",
|
|
5151
5188
|
{
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5189
|
+
className: `w-catchup-activity-media-box-item h-catchup-activity-media-box-item border rounded-catchup-xlarge border-dashed ${learnerAnswerState === "CORRECT" ? "border-catchup-green" : learnerAnswerState === "INCORRECT" ? "border-catchup-red" : "border-catchup-blue"}`,
|
|
5190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "italic", children: i18n_default.t("please_drop_here") }) })
|
|
5191
|
+
}
|
|
5192
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5193
|
+
"div",
|
|
5194
|
+
{
|
|
5195
|
+
className: "flex-1 cursor-pointer",
|
|
5196
|
+
onClick: (e) => {
|
|
5197
|
+
e.stopPropagation();
|
|
5198
|
+
onChange(answer, materialKey, "");
|
|
5199
|
+
},
|
|
5200
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5201
|
+
ShowMaterialMediaByContentType_default,
|
|
5202
|
+
{
|
|
5203
|
+
contentType: contentMap.type,
|
|
5204
|
+
src: answerMap[materialKey],
|
|
5205
|
+
canFullScreen: true
|
|
5206
|
+
},
|
|
5207
|
+
`${uniqueValue}-${index}`
|
|
5208
|
+
)
|
|
5209
|
+
}
|
|
5210
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
|
|
5211
|
+
answerMap[materialKey]
|
|
5212
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5213
|
+
"span",
|
|
5214
|
+
{
|
|
5215
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5216
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_katex4.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5155
5217
|
},
|
|
5156
|
-
|
|
5157
|
-
)
|
|
5158
|
-
}
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_katex4.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5166
|
-
},
|
|
5167
|
-
index2
|
|
5168
|
-
)) }, materialKey) })
|
|
5169
|
-
] })
|
|
5170
|
-
}
|
|
5171
|
-
) }) }, index);
|
|
5172
|
-
}) })
|
|
5173
|
-
] });
|
|
5218
|
+
index2
|
|
5219
|
+
)) }, materialKey) })
|
|
5220
|
+
] })
|
|
5221
|
+
}
|
|
5222
|
+
) }) }, index);
|
|
5223
|
+
}) })
|
|
5224
|
+
]
|
|
5225
|
+
}
|
|
5226
|
+
);
|
|
5174
5227
|
};
|
|
5175
5228
|
var FillInTheBlanksActivityMaterialContent_default = FillInTheBlanksActivityMaterialContent;
|
|
5176
5229
|
|
|
@@ -5275,71 +5328,9 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5275
5328
|
var FillInTheBlanksActivityContent_default = FillInTheBlanksActivityContent;
|
|
5276
5329
|
|
|
5277
5330
|
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
5278
|
-
var
|
|
5279
|
-
var import_react_dnd3 = require("react-dnd");
|
|
5331
|
+
var import_react20 = require("react");
|
|
5280
5332
|
var import_react_katex5 = require("react-katex");
|
|
5281
|
-
|
|
5282
|
-
// src/components/dnds/DraggableItem.tsx
|
|
5283
|
-
var import_react_dnd = require("react-dnd");
|
|
5284
5333
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5285
|
-
var DraggableItem = ({
|
|
5286
|
-
item,
|
|
5287
|
-
type,
|
|
5288
|
-
component,
|
|
5289
|
-
moveCardHandler
|
|
5290
|
-
}) => {
|
|
5291
|
-
const [{ isDragging }, drag] = (0, import_react_dnd.useDrag)({
|
|
5292
|
-
type,
|
|
5293
|
-
item,
|
|
5294
|
-
end: (item2, monitor) => {
|
|
5295
|
-
const dropResult = monitor.getDropResult();
|
|
5296
|
-
if (dropResult) {
|
|
5297
|
-
moveCardHandler();
|
|
5298
|
-
}
|
|
5299
|
-
},
|
|
5300
|
-
collect: (monitor) => ({
|
|
5301
|
-
isDragging: monitor.isDragging()
|
|
5302
|
-
})
|
|
5303
|
-
});
|
|
5304
|
-
const opacity = isDragging ? 0.4 : 1;
|
|
5305
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5306
|
-
"div",
|
|
5307
|
-
{
|
|
5308
|
-
className: `${isDragging ? "w-[0px] opacity-0" : "opacity-100"} transition-all duration-500`,
|
|
5309
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref: drag, className: "", style: { opacity }, children: component })
|
|
5310
|
-
}
|
|
5311
|
-
);
|
|
5312
|
-
};
|
|
5313
|
-
var DraggableItem_default = DraggableItem;
|
|
5314
|
-
|
|
5315
|
-
// src/components/dnds/DroppableItem.tsx
|
|
5316
|
-
var import_react20 = require("react");
|
|
5317
|
-
var import_react_dnd2 = require("react-dnd");
|
|
5318
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5319
|
-
var DroppableItem = ({
|
|
5320
|
-
item,
|
|
5321
|
-
type,
|
|
5322
|
-
component,
|
|
5323
|
-
dropRef,
|
|
5324
|
-
target,
|
|
5325
|
-
setTarget
|
|
5326
|
-
}) => {
|
|
5327
|
-
const ref = (0, import_react20.useRef)(null);
|
|
5328
|
-
const [, drop] = (0, import_react_dnd2.useDrop)({
|
|
5329
|
-
accept: type,
|
|
5330
|
-
hover() {
|
|
5331
|
-
if (item.index !== null && target !== item.index) {
|
|
5332
|
-
setTarget(item.index);
|
|
5333
|
-
}
|
|
5334
|
-
}
|
|
5335
|
-
});
|
|
5336
|
-
dropRef(drop(ref));
|
|
5337
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: `w-full transition-all duration-500 h-full`, ref, children: component });
|
|
5338
|
-
};
|
|
5339
|
-
var DroppableItem_default = DroppableItem;
|
|
5340
|
-
|
|
5341
|
-
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
5342
|
-
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5343
5334
|
var GroupingActivityMaterialContent = ({
|
|
5344
5335
|
uniqueValue,
|
|
5345
5336
|
answer,
|
|
@@ -5350,21 +5341,25 @@ var GroupingActivityMaterialContent = ({
|
|
|
5350
5341
|
isPreview,
|
|
5351
5342
|
showCorrectAnswer
|
|
5352
5343
|
}) => {
|
|
5353
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
5354
|
-
const [
|
|
5355
|
-
const [
|
|
5356
|
-
const [
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5344
|
+
const [selectedValue, setSelectedValue] = (0, import_react20.useState)(null);
|
|
5345
|
+
const [draggedValue, setDraggedValue] = (0, import_react20.useState)(null);
|
|
5346
|
+
const [dropTargetKey, setDropTargetKey] = (0, import_react20.useState)(null);
|
|
5347
|
+
const [draggedElement, setDraggedElement] = (0, import_react20.useState)(
|
|
5348
|
+
null
|
|
5349
|
+
);
|
|
5350
|
+
const [isShuffled, setIsShuffled] = (0, import_react20.useState)(false);
|
|
5351
|
+
const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react20.useState)([]);
|
|
5352
|
+
const dragElementRef = (0, import_react20.useRef)(null);
|
|
5353
|
+
const [mousePosition, setMousePosition] = (0, import_react20.useState)({
|
|
5354
|
+
x: 0,
|
|
5355
|
+
y: 0
|
|
5365
5356
|
});
|
|
5366
|
-
const
|
|
5367
|
-
|
|
5357
|
+
const [touchPosition, setTouchPosition] = (0, import_react20.useState)({
|
|
5358
|
+
x: 0,
|
|
5359
|
+
y: 0
|
|
5360
|
+
});
|
|
5361
|
+
const ref = (0, import_react20.useRef)(null);
|
|
5362
|
+
(0, import_react20.useEffect)(() => {
|
|
5368
5363
|
const shuffleArray2 = (array) => {
|
|
5369
5364
|
if (!isShuffled) {
|
|
5370
5365
|
const copyArray = JSON.parse(JSON.stringify(array));
|
|
@@ -5384,13 +5379,13 @@ var GroupingActivityMaterialContent = ({
|
|
|
5384
5379
|
}
|
|
5385
5380
|
});
|
|
5386
5381
|
setShuffledMaterialList(shuffleArray2(materialList));
|
|
5387
|
-
}, []);
|
|
5388
|
-
(0,
|
|
5382
|
+
}, [materialMap, isShuffled]);
|
|
5383
|
+
(0, import_react20.useEffect)(() => {
|
|
5389
5384
|
if (!showCorrectAnswer) return;
|
|
5390
5385
|
answer.data.find(
|
|
5391
5386
|
(answerData) => answerData.type === "GROUPING"
|
|
5392
5387
|
).answerMap = materialMap;
|
|
5393
|
-
}, [showCorrectAnswer]);
|
|
5388
|
+
}, [showCorrectAnswer, answer, materialMap]);
|
|
5394
5389
|
const retrieveAnswerMap = () => {
|
|
5395
5390
|
const foundIndex = answer.data.findIndex(
|
|
5396
5391
|
(answerData) => answerData.type === "GROUPING"
|
|
@@ -5421,56 +5416,164 @@ var GroupingActivityMaterialContent = ({
|
|
|
5421
5416
|
}
|
|
5422
5417
|
return "INCORRECT";
|
|
5423
5418
|
};
|
|
5424
|
-
const
|
|
5425
|
-
if (checkCanAnswerQuestion())
|
|
5426
|
-
|
|
5419
|
+
const handleMouseDown = (e, materialValue) => {
|
|
5420
|
+
if (!checkCanAnswerQuestion()) return;
|
|
5421
|
+
e.preventDefault();
|
|
5422
|
+
setDraggedValue(materialValue);
|
|
5423
|
+
setSelectedValue(null);
|
|
5424
|
+
setMousePosition({ x: e.clientX, y: e.clientY });
|
|
5425
|
+
};
|
|
5426
|
+
const handleMouseMove = (e) => {
|
|
5427
|
+
if (!draggedValue) return;
|
|
5428
|
+
setMousePosition({ x: e.clientX, y: e.clientY });
|
|
5429
|
+
const elementUnder = document.elementFromPoint(e.clientX, e.clientY);
|
|
5430
|
+
const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-grouping-drop-zone]");
|
|
5431
|
+
if (dropZone) {
|
|
5432
|
+
const dropKey = dropZone.getAttribute("data-grouping-drop-zone");
|
|
5433
|
+
setDropTargetKey(dropKey);
|
|
5434
|
+
} else {
|
|
5435
|
+
setDropTargetKey(null);
|
|
5436
|
+
}
|
|
5437
|
+
};
|
|
5438
|
+
const handleMouseUp = () => {
|
|
5439
|
+
if (dropTargetKey !== null && draggedValue !== null) {
|
|
5440
|
+
onChange(answer, dropTargetKey, draggedValue, null);
|
|
5441
|
+
}
|
|
5442
|
+
setDraggedValue(null);
|
|
5443
|
+
setDropTargetKey(null);
|
|
5444
|
+
setMousePosition({ x: 0, y: 0 });
|
|
5445
|
+
};
|
|
5446
|
+
const handleTouchStart = (e, materialValue, element) => {
|
|
5447
|
+
if (!checkCanAnswerQuestion()) return;
|
|
5448
|
+
const touch = e.touches[0];
|
|
5449
|
+
setDraggedValue(materialValue);
|
|
5450
|
+
setDraggedElement(element);
|
|
5451
|
+
setTouchPosition({ x: touch.clientX, y: touch.clientY });
|
|
5452
|
+
setSelectedValue(null);
|
|
5453
|
+
};
|
|
5454
|
+
const handleTouchMove = (e) => {
|
|
5455
|
+
if (!draggedValue) return;
|
|
5456
|
+
const touch = e.touches[0];
|
|
5457
|
+
setTouchPosition({ x: touch.clientX, y: touch.clientY });
|
|
5458
|
+
const elementUnder = document.elementFromPoint(
|
|
5459
|
+
touch.clientX,
|
|
5460
|
+
touch.clientY
|
|
5461
|
+
);
|
|
5462
|
+
const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-grouping-drop-zone]");
|
|
5463
|
+
if (dropZone) {
|
|
5464
|
+
const dropKey = dropZone.getAttribute("data-grouping-drop-zone");
|
|
5465
|
+
setDropTargetKey(dropKey);
|
|
5466
|
+
} else {
|
|
5467
|
+
setDropTargetKey(null);
|
|
5468
|
+
}
|
|
5469
|
+
};
|
|
5470
|
+
const handleTouchEnd = () => {
|
|
5471
|
+
if (dropTargetKey !== null && draggedValue !== null) {
|
|
5472
|
+
onChange(answer, dropTargetKey, draggedValue, null);
|
|
5473
|
+
}
|
|
5474
|
+
setDraggedValue(null);
|
|
5475
|
+
setDropTargetKey(null);
|
|
5476
|
+
setDraggedElement(null);
|
|
5477
|
+
setTouchPosition({ x: 0, y: 0 });
|
|
5478
|
+
};
|
|
5479
|
+
const handleSelectItem = (materialValue) => {
|
|
5480
|
+
if (!checkCanAnswerQuestion()) return;
|
|
5481
|
+
setSelectedValue(materialValue);
|
|
5482
|
+
setDraggedValue(null);
|
|
5483
|
+
};
|
|
5484
|
+
const handleDropZoneClick = (answerMapKey) => {
|
|
5485
|
+
if (selectedValue !== null) {
|
|
5486
|
+
onChange(answer, answerMapKey, selectedValue, null);
|
|
5427
5487
|
setSelectedValue(null);
|
|
5428
5488
|
}
|
|
5429
5489
|
};
|
|
5430
5490
|
const answerMap = retrieveAnswerMap();
|
|
5431
5491
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5432
|
-
return /* @__PURE__ */ (0,
|
|
5433
|
-
|
|
5434
|
-
|
|
5435
|
-
|
|
5436
|
-
|
|
5492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5493
|
+
draggedValue && mousePosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5494
|
+
"div",
|
|
5495
|
+
{
|
|
5496
|
+
className: "fixed pointer-events-none z-50 opacity-80",
|
|
5497
|
+
style: {
|
|
5498
|
+
left: `${mousePosition.x}px`,
|
|
5499
|
+
top: `${mousePosition.y}px`,
|
|
5500
|
+
transform: "translate(-50%, -50%)"
|
|
5501
|
+
},
|
|
5502
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5503
|
+
(inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5504
|
+
"span",
|
|
5505
|
+
{
|
|
5506
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5507
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5508
|
+
},
|
|
5509
|
+
index
|
|
5510
|
+
)
|
|
5511
|
+
) }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5512
|
+
ShowMaterialMediaByContentType_default,
|
|
5513
|
+
{
|
|
5514
|
+
contentType: contentMap.type,
|
|
5515
|
+
src: draggedValue,
|
|
5516
|
+
canFullScreen: false
|
|
5517
|
+
},
|
|
5518
|
+
`${uniqueValue}-drag-mouse`
|
|
5519
|
+
) })
|
|
5520
|
+
}
|
|
5521
|
+
),
|
|
5522
|
+
draggedValue && touchPosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5523
|
+
"div",
|
|
5524
|
+
{
|
|
5525
|
+
className: "fixed pointer-events-none z-50 opacity-80",
|
|
5526
|
+
style: {
|
|
5527
|
+
left: `${touchPosition.x}px`,
|
|
5528
|
+
top: `${touchPosition.y}px`,
|
|
5529
|
+
transform: "translate(-50%, -50%)"
|
|
5530
|
+
},
|
|
5531
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5532
|
+
(inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5533
|
+
"span",
|
|
5534
|
+
{
|
|
5535
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5536
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5537
|
+
},
|
|
5538
|
+
index
|
|
5539
|
+
)
|
|
5540
|
+
) }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5541
|
+
ShowMaterialMediaByContentType_default,
|
|
5542
|
+
{
|
|
5543
|
+
contentType: contentMap.type,
|
|
5544
|
+
src: draggedValue,
|
|
5545
|
+
canFullScreen: false
|
|
5546
|
+
},
|
|
5547
|
+
`${uniqueValue}-drag-touch`
|
|
5548
|
+
) })
|
|
5549
|
+
}
|
|
5550
|
+
),
|
|
5551
|
+
filteredMaterialList.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
5552
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 flex flex-row gap-x-4 overflow-x-auto py-2", children: filteredMaterialList.map((materialValue, index) => {
|
|
5553
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5554
|
+
"div",
|
|
5437
5555
|
{
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5556
|
+
ref: draggedValue === materialValue ? dragElementRef : null,
|
|
5557
|
+
className: `${draggedValue === materialValue ? "opacity-40" : selectedValue === materialValue ? "ring-2 ring-blue-500" : "opacity-100"} transition-all duration-200`,
|
|
5558
|
+
onMouseDown: (e) => handleMouseDown(e, materialValue),
|
|
5559
|
+
onTouchStart: (e) => handleTouchStart(e, materialValue, e.currentTarget),
|
|
5560
|
+
onTouchMove: handleTouchMove,
|
|
5561
|
+
onTouchEnd: handleTouchEnd,
|
|
5562
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5441
5563
|
"div",
|
|
5442
5564
|
{
|
|
5443
5565
|
className: `${selectedValue === materialValue ? "border-catchup-blue" : "border-catchup-lighter-gray"} ${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"} flex flex-col items-center justify-center border-2 rounded-catchup-xlarge cursor-pointer transition-all duration-300`,
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
setSelectedValue(materialValue);
|
|
5447
|
-
}
|
|
5448
|
-
},
|
|
5449
|
-
onTouchEnd: () => {
|
|
5450
|
-
if (checkCanAnswerQuestion()) {
|
|
5451
|
-
setSelectedValue(materialValue);
|
|
5452
|
-
}
|
|
5453
|
-
},
|
|
5454
|
-
onMouseUp: () => {
|
|
5455
|
-
if (checkCanAnswerQuestion()) {
|
|
5456
|
-
setSelectedValue(null);
|
|
5457
|
-
}
|
|
5458
|
-
},
|
|
5459
|
-
onTouchStart: () => {
|
|
5460
|
-
if (checkCanAnswerQuestion()) {
|
|
5461
|
-
setSelectedValue(null);
|
|
5462
|
-
}
|
|
5463
|
-
},
|
|
5464
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5566
|
+
onClick: () => handleSelectItem(materialValue),
|
|
5567
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5465
5568
|
materialValue
|
|
5466
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0,
|
|
5569
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5467
5570
|
"span",
|
|
5468
5571
|
{
|
|
5469
5572
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5470
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
5573
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5471
5574
|
},
|
|
5472
5575
|
index2
|
|
5473
|
-
)) }) }) : /* @__PURE__ */ (0,
|
|
5576
|
+
)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5474
5577
|
ShowMaterialMediaByContentType_default,
|
|
5475
5578
|
{
|
|
5476
5579
|
contentType: contentMap.type,
|
|
@@ -5480,109 +5583,94 @@ var GroupingActivityMaterialContent = ({
|
|
|
5480
5583
|
`${uniqueValue}-${index}`
|
|
5481
5584
|
)
|
|
5482
5585
|
}
|
|
5483
|
-
)
|
|
5484
|
-
moveCardHandler: () => {
|
|
5485
|
-
if (!selectedTargetKey) return;
|
|
5486
|
-
if (!selectedValue) return;
|
|
5487
|
-
handleGroupingActivityItemOnChange(
|
|
5488
|
-
selectedTargetKey,
|
|
5489
|
-
selectedValue
|
|
5490
|
-
);
|
|
5491
|
-
}
|
|
5586
|
+
)
|
|
5492
5587
|
},
|
|
5493
5588
|
index
|
|
5494
5589
|
);
|
|
5495
5590
|
}) }),
|
|
5496
|
-
/* @__PURE__ */ (0,
|
|
5591
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DividerLine_default, {})
|
|
5497
5592
|
] }) : null,
|
|
5498
|
-
/* @__PURE__ */ (0,
|
|
5499
|
-
/* @__PURE__ */ (0,
|
|
5593
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "overflow-y-auto max-h-[500px]", children: Object.keys(answerMap).map((answerMapKey, index) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-row w-full", children: [
|
|
5594
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-1/3", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5500
5595
|
"div",
|
|
5501
5596
|
{
|
|
5502
5597
|
className: `border-catchup-blue ${contentMap.type === "TEXT" ? "h-catchup-activity-text-outer-box-item" : "h-catchup-activity-media-outer-box-item"} flex flex-col items-center justify-center border-2 rounded-catchup-xlarge transition-all duration-300 my-3`,
|
|
5503
|
-
children: /* @__PURE__ */ (0,
|
|
5504
|
-
(inputPart, index2) => /* @__PURE__ */ (0,
|
|
5598
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col items-center justify-center transition-all duration-300 px-4 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(answerMapKey).map(
|
|
5599
|
+
(inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5505
5600
|
"span",
|
|
5506
5601
|
{
|
|
5507
5602
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5508
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
5603
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5509
5604
|
},
|
|
5510
5605
|
index2
|
|
5511
5606
|
)
|
|
5512
5607
|
) }) })
|
|
5513
5608
|
}
|
|
5514
5609
|
) }),
|
|
5515
|
-
/* @__PURE__ */ (0,
|
|
5516
|
-
/* @__PURE__ */ (0,
|
|
5610
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mx-4 w-[2px] bg-catchup-lighter-gray" }),
|
|
5611
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 min-w-0", ref, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-full py-3", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5517
5612
|
"div",
|
|
5518
5613
|
{
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5614
|
+
"data-grouping-drop-zone": answerMapKey,
|
|
5615
|
+
onMouseEnter: () => draggedValue && setDropTargetKey(answerMapKey),
|
|
5616
|
+
onMouseLeave: () => setDropTargetKey(null),
|
|
5617
|
+
onClick: () => handleDropZoneClick(answerMapKey),
|
|
5618
|
+
className: `${dropTargetKey === answerMapKey ? "bg-catchup-light-blue ring-2 ring-blue-400" : ""} flex-1 border-catchup-blue rounded-catchup-xlarge border-2 h-full p-1 transition-all duration-200`,
|
|
5619
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-full w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-row items-center gap-2 w-max h-full", children: answerMap[answerMapKey].map(
|
|
5620
|
+
(answerMapValue, answerMapIndex) => {
|
|
5621
|
+
const learnerAnswerState = checkAnswerState(
|
|
5622
|
+
materialMap[answerMapKey],
|
|
5623
|
+
answerMapValue
|
|
5624
|
+
);
|
|
5625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "p-1", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5626
|
+
"div",
|
|
5627
|
+
{
|
|
5628
|
+
className: `${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"}`,
|
|
5629
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5535
5630
|
"div",
|
|
5536
5631
|
{
|
|
5537
|
-
className: `${
|
|
5538
|
-
|
|
5539
|
-
|
|
5632
|
+
className: `${learnerAnswerState === "EMPTY" ? "border-catchup-lighter-gray" : learnerAnswerState === "CORRECT" ? "border-catchup-green" : learnerAnswerState === "INCORRECT" ? "border-catchup-red" : "border-catchup-blue"} border-2 rounded-catchup-xlarge h-full flex flex-col items-center justify-center transition-all duration-300 cursor-pointer`,
|
|
5633
|
+
onClick: (e) => {
|
|
5634
|
+
e.stopPropagation();
|
|
5635
|
+
if (checkCanAnswerQuestion()) {
|
|
5636
|
+
onChange(
|
|
5637
|
+
answer,
|
|
5638
|
+
answerMapKey,
|
|
5639
|
+
null,
|
|
5640
|
+
answerMapIndex
|
|
5641
|
+
);
|
|
5642
|
+
setSelectedValue(null);
|
|
5643
|
+
}
|
|
5644
|
+
},
|
|
5645
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex flex-col items-center justify-center transition-all duration-300 min-w-[200px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "m-2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5646
|
+
answerMapValue
|
|
5647
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5648
|
+
"span",
|
|
5540
5649
|
{
|
|
5541
|
-
className: `${
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
if (checkCanAnswerQuestion()) {
|
|
5545
|
-
onChange(
|
|
5546
|
-
answer,
|
|
5547
|
-
answerMapKey,
|
|
5548
|
-
null,
|
|
5549
|
-
answerMapIndex
|
|
5550
|
-
);
|
|
5551
|
-
setSelectedValue(null);
|
|
5552
|
-
}
|
|
5553
|
-
},
|
|
5554
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-col items-center justify-center transition-all duration-300 min-w-[200px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "m-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5555
|
-
answerMapValue
|
|
5556
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5557
|
-
"span",
|
|
5650
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5651
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5652
|
+
import_react_katex5.InlineMath,
|
|
5558
5653
|
{
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
src: answerMapValue,
|
|
5573
|
-
canFullScreen: false
|
|
5574
|
-
},
|
|
5575
|
-
`${uniqueValue}-${answerMapIndex}`
|
|
5576
|
-
)
|
|
5577
|
-
}
|
|
5654
|
+
math: inputPart.value
|
|
5655
|
+
}
|
|
5656
|
+
) }) : inputPart.value
|
|
5657
|
+
},
|
|
5658
|
+
index2
|
|
5659
|
+
)) }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5660
|
+
ShowMaterialMediaByContentType_default,
|
|
5661
|
+
{
|
|
5662
|
+
contentType: contentMap.type,
|
|
5663
|
+
src: answerMapValue,
|
|
5664
|
+
canFullScreen: false
|
|
5665
|
+
},
|
|
5666
|
+
`${uniqueValue}-${answerMapIndex}`
|
|
5578
5667
|
)
|
|
5579
5668
|
}
|
|
5580
|
-
)
|
|
5669
|
+
)
|
|
5581
5670
|
}
|
|
5582
|
-
) }
|
|
5583
|
-
}
|
|
5584
|
-
|
|
5585
|
-
)
|
|
5671
|
+
) }, answerMapIndex);
|
|
5672
|
+
}
|
|
5673
|
+
) }) })
|
|
5586
5674
|
}
|
|
5587
5675
|
) }) })
|
|
5588
5676
|
] }, index)) })
|
|
@@ -5591,7 +5679,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5591
5679
|
var GroupingActivityMaterialContent_default = GroupingActivityMaterialContent;
|
|
5592
5680
|
|
|
5593
5681
|
// src/components/activities/GroupingActivityContent.tsx
|
|
5594
|
-
var
|
|
5682
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5595
5683
|
var GroupingActivityContent = ({
|
|
5596
5684
|
answer,
|
|
5597
5685
|
data,
|
|
@@ -5616,16 +5704,16 @@ var GroupingActivityContent = ({
|
|
|
5616
5704
|
}
|
|
5617
5705
|
changeAnswer(answer2);
|
|
5618
5706
|
};
|
|
5619
|
-
return /* @__PURE__ */ (0,
|
|
5620
|
-
/* @__PURE__ */ (0,
|
|
5707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
5708
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5621
5709
|
ActivityBodyContent_default,
|
|
5622
5710
|
{
|
|
5623
5711
|
bodyMap: groupingBodyMap,
|
|
5624
5712
|
templateType: "GROUPING"
|
|
5625
5713
|
}
|
|
5626
5714
|
),
|
|
5627
|
-
/* @__PURE__ */ (0,
|
|
5628
|
-
/* @__PURE__ */ (0,
|
|
5715
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DividerLine_default, {}),
|
|
5716
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
5629
5717
|
GroupingActivityMaterialContent_default,
|
|
5630
5718
|
{
|
|
5631
5719
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -5643,10 +5731,9 @@ var GroupingActivityContent = ({
|
|
|
5643
5731
|
var GroupingActivityContent_default = GroupingActivityContent;
|
|
5644
5732
|
|
|
5645
5733
|
// src/components/activities/material-contents/MatchingActivityMaterialContent.tsx
|
|
5646
|
-
var
|
|
5647
|
-
var import_react_dnd4 = require("react-dnd");
|
|
5734
|
+
var import_react21 = require("react");
|
|
5648
5735
|
var import_react_katex6 = require("react-katex");
|
|
5649
|
-
var
|
|
5736
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5650
5737
|
var MatchingActivityMaterialContent = ({
|
|
5651
5738
|
uniqueValue,
|
|
5652
5739
|
answer,
|
|
@@ -5657,21 +5744,25 @@ var MatchingActivityMaterialContent = ({
|
|
|
5657
5744
|
isPreview,
|
|
5658
5745
|
showCorrectAnswer
|
|
5659
5746
|
}) => {
|
|
5660
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
5661
|
-
const [
|
|
5662
|
-
const [
|
|
5663
|
-
const [
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5670
|
-
|
|
5671
|
-
|
|
5747
|
+
const [selectedValue, setSelectedValue] = (0, import_react21.useState)(null);
|
|
5748
|
+
const [draggedValue, setDraggedValue] = (0, import_react21.useState)(null);
|
|
5749
|
+
const [dropTargetKey, setDropTargetKey] = (0, import_react21.useState)(null);
|
|
5750
|
+
const [draggedElement, setDraggedElement] = (0, import_react21.useState)(
|
|
5751
|
+
null
|
|
5752
|
+
);
|
|
5753
|
+
const [isShuffled, setIsShuffled] = (0, import_react21.useState)(false);
|
|
5754
|
+
const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react21.useState)([]);
|
|
5755
|
+
const dragElementRef = (0, import_react21.useRef)(null);
|
|
5756
|
+
const [mousePosition, setMousePosition] = (0, import_react21.useState)({
|
|
5757
|
+
x: 0,
|
|
5758
|
+
y: 0
|
|
5672
5759
|
});
|
|
5673
|
-
const
|
|
5674
|
-
|
|
5760
|
+
const [touchPosition, setTouchPosition] = (0, import_react21.useState)({
|
|
5761
|
+
x: 0,
|
|
5762
|
+
y: 0
|
|
5763
|
+
});
|
|
5764
|
+
const itemsRef = (0, import_react21.useRef)(null);
|
|
5765
|
+
(0, import_react21.useEffect)(() => {
|
|
5675
5766
|
const shuffleArray2 = (array) => {
|
|
5676
5767
|
if (!isShuffled) {
|
|
5677
5768
|
const copyArray = JSON.parse(JSON.stringify(array));
|
|
@@ -5689,13 +5780,13 @@ var MatchingActivityMaterialContent = ({
|
|
|
5689
5780
|
materialList.push(materialMap[materialKey]);
|
|
5690
5781
|
});
|
|
5691
5782
|
setShuffledMaterialList(shuffleArray2(materialList));
|
|
5692
|
-
}, []);
|
|
5693
|
-
(0,
|
|
5783
|
+
}, [materialMap, isShuffled]);
|
|
5784
|
+
(0, import_react21.useEffect)(() => {
|
|
5694
5785
|
if (!showCorrectAnswer) return;
|
|
5695
5786
|
answer.data.find(
|
|
5696
5787
|
(answerData) => answerData.type === "MATCHING"
|
|
5697
5788
|
).answerMap = materialMap;
|
|
5698
|
-
}, [showCorrectAnswer]);
|
|
5789
|
+
}, [showCorrectAnswer, answer, materialMap]);
|
|
5699
5790
|
const retrieveAnswerMap = () => {
|
|
5700
5791
|
const foundIndex = answer.data.findIndex(
|
|
5701
5792
|
(answerData) => answerData.type === "MATCHING"
|
|
@@ -5719,60 +5810,168 @@ var MatchingActivityMaterialContent = ({
|
|
|
5719
5810
|
}
|
|
5720
5811
|
return "INCORRECT";
|
|
5721
5812
|
};
|
|
5722
|
-
const
|
|
5723
|
-
if (checkCanAnswerQuestion())
|
|
5724
|
-
|
|
5813
|
+
const handleMouseDown = (e, materialValue) => {
|
|
5814
|
+
if (!checkCanAnswerQuestion()) return;
|
|
5815
|
+
e.preventDefault();
|
|
5816
|
+
setDraggedValue(materialValue);
|
|
5817
|
+
setSelectedValue(null);
|
|
5818
|
+
setMousePosition({ x: e.clientX, y: e.clientY });
|
|
5819
|
+
};
|
|
5820
|
+
const handleMouseMove = (e) => {
|
|
5821
|
+
if (!draggedValue) return;
|
|
5822
|
+
setMousePosition({ x: e.clientX, y: e.clientY });
|
|
5823
|
+
const elementUnder = document.elementFromPoint(e.clientX, e.clientY);
|
|
5824
|
+
const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-matching-drop-zone]");
|
|
5825
|
+
if (dropZone) {
|
|
5826
|
+
const dropKey = dropZone.getAttribute("data-matching-drop-zone");
|
|
5827
|
+
setDropTargetKey(dropKey);
|
|
5828
|
+
} else {
|
|
5829
|
+
setDropTargetKey(null);
|
|
5830
|
+
}
|
|
5831
|
+
};
|
|
5832
|
+
const handleMouseUp = () => {
|
|
5833
|
+
if (dropTargetKey !== null && draggedValue !== null) {
|
|
5834
|
+
onChange(answer, dropTargetKey, draggedValue);
|
|
5835
|
+
}
|
|
5836
|
+
setDraggedValue(null);
|
|
5837
|
+
setDropTargetKey(null);
|
|
5838
|
+
setMousePosition({ x: 0, y: 0 });
|
|
5839
|
+
};
|
|
5840
|
+
const handleTouchStart = (e, materialValue, element) => {
|
|
5841
|
+
if (!checkCanAnswerQuestion()) return;
|
|
5842
|
+
const touch = e.touches[0];
|
|
5843
|
+
setDraggedValue(materialValue);
|
|
5844
|
+
setDraggedElement(element);
|
|
5845
|
+
setTouchPosition({ x: touch.clientX, y: touch.clientY });
|
|
5846
|
+
setSelectedValue(null);
|
|
5847
|
+
};
|
|
5848
|
+
const handleTouchMove = (e) => {
|
|
5849
|
+
if (!draggedValue) return;
|
|
5850
|
+
const touch = e.touches[0];
|
|
5851
|
+
setTouchPosition({ x: touch.clientX, y: touch.clientY });
|
|
5852
|
+
const elementUnder = document.elementFromPoint(
|
|
5853
|
+
touch.clientX,
|
|
5854
|
+
touch.clientY
|
|
5855
|
+
);
|
|
5856
|
+
const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-matching-drop-zone]");
|
|
5857
|
+
if (dropZone) {
|
|
5858
|
+
const dropKey = dropZone.getAttribute("data-matching-drop-zone");
|
|
5859
|
+
setDropTargetKey(dropKey);
|
|
5860
|
+
} else {
|
|
5861
|
+
setDropTargetKey(null);
|
|
5862
|
+
}
|
|
5863
|
+
};
|
|
5864
|
+
const handleTouchEnd = () => {
|
|
5865
|
+
if (dropTargetKey !== null && draggedValue !== null) {
|
|
5866
|
+
onChange(answer, dropTargetKey, draggedValue);
|
|
5867
|
+
}
|
|
5868
|
+
setDraggedValue(null);
|
|
5869
|
+
setDropTargetKey(null);
|
|
5870
|
+
setDraggedElement(null);
|
|
5871
|
+
setTouchPosition({ x: 0, y: 0 });
|
|
5872
|
+
};
|
|
5873
|
+
const handleSelectItem = (materialValue) => {
|
|
5874
|
+
if (!checkCanAnswerQuestion()) return;
|
|
5875
|
+
setSelectedValue(materialValue);
|
|
5876
|
+
setDraggedValue(null);
|
|
5877
|
+
};
|
|
5878
|
+
const handleDropZoneClick = (answerMapKey) => {
|
|
5879
|
+
if (selectedValue !== null) {
|
|
5880
|
+
onChange(answer, answerMapKey, selectedValue);
|
|
5725
5881
|
setSelectedValue(null);
|
|
5726
5882
|
}
|
|
5727
5883
|
};
|
|
5728
5884
|
const answerMap = retrieveAnswerMap();
|
|
5729
5885
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5730
|
-
return /* @__PURE__ */ (0,
|
|
5731
|
-
|
|
5732
|
-
|
|
5886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
|
|
5887
|
+
draggedValue && mousePosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5888
|
+
"div",
|
|
5889
|
+
{
|
|
5890
|
+
className: "fixed pointer-events-none z-50 opacity-80",
|
|
5891
|
+
style: {
|
|
5892
|
+
left: `${mousePosition.x}px`,
|
|
5893
|
+
top: `${mousePosition.y}px`,
|
|
5894
|
+
transform: "translate(-50%, -50%)"
|
|
5895
|
+
},
|
|
5896
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] px-4", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5897
|
+
(inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5898
|
+
"span",
|
|
5899
|
+
{
|
|
5900
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5901
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5902
|
+
},
|
|
5903
|
+
index
|
|
5904
|
+
)
|
|
5905
|
+
) }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5906
|
+
ShowMaterialMediaByContentType_default,
|
|
5907
|
+
{
|
|
5908
|
+
contentType: contentMap.type,
|
|
5909
|
+
src: draggedValue,
|
|
5910
|
+
canFullScreen: false
|
|
5911
|
+
},
|
|
5912
|
+
`${uniqueValue}-drag-mouse`
|
|
5913
|
+
) })
|
|
5914
|
+
}
|
|
5915
|
+
),
|
|
5916
|
+
draggedValue && touchPosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5917
|
+
"div",
|
|
5918
|
+
{
|
|
5919
|
+
className: "fixed pointer-events-none z-50 opacity-80",
|
|
5920
|
+
style: {
|
|
5921
|
+
left: `${touchPosition.x}px`,
|
|
5922
|
+
top: `${touchPosition.y}px`,
|
|
5923
|
+
transform: "translate(-50%, -50%)"
|
|
5924
|
+
},
|
|
5925
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] px-4", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5926
|
+
(inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5927
|
+
"span",
|
|
5928
|
+
{
|
|
5929
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5930
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5931
|
+
},
|
|
5932
|
+
index
|
|
5933
|
+
)
|
|
5934
|
+
) }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5935
|
+
ShowMaterialMediaByContentType_default,
|
|
5936
|
+
{
|
|
5937
|
+
contentType: contentMap.type,
|
|
5938
|
+
src: draggedValue,
|
|
5939
|
+
canFullScreen: false
|
|
5940
|
+
},
|
|
5941
|
+
`${uniqueValue}-drag-touch`
|
|
5942
|
+
) })
|
|
5943
|
+
}
|
|
5944
|
+
),
|
|
5945
|
+
filteredMaterialList.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
5946
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5733
5947
|
"div",
|
|
5734
5948
|
{
|
|
5735
5949
|
ref: itemsRef,
|
|
5736
5950
|
className: "flex-shrink-0 flex flex-row gap-x-4 gap-y-4 overflow-x-auto py-2",
|
|
5737
|
-
children: filteredMaterialList.map((materialValue, index) => /* @__PURE__ */ (0,
|
|
5738
|
-
|
|
5951
|
+
children: filteredMaterialList.map((materialValue, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5952
|
+
"div",
|
|
5739
5953
|
{
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5954
|
+
ref: draggedValue === materialValue ? dragElementRef : null,
|
|
5955
|
+
className: `${draggedValue === materialValue ? "opacity-40" : selectedValue === materialValue ? "ring-2 ring-blue-500" : "opacity-100"} transition-all duration-200`,
|
|
5956
|
+
onMouseDown: (e) => handleMouseDown(e, materialValue),
|
|
5957
|
+
onTouchStart: (e) => handleTouchStart(e, materialValue, e.currentTarget),
|
|
5958
|
+
onTouchMove: handleTouchMove,
|
|
5959
|
+
onTouchEnd: handleTouchEnd,
|
|
5960
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5743
5961
|
"div",
|
|
5744
5962
|
{
|
|
5745
5963
|
className: `${selectedValue === materialValue ? "border-catchup-blue" : "border-catchup-lighter-gray"} ${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"} flex flex-col items-center justify-center border-2 rounded-catchup-xlarge cursor-pointer transition-all duration-300`,
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
setSelectedValue(materialValue);
|
|
5749
|
-
}
|
|
5750
|
-
},
|
|
5751
|
-
onTouchEnd: () => {
|
|
5752
|
-
if (checkCanAnswerQuestion()) {
|
|
5753
|
-
setSelectedValue(materialValue);
|
|
5754
|
-
}
|
|
5755
|
-
},
|
|
5756
|
-
onMouseUp: () => {
|
|
5757
|
-
if (checkCanAnswerQuestion()) {
|
|
5758
|
-
setSelectedValue(null);
|
|
5759
|
-
}
|
|
5760
|
-
},
|
|
5761
|
-
onTouchStart: () => {
|
|
5762
|
-
if (checkCanAnswerQuestion()) {
|
|
5763
|
-
setSelectedValue(null);
|
|
5764
|
-
}
|
|
5765
|
-
},
|
|
5766
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] overflow-y-auto px-4", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5964
|
+
onClick: () => handleSelectItem(materialValue),
|
|
5965
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] overflow-y-auto px-4", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5767
5966
|
materialValue
|
|
5768
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0,
|
|
5967
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5769
5968
|
"span",
|
|
5770
5969
|
{
|
|
5771
5970
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5772
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
5971
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5773
5972
|
},
|
|
5774
5973
|
index2
|
|
5775
|
-
)) }) }) : /* @__PURE__ */ (0,
|
|
5974
|
+
)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5776
5975
|
ShowMaterialMediaByContentType_default,
|
|
5777
5976
|
{
|
|
5778
5977
|
contentType: contentMap.type,
|
|
@@ -5782,97 +5981,75 @@ var MatchingActivityMaterialContent = ({
|
|
|
5782
5981
|
`${uniqueValue}-${index}`
|
|
5783
5982
|
)
|
|
5784
5983
|
}
|
|
5785
|
-
)
|
|
5786
|
-
moveCardHandler: () => {
|
|
5787
|
-
if (!selectedTargetKey) return;
|
|
5788
|
-
if (!selectedValue) return;
|
|
5789
|
-
handleMatchingActivityItemOnChange(
|
|
5790
|
-
selectedTargetKey,
|
|
5791
|
-
selectedValue
|
|
5792
|
-
);
|
|
5793
|
-
}
|
|
5984
|
+
)
|
|
5794
5985
|
},
|
|
5795
5986
|
index
|
|
5796
5987
|
))
|
|
5797
5988
|
}
|
|
5798
5989
|
),
|
|
5799
|
-
/* @__PURE__ */ (0,
|
|
5990
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(DividerLine_default, {}) })
|
|
5800
5991
|
] }) : null,
|
|
5801
|
-
/* @__PURE__ */ (0,
|
|
5992
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "overflow-y-auto max-h-[500px]", children: Object.keys(answerMap).map((answerMapKey, index) => {
|
|
5802
5993
|
const learnerAnswerState = checkAnswerState(
|
|
5803
5994
|
materialMap[answerMapKey],
|
|
5804
5995
|
answerMap[answerMapKey]
|
|
5805
5996
|
);
|
|
5806
|
-
return /* @__PURE__ */ (0,
|
|
5807
|
-
/* @__PURE__ */ (0,
|
|
5997
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex flex-row w-full", children: [
|
|
5998
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-1/3", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5808
5999
|
"div",
|
|
5809
6000
|
{
|
|
5810
6001
|
className: `${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"} flex flex-col items-center justify-center border-2 rounded-catchup-xlarge transition-all duration-300 my-3 ${learnerAnswerState === "EMPTY" ? "border-catchup-blue" : learnerAnswerState === "CORRECT" ? "border-catchup-green" : learnerAnswerState === "INCORRECT" ? "border-catchup-red" : "border-catchup-blue"}`,
|
|
5811
|
-
children: /* @__PURE__ */ (0,
|
|
6002
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex flex-col items-center justify-center transition-all duration-300 px-4 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5812
6003
|
answerMapKey
|
|
5813
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0,
|
|
6004
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5814
6005
|
"span",
|
|
5815
6006
|
{
|
|
5816
6007
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5817
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
6008
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5818
6009
|
},
|
|
5819
6010
|
index2
|
|
5820
6011
|
)) }) })
|
|
5821
6012
|
}
|
|
5822
6013
|
) }),
|
|
5823
|
-
/* @__PURE__ */ (0,
|
|
5824
|
-
/* @__PURE__ */ (0,
|
|
6014
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "mx-4 w-[2px] bg-catchup-lighter-gray" }),
|
|
6015
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5825
6016
|
"div",
|
|
5826
6017
|
{
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
component: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5842
|
-
"div",
|
|
5843
|
-
{
|
|
5844
|
-
className: "h-full flex-1 flex flex-row items-center justify-center px-4",
|
|
5845
|
-
onClick: (e) => {
|
|
5846
|
-
e.preventDefault();
|
|
5847
|
-
if (checkCanAnswerQuestion()) {
|
|
5848
|
-
handleMatchingActivityItemOnChange(
|
|
5849
|
-
answerMapKey,
|
|
5850
|
-
null
|
|
5851
|
-
);
|
|
5852
|
-
}
|
|
5853
|
-
},
|
|
5854
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5855
|
-
answerMap[answerMapKey]
|
|
5856
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5857
|
-
"span",
|
|
5858
|
-
{
|
|
5859
|
-
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5860
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
5861
|
-
},
|
|
5862
|
-
index2
|
|
5863
|
-
)) }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5864
|
-
ShowMaterialMediaByContentType_default,
|
|
5865
|
-
{
|
|
5866
|
-
contentType: contentMap.type,
|
|
5867
|
-
src: answerMap[answerMapKey],
|
|
5868
|
-
canFullScreen: false
|
|
5869
|
-
},
|
|
5870
|
-
`${uniqueValue}-${index}`
|
|
5871
|
-
)
|
|
6018
|
+
"data-matching-drop-zone": answerMapKey,
|
|
6019
|
+
onMouseEnter: () => draggedValue && setDropTargetKey(answerMapKey),
|
|
6020
|
+
onMouseLeave: () => setDropTargetKey(null),
|
|
6021
|
+
onClick: () => handleDropZoneClick(answerMapKey),
|
|
6022
|
+
className: `${dropTargetKey === answerMapKey ? "bg-catchup-light-blue ring-2 ring-blue-400" : ""} ${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"} flex flex-col items-center justify-center border-2 rounded-catchup-xlarge cursor-pointer transition-all duration-300 my-3 ${learnerAnswerState === "EMPTY" ? "border-catchup-blue" : learnerAnswerState === "CORRECT" ? "border-catchup-green" : learnerAnswerState === "INCORRECT" ? "border-catchup-red" : "border-catchup-blue"}`,
|
|
6023
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6024
|
+
"div",
|
|
6025
|
+
{
|
|
6026
|
+
className: "h-full flex-1 flex flex-row items-center justify-center px-4",
|
|
6027
|
+
onClick: (e) => {
|
|
6028
|
+
e.stopPropagation();
|
|
6029
|
+
if (checkCanAnswerQuestion() && answerMap[answerMapKey]) {
|
|
6030
|
+
onChange(answer, answerMapKey, null);
|
|
6031
|
+
setSelectedValue(null);
|
|
5872
6032
|
}
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
6033
|
+
},
|
|
6034
|
+
children: answerMap[answerMapKey] ? contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6035
|
+
answerMap[answerMapKey]
|
|
6036
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6037
|
+
"span",
|
|
6038
|
+
{
|
|
6039
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6040
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6041
|
+
},
|
|
6042
|
+
index2
|
|
6043
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6044
|
+
ShowMaterialMediaByContentType_default,
|
|
6045
|
+
{
|
|
6046
|
+
contentType: contentMap.type,
|
|
6047
|
+
src: answerMap[answerMapKey],
|
|
6048
|
+
canFullScreen: false
|
|
6049
|
+
},
|
|
6050
|
+
`${uniqueValue}-${index}`
|
|
6051
|
+
) : null
|
|
6052
|
+
}
|
|
5876
6053
|
)
|
|
5877
6054
|
}
|
|
5878
6055
|
) })
|
|
@@ -5883,7 +6060,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5883
6060
|
var MatchingActivityMaterialContent_default = MatchingActivityMaterialContent;
|
|
5884
6061
|
|
|
5885
6062
|
// src/components/activities/MatchingActivityContent.tsx
|
|
5886
|
-
var
|
|
6063
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
5887
6064
|
var MatchingActivityContent = ({
|
|
5888
6065
|
answer,
|
|
5889
6066
|
data,
|
|
@@ -5904,16 +6081,16 @@ var MatchingActivityContent = ({
|
|
|
5904
6081
|
answerMap[key] = value;
|
|
5905
6082
|
changeAnswer(answer2);
|
|
5906
6083
|
};
|
|
5907
|
-
return /* @__PURE__ */ (0,
|
|
5908
|
-
/* @__PURE__ */ (0,
|
|
6084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
6085
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5909
6086
|
ActivityBodyContent_default,
|
|
5910
6087
|
{
|
|
5911
6088
|
bodyMap: matchingBodyMap,
|
|
5912
6089
|
templateType: "MATCHING"
|
|
5913
6090
|
}
|
|
5914
6091
|
),
|
|
5915
|
-
/* @__PURE__ */ (0,
|
|
5916
|
-
/* @__PURE__ */ (0,
|
|
6092
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DividerLine_default, {}),
|
|
6093
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
5917
6094
|
MatchingActivityMaterialContent_default,
|
|
5918
6095
|
{
|
|
5919
6096
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -5932,7 +6109,7 @@ var MatchingActivityContent_default = MatchingActivityContent;
|
|
|
5932
6109
|
|
|
5933
6110
|
// src/components/activities/material-contents/MCMAActivityMaterialContent.tsx
|
|
5934
6111
|
var import_react_katex7 = require("react-katex");
|
|
5935
|
-
var
|
|
6112
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5936
6113
|
var MCMAActivityMaterialContent = ({
|
|
5937
6114
|
uniqueValue,
|
|
5938
6115
|
answer,
|
|
@@ -5965,10 +6142,10 @@ var MCMAActivityMaterialContent = ({
|
|
|
5965
6142
|
const answerMap = retrieveAnswerMap();
|
|
5966
6143
|
const correctAnswerList = retrieveCorrectAnswerList();
|
|
5967
6144
|
return Object.keys(materialMap).map((materialKey, index) => {
|
|
5968
|
-
return /* @__PURE__ */ (0,
|
|
5969
|
-
/* @__PURE__ */ (0,
|
|
5970
|
-
/* @__PURE__ */ (0,
|
|
5971
|
-
checkCanAnswerQuestion() ? /* @__PURE__ */ (0,
|
|
6145
|
+
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: [
|
|
6146
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_mcma_text") }) }),
|
|
6147
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(DividerLine_default, {}) }),
|
|
6148
|
+
checkCanAnswerQuestion() ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex flex-row w-full flex-wrap ", children: materialMap[materialKey].map(
|
|
5972
6149
|
(materialSubKey, index2) => {
|
|
5973
6150
|
const foundAnswer = answerMap[materialKey].find(
|
|
5974
6151
|
(learnerAnswer) => learnerAnswer === materialSubKey
|
|
@@ -5981,7 +6158,7 @@ var MCMAActivityMaterialContent = ({
|
|
|
5981
6158
|
const foundIndex = correctAnswerList.findIndex(
|
|
5982
6159
|
(correctAnswer) => correctAnswer === materialSubKey
|
|
5983
6160
|
);
|
|
5984
|
-
return /* @__PURE__ */ (0,
|
|
6161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
5985
6162
|
"div",
|
|
5986
6163
|
{
|
|
5987
6164
|
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" : ""}`,
|
|
@@ -5989,7 +6166,7 @@ var MCMAActivityMaterialContent = ({
|
|
|
5989
6166
|
onChange(answer, materialKey, materialSubKey);
|
|
5990
6167
|
},
|
|
5991
6168
|
children: [
|
|
5992
|
-
/* @__PURE__ */ (0,
|
|
6169
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5993
6170
|
BaseImage_default,
|
|
5994
6171
|
{
|
|
5995
6172
|
src: answerMap[materialKey].includes(materialSubKey) ? "/icons/checkbox.webp" : "/icons/checkbox-empty.webp",
|
|
@@ -5999,16 +6176,16 @@ var MCMAActivityMaterialContent = ({
|
|
|
5999
6176
|
}
|
|
6000
6177
|
}
|
|
6001
6178
|
),
|
|
6002
|
-
/* @__PURE__ */ (0,
|
|
6179
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "flex-1", children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6003
6180
|
materialSubKey
|
|
6004
|
-
).map((inputPart, index3) => /* @__PURE__ */ (0,
|
|
6181
|
+
).map((inputPart, index3) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6005
6182
|
"span",
|
|
6006
6183
|
{
|
|
6007
6184
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6008
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
6185
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_katex7.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6009
6186
|
},
|
|
6010
6187
|
index3
|
|
6011
|
-
)) }) : /* @__PURE__ */ (0,
|
|
6188
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6012
6189
|
ShowMaterialMediaByContentType_default,
|
|
6013
6190
|
{
|
|
6014
6191
|
contentType: contentMap.type,
|
|
@@ -6022,13 +6199,13 @@ var MCMAActivityMaterialContent = ({
|
|
|
6022
6199
|
index2
|
|
6023
6200
|
);
|
|
6024
6201
|
}
|
|
6025
|
-
) }) : /* @__PURE__ */ (0,
|
|
6202
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
|
|
6026
6203
|
answerMap[materialKey]
|
|
6027
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0,
|
|
6204
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
6028
6205
|
"span",
|
|
6029
6206
|
{
|
|
6030
6207
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6031
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
6208
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_katex7.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6032
6209
|
},
|
|
6033
6210
|
index2
|
|
6034
6211
|
)) }, materialKey)
|
|
@@ -6038,7 +6215,7 @@ var MCMAActivityMaterialContent = ({
|
|
|
6038
6215
|
var MCMAActivityMaterialContent_default = MCMAActivityMaterialContent;
|
|
6039
6216
|
|
|
6040
6217
|
// src/components/activities/MCMAActivityContent.tsx
|
|
6041
|
-
var
|
|
6218
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6042
6219
|
var MCMAActivityContent = ({
|
|
6043
6220
|
answer,
|
|
6044
6221
|
data,
|
|
@@ -6066,11 +6243,11 @@ var MCMAActivityContent = ({
|
|
|
6066
6243
|
}
|
|
6067
6244
|
changeAnswer(answer2);
|
|
6068
6245
|
};
|
|
6069
|
-
return /* @__PURE__ */ (0,
|
|
6070
|
-
/* @__PURE__ */ (0,
|
|
6071
|
-
/* @__PURE__ */ (0,
|
|
6072
|
-
/* @__PURE__ */ (0,
|
|
6073
|
-
/* @__PURE__ */ (0,
|
|
6246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
6247
|
+
/* @__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" }) }),
|
|
6248
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${isFullScreen ? "contents" : "contents md:hidden"}`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(DividerLine_default, {}) }),
|
|
6249
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${isFullScreen ? "hidden" : "hidden md:block"}`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(VerticalDividerLine_default, {}) }),
|
|
6250
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
6074
6251
|
MCMAActivityMaterialContent_default,
|
|
6075
6252
|
{
|
|
6076
6253
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -6088,7 +6265,7 @@ var MCMAActivityContent_default = MCMAActivityContent;
|
|
|
6088
6265
|
|
|
6089
6266
|
// src/components/activities/material-contents/MCSAActivityMaterialContent.tsx
|
|
6090
6267
|
var import_react_katex8 = require("react-katex");
|
|
6091
|
-
var
|
|
6268
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6092
6269
|
var MCSAActivityMaterialContent = ({
|
|
6093
6270
|
uniqueValue,
|
|
6094
6271
|
answer,
|
|
@@ -6118,10 +6295,10 @@ var MCSAActivityMaterialContent = ({
|
|
|
6118
6295
|
const answerMap = retrieveAnswerMap();
|
|
6119
6296
|
const correctAnswer = retrieveCorrectAnswer();
|
|
6120
6297
|
return Object.keys(materialMap).map((materialKey, index) => {
|
|
6121
|
-
return /* @__PURE__ */ (0,
|
|
6122
|
-
/* @__PURE__ */ (0,
|
|
6123
|
-
/* @__PURE__ */ (0,
|
|
6124
|
-
checkCanAnswerQuestion() ? /* @__PURE__ */ (0,
|
|
6298
|
+
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: [
|
|
6299
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "hidden md:block", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_mcsa_text") }) }),
|
|
6300
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(DividerLine_default, {}) }),
|
|
6301
|
+
checkCanAnswerQuestion() ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6125
6302
|
"div",
|
|
6126
6303
|
{
|
|
6127
6304
|
className: `flex flex-row w-full ${Object.keys(materialMap[materialKey]).length <= 4 ? "justify-center" : ""} flex-wrap`,
|
|
@@ -6132,7 +6309,7 @@ var MCSAActivityMaterialContent = ({
|
|
|
6132
6309
|
materialSubKey,
|
|
6133
6310
|
answerMap[materialKey]
|
|
6134
6311
|
);
|
|
6135
|
-
return /* @__PURE__ */ (0,
|
|
6312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
6136
6313
|
"div",
|
|
6137
6314
|
{
|
|
6138
6315
|
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" : ""}`,
|
|
@@ -6140,7 +6317,7 @@ var MCSAActivityMaterialContent = ({
|
|
|
6140
6317
|
onChange(answer, materialKey, materialSubKey);
|
|
6141
6318
|
},
|
|
6142
6319
|
children: [
|
|
6143
|
-
/* @__PURE__ */ (0,
|
|
6320
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6144
6321
|
BaseImage_default,
|
|
6145
6322
|
{
|
|
6146
6323
|
src: answerMap[materialKey] === materialSubKey ? "/icons/item-element.webp" : "/icons/not-selected-item-element.webp",
|
|
@@ -6150,16 +6327,16 @@ var MCSAActivityMaterialContent = ({
|
|
|
6150
6327
|
}
|
|
6151
6328
|
}
|
|
6152
6329
|
),
|
|
6153
|
-
/* @__PURE__ */ (0,
|
|
6330
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "flex-1", children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6154
6331
|
materialSubKey
|
|
6155
|
-
).map((inputPart, index3) => /* @__PURE__ */ (0,
|
|
6332
|
+
).map((inputPart, index3) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6156
6333
|
"span",
|
|
6157
6334
|
{
|
|
6158
6335
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6159
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
6336
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_katex8.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6160
6337
|
},
|
|
6161
6338
|
index3
|
|
6162
|
-
)) }) : /* @__PURE__ */ (0,
|
|
6339
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6163
6340
|
ShowMaterialMediaByContentType_default,
|
|
6164
6341
|
{
|
|
6165
6342
|
contentType: contentMap.type,
|
|
@@ -6175,13 +6352,13 @@ var MCSAActivityMaterialContent = ({
|
|
|
6175
6352
|
}
|
|
6176
6353
|
)
|
|
6177
6354
|
}
|
|
6178
|
-
) : /* @__PURE__ */ (0,
|
|
6355
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6179
6356
|
answerMap[materialKey]
|
|
6180
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0,
|
|
6357
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
6181
6358
|
"span",
|
|
6182
6359
|
{
|
|
6183
6360
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6184
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
6361
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react_katex8.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6185
6362
|
},
|
|
6186
6363
|
index2
|
|
6187
6364
|
)) })
|
|
@@ -6191,7 +6368,7 @@ var MCSAActivityMaterialContent = ({
|
|
|
6191
6368
|
var MCSAActivityMaterialContent_default = MCSAActivityMaterialContent;
|
|
6192
6369
|
|
|
6193
6370
|
// src/components/activities/MCSAActivityContent.tsx
|
|
6194
|
-
var
|
|
6371
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6195
6372
|
var MCSAActivityContent = ({
|
|
6196
6373
|
answer,
|
|
6197
6374
|
data,
|
|
@@ -6212,11 +6389,11 @@ var MCSAActivityContent = ({
|
|
|
6212
6389
|
answerMap[key] = value;
|
|
6213
6390
|
changeAnswer(answer2);
|
|
6214
6391
|
};
|
|
6215
|
-
return /* @__PURE__ */ (0,
|
|
6216
|
-
/* @__PURE__ */ (0,
|
|
6217
|
-
/* @__PURE__ */ (0,
|
|
6218
|
-
/* @__PURE__ */ (0,
|
|
6219
|
-
/* @__PURE__ */ (0,
|
|
6392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
6393
|
+
/* @__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" }) }),
|
|
6394
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `${isFullScreen ? "contents" : "contents md:hidden"}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(DividerLine_default, {}) }),
|
|
6395
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `${isFullScreen ? "hidden" : "hidden md:block"}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(VerticalDividerLine_default, {}) }),
|
|
6396
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
6220
6397
|
MCSAActivityMaterialContent_default,
|
|
6221
6398
|
{
|
|
6222
6399
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -6261,7 +6438,7 @@ var retrieveDocumentTypeFromExtension = (format) => {
|
|
|
6261
6438
|
};
|
|
6262
6439
|
|
|
6263
6440
|
// src/components/activities/material-contents/OpenEndedActivityMaterialContent.tsx
|
|
6264
|
-
var
|
|
6441
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6265
6442
|
var OpenEndedActivityMaterialContent = ({
|
|
6266
6443
|
answer,
|
|
6267
6444
|
contentMap,
|
|
@@ -6291,7 +6468,7 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6291
6468
|
documentType = retrieveDocumentTypeFromExtension(extension);
|
|
6292
6469
|
}
|
|
6293
6470
|
if (documentType === "IMAGE") {
|
|
6294
|
-
return /* @__PURE__ */ (0,
|
|
6471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col justify-center items-center my-5", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6295
6472
|
BaseImage_default,
|
|
6296
6473
|
{
|
|
6297
6474
|
src: answerMapAnswer,
|
|
@@ -6301,9 +6478,9 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6301
6478
|
}
|
|
6302
6479
|
) });
|
|
6303
6480
|
} else if (documentType === "PDF") {
|
|
6304
|
-
return /* @__PURE__ */ (0,
|
|
6481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(BasePDF_default, { file: answerMapAnswer });
|
|
6305
6482
|
} else if (documentType === "AUDIO") {
|
|
6306
|
-
return /* @__PURE__ */ (0,
|
|
6483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-[56px]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6307
6484
|
"audio",
|
|
6308
6485
|
{
|
|
6309
6486
|
className: "h-full w-full rounded-catchup-xlarge",
|
|
@@ -6314,7 +6491,7 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6314
6491
|
}
|
|
6315
6492
|
) });
|
|
6316
6493
|
} else if (documentType === "TEXT") {
|
|
6317
|
-
return /* @__PURE__ */ (0,
|
|
6494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6318
6495
|
InputGroup_default,
|
|
6319
6496
|
{
|
|
6320
6497
|
type: "textarea",
|
|
@@ -6333,7 +6510,7 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6333
6510
|
const answerMapAnswer = answerMap2["ANSWER"];
|
|
6334
6511
|
const extension = answerMapAnswer.split(".").pop();
|
|
6335
6512
|
const documentType = retrieveDocumentTypeFromExtension(extension);
|
|
6336
|
-
return /* @__PURE__ */ (0,
|
|
6513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: documentType === "IMAGE" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col justify-center items-center my-5", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6337
6514
|
BaseImage_default,
|
|
6338
6515
|
{
|
|
6339
6516
|
src: answerMapAnswer,
|
|
@@ -6341,11 +6518,11 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6341
6518
|
size: "custom",
|
|
6342
6519
|
className: "w-[80%] rounded-catchup-xlarge"
|
|
6343
6520
|
}
|
|
6344
|
-
) }) : documentType === "PDF" ? /* @__PURE__ */ (0,
|
|
6521
|
+
) }) : documentType === "PDF" ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "flex flex-col justify-center items-center my-5", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(BasePDF_default, { file: answerMapAnswer }) }) : null });
|
|
6345
6522
|
};
|
|
6346
6523
|
const RenderAudioContent = (answerMap2) => {
|
|
6347
6524
|
const answerMapAnswer = answerMap2["ANSWER"];
|
|
6348
|
-
return /* @__PURE__ */ (0,
|
|
6525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "h-[56px]", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
6349
6526
|
"audio",
|
|
6350
6527
|
{
|
|
6351
6528
|
className: "h-full w-full rounded-catchup-xlarge",
|
|
@@ -6357,16 +6534,16 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6357
6534
|
) });
|
|
6358
6535
|
};
|
|
6359
6536
|
const answerMap = retrieveAnswerMap();
|
|
6360
|
-
return /* @__PURE__ */ (0,
|
|
6361
|
-
/* @__PURE__ */ (0,
|
|
6362
|
-
/* @__PURE__ */ (0,
|
|
6537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_jsx_runtime38.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "", children: [
|
|
6538
|
+
/* @__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") }) }),
|
|
6539
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(DividerLine_default, {}) }),
|
|
6363
6540
|
contentMap.type === "TEXT" ? RenderTextContent(answerMap) : contentMap.type === "IMAGE" ? RenderImageContent(answerMap) : contentMap.type === "AUDIO" ? RenderAudioContent(answerMap) : null
|
|
6364
6541
|
] }) });
|
|
6365
6542
|
};
|
|
6366
6543
|
var OpenEndedActivityMaterialContent_default = OpenEndedActivityMaterialContent;
|
|
6367
6544
|
|
|
6368
6545
|
// src/components/activities/OpenEndedActivityContent.tsx
|
|
6369
|
-
var
|
|
6546
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6370
6547
|
var OpenEndedActivityContent = ({
|
|
6371
6548
|
answer,
|
|
6372
6549
|
data,
|
|
@@ -6387,12 +6564,12 @@ var OpenEndedActivityContent = ({
|
|
|
6387
6564
|
answerMap["ANSWER"] = value;
|
|
6388
6565
|
changeAnswer(answer2);
|
|
6389
6566
|
};
|
|
6390
|
-
return /* @__PURE__ */ (0,
|
|
6391
|
-
/* @__PURE__ */ (0,
|
|
6567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
6568
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6392
6569
|
"div",
|
|
6393
6570
|
{
|
|
6394
6571
|
className: `${showMaterialContent ? isFullScreen ? "w-full" : "w-full md:w-[40%]" : "w-full"}`,
|
|
6395
|
-
children: /* @__PURE__ */ (0,
|
|
6572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6396
6573
|
ActivityBodyContent_default,
|
|
6397
6574
|
{
|
|
6398
6575
|
bodyMap: openEndedBodyMap,
|
|
@@ -6401,16 +6578,16 @@ var OpenEndedActivityContent = ({
|
|
|
6401
6578
|
)
|
|
6402
6579
|
}
|
|
6403
6580
|
),
|
|
6404
|
-
showMaterialContent ? /* @__PURE__ */ (0,
|
|
6405
|
-
/* @__PURE__ */ (0,
|
|
6581
|
+
showMaterialContent ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
6582
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6406
6583
|
"div",
|
|
6407
6584
|
{
|
|
6408
6585
|
className: `${isFullScreen ? "contents" : "contents md:hidden"}`,
|
|
6409
|
-
children: /* @__PURE__ */ (0,
|
|
6586
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DividerLine_default, {})
|
|
6410
6587
|
}
|
|
6411
6588
|
),
|
|
6412
|
-
/* @__PURE__ */ (0,
|
|
6413
|
-
/* @__PURE__ */ (0,
|
|
6589
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: `${isFullScreen ? "hidden" : "hidden md:block"}`, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(VerticalDividerLine_default, {}) }),
|
|
6590
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
6414
6591
|
OpenEndedActivityMaterialContent_default,
|
|
6415
6592
|
{
|
|
6416
6593
|
answer,
|
|
@@ -6425,21 +6602,21 @@ var OpenEndedActivityContent = ({
|
|
|
6425
6602
|
var OpenEndedActivityContent_default = OpenEndedActivityContent;
|
|
6426
6603
|
|
|
6427
6604
|
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6428
|
-
var
|
|
6605
|
+
var import_react23 = require("react");
|
|
6429
6606
|
var import_react_katex9 = require("react-katex");
|
|
6430
6607
|
|
|
6431
6608
|
// src/hooks/useScreenSize.ts
|
|
6432
|
-
var
|
|
6609
|
+
var import_react22 = require("react");
|
|
6433
6610
|
var useScreenSize = () => {
|
|
6434
|
-
const [containerSize, setContainerSize] = (0,
|
|
6611
|
+
const [containerSize, setContainerSize] = (0, import_react22.useState)({
|
|
6435
6612
|
width: 0,
|
|
6436
6613
|
height: 0
|
|
6437
6614
|
});
|
|
6438
|
-
const [screenSize, setScreenSize] = (0,
|
|
6615
|
+
const [screenSize, setScreenSize] = (0, import_react22.useState)({
|
|
6439
6616
|
width: window.innerWidth,
|
|
6440
6617
|
height: window.innerHeight
|
|
6441
6618
|
});
|
|
6442
|
-
(0,
|
|
6619
|
+
(0, import_react22.useEffect)(() => {
|
|
6443
6620
|
const handleResize = () => {
|
|
6444
6621
|
setScreenSize({
|
|
6445
6622
|
width: window.innerWidth,
|
|
@@ -6464,7 +6641,7 @@ var useScreenSize = () => {
|
|
|
6464
6641
|
var useScreenSize_default = useScreenSize;
|
|
6465
6642
|
|
|
6466
6643
|
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6467
|
-
var
|
|
6644
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
6468
6645
|
var OrderingActivityMaterialContent = ({
|
|
6469
6646
|
uniqueValue,
|
|
6470
6647
|
answer,
|
|
@@ -6475,20 +6652,24 @@ var OrderingActivityMaterialContent = ({
|
|
|
6475
6652
|
isPreview,
|
|
6476
6653
|
showCorrectAnswer
|
|
6477
6654
|
}) => {
|
|
6478
|
-
const [selectedKey, setSelectedKey] = (0,
|
|
6479
|
-
const [draggedKey, setDraggedKey] = (0,
|
|
6480
|
-
const [dropTargetKey, setDropTargetKey] = (0,
|
|
6481
|
-
const [draggedElement, setDraggedElement] = (0,
|
|
6655
|
+
const [selectedKey, setSelectedKey] = (0, import_react23.useState)(null);
|
|
6656
|
+
const [draggedKey, setDraggedKey] = (0, import_react23.useState)(null);
|
|
6657
|
+
const [dropTargetKey, setDropTargetKey] = (0, import_react23.useState)(null);
|
|
6658
|
+
const [draggedElement, setDraggedElement] = (0, import_react23.useState)(
|
|
6482
6659
|
null
|
|
6483
6660
|
);
|
|
6484
|
-
const dragElementRef = (0,
|
|
6485
|
-
const [
|
|
6661
|
+
const dragElementRef = (0, import_react23.useRef)(null);
|
|
6662
|
+
const [mousePosition, setMousePosition] = (0, import_react23.useState)({
|
|
6663
|
+
x: 0,
|
|
6664
|
+
y: 0
|
|
6665
|
+
});
|
|
6666
|
+
const [touchPosition, setTouchPosition] = (0, import_react23.useState)({
|
|
6486
6667
|
x: 0,
|
|
6487
6668
|
y: 0
|
|
6488
6669
|
});
|
|
6489
6670
|
const { screenSize } = useScreenSize_default();
|
|
6490
|
-
const [view, setView] = (0,
|
|
6491
|
-
(0,
|
|
6671
|
+
const [view, setView] = (0, import_react23.useState)("PC");
|
|
6672
|
+
(0, import_react23.useEffect)(() => {
|
|
6492
6673
|
if (!screenSize) return;
|
|
6493
6674
|
if (screenSize.width <= 1024) {
|
|
6494
6675
|
setView("TABLET");
|
|
@@ -6496,7 +6677,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6496
6677
|
setView("PC");
|
|
6497
6678
|
}
|
|
6498
6679
|
}, [screenSize]);
|
|
6499
|
-
(0,
|
|
6680
|
+
(0, import_react23.useEffect)(() => {
|
|
6500
6681
|
if (!showCorrectAnswer) return;
|
|
6501
6682
|
const answerMap2 = answer.data.find(
|
|
6502
6683
|
(answerData) => answerData.type === "ORDERING"
|
|
@@ -6543,6 +6724,19 @@ var OrderingActivityMaterialContent = ({
|
|
|
6543
6724
|
e.preventDefault();
|
|
6544
6725
|
setDraggedKey(materialKey);
|
|
6545
6726
|
setSelectedKey(null);
|
|
6727
|
+
setMousePosition({ x: e.clientX, y: e.clientY });
|
|
6728
|
+
};
|
|
6729
|
+
const handleMouseMove = (e) => {
|
|
6730
|
+
if (!draggedKey) return;
|
|
6731
|
+
setMousePosition({ x: e.clientX, y: e.clientY });
|
|
6732
|
+
const elementUnder = document.elementFromPoint(e.clientX, e.clientY);
|
|
6733
|
+
const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-ordering-drop-zone]");
|
|
6734
|
+
if (dropZone) {
|
|
6735
|
+
const dropKey = dropZone.getAttribute("data-ordering-drop-zone");
|
|
6736
|
+
setDropTargetKey(dropKey);
|
|
6737
|
+
} else {
|
|
6738
|
+
setDropTargetKey(null);
|
|
6739
|
+
}
|
|
6546
6740
|
};
|
|
6547
6741
|
const handleMouseUp = () => {
|
|
6548
6742
|
if (dropTargetKey !== null && draggedKey !== null && dropTargetKey !== draggedKey) {
|
|
@@ -6550,6 +6744,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6550
6744
|
}
|
|
6551
6745
|
setDraggedKey(null);
|
|
6552
6746
|
setDropTargetKey(null);
|
|
6747
|
+
setMousePosition({ x: 0, y: 0 });
|
|
6553
6748
|
};
|
|
6554
6749
|
const handleTouchStart = (e, materialKey, element) => {
|
|
6555
6750
|
if (!checkCanAnswerQuestion()) return;
|
|
@@ -6582,6 +6777,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6582
6777
|
setDraggedKey(null);
|
|
6583
6778
|
setDropTargetKey(null);
|
|
6584
6779
|
setDraggedElement(null);
|
|
6780
|
+
setTouchPosition({ x: 0, y: 0 });
|
|
6585
6781
|
};
|
|
6586
6782
|
const handleSelectItem = (materialKey) => {
|
|
6587
6783
|
if (!checkCanAnswerQuestion()) return;
|
|
@@ -6596,105 +6792,142 @@ var OrderingActivityMaterialContent = ({
|
|
|
6596
6792
|
setDraggedKey(null);
|
|
6597
6793
|
};
|
|
6598
6794
|
const answerMap = retrieveAnswerMap();
|
|
6599
|
-
return /* @__PURE__ */ (0,
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
},
|
|
6609
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6610
|
-
materialMap[answerMap[draggedKey]]
|
|
6611
|
-
).map((inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6612
|
-
"span",
|
|
6795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6796
|
+
"div",
|
|
6797
|
+
{
|
|
6798
|
+
className: "flex flex-row flex-wrap",
|
|
6799
|
+
onMouseMove: handleMouseMove,
|
|
6800
|
+
onMouseUp: handleMouseUp,
|
|
6801
|
+
children: [
|
|
6802
|
+
draggedKey && mousePosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6803
|
+
"div",
|
|
6613
6804
|
{
|
|
6614
|
-
className:
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6805
|
+
className: "fixed pointer-events-none z-50 opacity-80",
|
|
6806
|
+
style: {
|
|
6807
|
+
left: `${mousePosition.x}px`,
|
|
6808
|
+
top: `${mousePosition.y}px`,
|
|
6809
|
+
transform: "translate(-50%, -50%)"
|
|
6810
|
+
},
|
|
6811
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6812
|
+
materialMap[answerMap[draggedKey]]
|
|
6813
|
+
).map((inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6814
|
+
"span",
|
|
6815
|
+
{
|
|
6816
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6817
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_katex9.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6818
|
+
},
|
|
6819
|
+
index
|
|
6820
|
+
)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6821
|
+
ShowMaterialMediaByContentType_default,
|
|
6822
|
+
{
|
|
6823
|
+
contentType: contentMap.type,
|
|
6824
|
+
src: materialMap[answerMap[draggedKey]],
|
|
6825
|
+
canFullScreen: false
|
|
6826
|
+
},
|
|
6827
|
+
`${uniqueValue}-drag-mouse`
|
|
6828
|
+
) })
|
|
6829
|
+
}
|
|
6830
|
+
),
|
|
6831
|
+
draggedKey && touchPosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6832
|
+
"div",
|
|
6620
6833
|
{
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
answerMap[materialKey] + "",
|
|
6632
|
-
index + ""
|
|
6633
|
-
);
|
|
6634
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-full lg:w-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
6635
|
-
"div",
|
|
6636
|
-
{
|
|
6637
|
-
className: `flex flex-row items-center my-4 mx-2`,
|
|
6638
|
-
style: {
|
|
6639
|
-
marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
|
|
6640
|
-
},
|
|
6641
|
-
children: [
|
|
6642
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mr-3", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-catchup-activity-box-item w-catchup-activity-box-item flex flex-col items-center justify-center cursor-pointer transition-all duration-300 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6643
|
-
"div",
|
|
6834
|
+
className: "fixed pointer-events-none z-50 opacity-80",
|
|
6835
|
+
style: {
|
|
6836
|
+
left: `${touchPosition.x}px`,
|
|
6837
|
+
top: `${touchPosition.y}px`,
|
|
6838
|
+
transform: "translate(-50%, -50%)"
|
|
6839
|
+
},
|
|
6840
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6841
|
+
materialMap[answerMap[draggedKey]]
|
|
6842
|
+
).map((inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6843
|
+
"span",
|
|
6644
6844
|
{
|
|
6645
|
-
className: `${
|
|
6646
|
-
children: /* @__PURE__ */ (0,
|
|
6647
|
-
}
|
|
6648
|
-
|
|
6649
|
-
/* @__PURE__ */ (0,
|
|
6650
|
-
|
|
6845
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6846
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_katex9.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6847
|
+
},
|
|
6848
|
+
index
|
|
6849
|
+
)) }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6850
|
+
ShowMaterialMediaByContentType_default,
|
|
6651
6851
|
{
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6852
|
+
contentType: contentMap.type,
|
|
6853
|
+
src: materialMap[answerMap[draggedKey]],
|
|
6854
|
+
canFullScreen: false
|
|
6855
|
+
},
|
|
6856
|
+
`${uniqueValue}-drag-touch`
|
|
6857
|
+
) })
|
|
6858
|
+
}
|
|
6859
|
+
),
|
|
6860
|
+
Object.keys(answerMap).map((materialKey, index) => {
|
|
6861
|
+
const learnerAnswerState = checkAnswerState(
|
|
6862
|
+
answerMap[materialKey] + "",
|
|
6863
|
+
index + ""
|
|
6864
|
+
);
|
|
6865
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full lg:w-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6866
|
+
"div",
|
|
6867
|
+
{
|
|
6868
|
+
className: `flex flex-row items-center my-4 mx-2`,
|
|
6869
|
+
style: {
|
|
6870
|
+
marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
|
|
6871
|
+
},
|
|
6872
|
+
children: [
|
|
6873
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mr-3", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "h-catchup-activity-box-item w-catchup-activity-box-item flex flex-col items-center justify-center cursor-pointer transition-all duration-300 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6662
6874
|
"div",
|
|
6663
6875
|
{
|
|
6664
|
-
className: `${
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6876
|
+
className: `${selectedKey === materialKey ? "border-2 border-catchup-light-gray" : "border-2 border-catchup-blue"} flex flex-col items-center justify-center transition-all duration-300 rounded-catchup-full w-[50px] h-[50px]`,
|
|
6877
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "", children: parseFloat(materialKey) + 1 })
|
|
6878
|
+
}
|
|
6879
|
+
) }) }),
|
|
6880
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6881
|
+
"div",
|
|
6882
|
+
{
|
|
6883
|
+
ref: draggedKey === materialKey ? dragElementRef : null,
|
|
6884
|
+
"data-ordering-drop-zone": materialKey,
|
|
6885
|
+
className: `flex-1 ${draggedKey === materialKey ? "opacity-40" : selectedKey === materialKey ? "ring-2 ring-blue-500" : "opacity-100"} ${dropTargetKey === materialKey && draggedKey !== materialKey ? "ring-2 ring-blue-400 bg-blue-50" : ""} transition-all duration-200`,
|
|
6886
|
+
onMouseDown: (e) => handleMouseDown(e, materialKey),
|
|
6887
|
+
onMouseEnter: () => draggedKey && draggedKey !== materialKey && setDropTargetKey(materialKey),
|
|
6888
|
+
onMouseLeave: () => setDropTargetKey(null),
|
|
6889
|
+
onTouchStart: (e) => handleTouchStart(e, materialKey, e.currentTarget),
|
|
6890
|
+
onTouchMove: handleTouchMove,
|
|
6891
|
+
onTouchEnd: handleTouchEnd,
|
|
6892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6893
|
+
"div",
|
|
6677
6894
|
{
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6895
|
+
className: `${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"} flex flex-col items-center justify-center border-2 rounded-catchup-xlarge cursor-pointer p-3 ${learnerAnswerState === "CORRECT" ? "border-catchup-green" : learnerAnswerState === "INCORRECT" ? "border-catchup-red" : "border-catchup-blue"}`,
|
|
6896
|
+
onClick: () => handleSelectItem(materialKey),
|
|
6897
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6898
|
+
materialMap[answerMap[materialKey]]
|
|
6899
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6900
|
+
"span",
|
|
6901
|
+
{
|
|
6902
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6903
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_katex9.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6904
|
+
},
|
|
6905
|
+
index2
|
|
6906
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6907
|
+
ShowMaterialMediaByContentType_default,
|
|
6908
|
+
{
|
|
6909
|
+
contentType: contentMap.type,
|
|
6910
|
+
src: materialMap[answerMap[materialKey]],
|
|
6911
|
+
canFullScreen: true
|
|
6912
|
+
},
|
|
6913
|
+
`${uniqueValue}-${index}`
|
|
6914
|
+
)
|
|
6915
|
+
}
|
|
6683
6916
|
)
|
|
6684
6917
|
}
|
|
6685
6918
|
)
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
}
|
|
6690
|
-
|
|
6691
|
-
}
|
|
6692
|
-
|
|
6919
|
+
]
|
|
6920
|
+
}
|
|
6921
|
+
) }, index);
|
|
6922
|
+
})
|
|
6923
|
+
]
|
|
6924
|
+
}
|
|
6925
|
+
);
|
|
6693
6926
|
};
|
|
6694
6927
|
var OrderingActivityMaterialContent_default = OrderingActivityMaterialContent;
|
|
6695
6928
|
|
|
6696
6929
|
// src/components/activities/OrderingActivityContent.tsx
|
|
6697
|
-
var
|
|
6930
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
6698
6931
|
var OrderingActivityContent = ({
|
|
6699
6932
|
answer,
|
|
6700
6933
|
data,
|
|
@@ -6718,16 +6951,16 @@ var OrderingActivityContent = ({
|
|
|
6718
6951
|
answerMap[secondaryKey] = prevValue;
|
|
6719
6952
|
changeAnswer(answer2);
|
|
6720
6953
|
};
|
|
6721
|
-
return /* @__PURE__ */ (0,
|
|
6722
|
-
/* @__PURE__ */ (0,
|
|
6954
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
6955
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6723
6956
|
ActivityBodyContent_default,
|
|
6724
6957
|
{
|
|
6725
6958
|
bodyMap: orderingBodyMap,
|
|
6726
6959
|
templateType: "ORDERING"
|
|
6727
6960
|
}
|
|
6728
6961
|
),
|
|
6729
|
-
/* @__PURE__ */ (0,
|
|
6730
|
-
/* @__PURE__ */ (0,
|
|
6962
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DividerLine_default, {}),
|
|
6963
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6731
6964
|
OrderingActivityMaterialContent_default,
|
|
6732
6965
|
{
|
|
6733
6966
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -6745,9 +6978,9 @@ var OrderingActivityContent = ({
|
|
|
6745
6978
|
var OrderingActivityContent_default = OrderingActivityContent;
|
|
6746
6979
|
|
|
6747
6980
|
// src/components/activities/material-contents/TrueFalseActivityMaterialContent.tsx
|
|
6748
|
-
var
|
|
6981
|
+
var import_react24 = require("react");
|
|
6749
6982
|
var import_react_katex10 = require("react-katex");
|
|
6750
|
-
var
|
|
6983
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6751
6984
|
var TrueFalseActivityMaterialContent = ({
|
|
6752
6985
|
uniqueValue,
|
|
6753
6986
|
answer,
|
|
@@ -6759,8 +6992,8 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6759
6992
|
showCorrectAnswer
|
|
6760
6993
|
}) => {
|
|
6761
6994
|
const { screenSize } = useScreenSize_default();
|
|
6762
|
-
const [shuffleOptionList, setShuffleOptionList] = (0,
|
|
6763
|
-
(0,
|
|
6995
|
+
const [shuffleOptionList, setShuffleOptionList] = (0, import_react24.useState)([]);
|
|
6996
|
+
(0, import_react24.useEffect)(() => {
|
|
6764
6997
|
const optionList = [];
|
|
6765
6998
|
optionList.push(...materialMap.trueList);
|
|
6766
6999
|
optionList.push(...materialMap.falseList);
|
|
@@ -6770,7 +7003,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6770
7003
|
setShuffleOptionList(shuffleArray(optionList));
|
|
6771
7004
|
}
|
|
6772
7005
|
}, []);
|
|
6773
|
-
(0,
|
|
7006
|
+
(0, import_react24.useEffect)(() => {
|
|
6774
7007
|
if (!showCorrectAnswer) return;
|
|
6775
7008
|
answer.data.find(
|
|
6776
7009
|
(answerData) => answerData.type === "TRUE_FALSE"
|
|
@@ -6800,14 +7033,14 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6800
7033
|
return "INCORRECT";
|
|
6801
7034
|
};
|
|
6802
7035
|
const answerMap = retrieveAnswerMap();
|
|
6803
|
-
return /* @__PURE__ */ (0,
|
|
6804
|
-
/* @__PURE__ */ (0,
|
|
6805
|
-
/* @__PURE__ */ (0,
|
|
6806
|
-
/* @__PURE__ */ (0,
|
|
6807
|
-
/* @__PURE__ */ (0,
|
|
6808
|
-
/* @__PURE__ */ (0,
|
|
7036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "", children: [
|
|
7037
|
+
/* @__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") }) }),
|
|
7038
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DividerLine_default, {}) }),
|
|
7039
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-row justify-end items-center gap-x-2", children: [
|
|
7040
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-[50px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "font-bold text-lg", children: i18n_default.t("true") }) }),
|
|
7041
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-[50px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "font-bold text-lg", children: i18n_default.t("false") }) })
|
|
6809
7042
|
] }),
|
|
6810
|
-
checkCanAnswerQuestion() ? /* @__PURE__ */ (0,
|
|
7043
|
+
checkCanAnswerQuestion() ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: `flex flex-row w-full justify-center flex-wrap`, children: shuffleOptionList.map((shuffleOption, index) => {
|
|
6811
7044
|
const correctAnswer = materialMap.trueList.find(
|
|
6812
7045
|
(trueItem) => trueItem === shuffleOption
|
|
6813
7046
|
) !== void 0 ? "TRUE" : "FALSE";
|
|
@@ -6818,21 +7051,21 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6818
7051
|
correctAnswer,
|
|
6819
7052
|
learnerAnswer
|
|
6820
7053
|
);
|
|
6821
|
-
return /* @__PURE__ */ (0,
|
|
7054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
6822
7055
|
"div",
|
|
6823
7056
|
{
|
|
6824
7057
|
className: `w-full flex flex-row items-center justify-center cursor-pointer my-2 ${learnerAnswerState === "CORRECT" ? "border-2 border-catchup-green rounded-catchup-xlarge p-2" : learnerAnswerState === "INCORRECT" ? "border-2 border-catchup-red rounded-catchup-xlarge p-2" : ""}`,
|
|
6825
7058
|
children: [
|
|
6826
|
-
/* @__PURE__ */ (0,
|
|
7059
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex-1", children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "text-xl p-2 whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6827
7060
|
shuffleOption
|
|
6828
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0,
|
|
7061
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6829
7062
|
"span",
|
|
6830
7063
|
{
|
|
6831
7064
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6832
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
7065
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_katex10.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6833
7066
|
},
|
|
6834
7067
|
index2
|
|
6835
|
-
)) }) : /* @__PURE__ */ (0,
|
|
7068
|
+
)) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6836
7069
|
ShowMaterialMediaByContentType_default,
|
|
6837
7070
|
{
|
|
6838
7071
|
contentType: contentMap.type,
|
|
@@ -6841,8 +7074,8 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6841
7074
|
},
|
|
6842
7075
|
`${uniqueValue}-${index}`
|
|
6843
7076
|
) }),
|
|
6844
|
-
/* @__PURE__ */ (0,
|
|
6845
|
-
/* @__PURE__ */ (0,
|
|
7077
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
7078
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-[50px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex flex-col items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6846
7079
|
BaseImage_default,
|
|
6847
7080
|
{
|
|
6848
7081
|
src: answerMap.trueList.includes(shuffleOption) ? "/icons/checkbox.webp" : "/icons/checkbox-empty.webp",
|
|
@@ -6853,7 +7086,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6853
7086
|
}
|
|
6854
7087
|
}
|
|
6855
7088
|
) }) }),
|
|
6856
|
-
/* @__PURE__ */ (0,
|
|
7089
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-[50px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex flex-col items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
6857
7090
|
BaseImage_default,
|
|
6858
7091
|
{
|
|
6859
7092
|
src: answerMap.falseList.includes(shuffleOption) ? "/icons/checkbox.webp" : "/icons/checkbox-empty.webp",
|
|
@@ -6869,14 +7102,14 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6869
7102
|
},
|
|
6870
7103
|
index
|
|
6871
7104
|
);
|
|
6872
|
-
}) }) : /* @__PURE__ */ (0,
|
|
6873
|
-
answerMap.trueList.map((item) => /* @__PURE__ */ (0,
|
|
6874
|
-
/* @__PURE__ */ (0,
|
|
6875
|
-
/* @__PURE__ */ (0,
|
|
7105
|
+
}) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
7106
|
+
answerMap.trueList.map((item) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
7107
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: item }) }),
|
|
7108
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-[50px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "underline", children: i18n_default.t("true") }) })
|
|
6876
7109
|
] })),
|
|
6877
|
-
answerMap.falseList.map((item) => /* @__PURE__ */ (0,
|
|
6878
|
-
/* @__PURE__ */ (0,
|
|
6879
|
-
/* @__PURE__ */ (0,
|
|
7110
|
+
answerMap.falseList.map((item) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
7111
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: item }) }),
|
|
7112
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-[50px]", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "underline", children: i18n_default.t("false") }) })
|
|
6880
7113
|
] }))
|
|
6881
7114
|
] })
|
|
6882
7115
|
] });
|
|
@@ -6884,7 +7117,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6884
7117
|
var TrueFalseActivityMaterialContent_default = TrueFalseActivityMaterialContent;
|
|
6885
7118
|
|
|
6886
7119
|
// src/components/activities/TrueFalseActivityContent.tsx
|
|
6887
|
-
var
|
|
7120
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
6888
7121
|
var TrueFalseActivityContent = ({
|
|
6889
7122
|
answer,
|
|
6890
7123
|
data,
|
|
@@ -6935,17 +7168,17 @@ var TrueFalseActivityContent = ({
|
|
|
6935
7168
|
}
|
|
6936
7169
|
changeAnswer(answer2);
|
|
6937
7170
|
};
|
|
6938
|
-
return /* @__PURE__ */ (0,
|
|
6939
|
-
/* @__PURE__ */ (0,
|
|
7171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
7172
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[40%]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6940
7173
|
ActivityBodyContent_default,
|
|
6941
7174
|
{
|
|
6942
7175
|
bodyMap: trueFalseBodyMap,
|
|
6943
7176
|
templateType: "GROUPING"
|
|
6944
7177
|
}
|
|
6945
7178
|
) }),
|
|
6946
|
-
/* @__PURE__ */ (0,
|
|
6947
|
-
/* @__PURE__ */ (0,
|
|
6948
|
-
/* @__PURE__ */ (0,
|
|
7179
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `${isFullScreen ? "contents" : "contents md:hidden"}`, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(DividerLine_default, {}) }),
|
|
7180
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `${isFullScreen ? "hidden" : "hidden md:block"}`, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(VerticalDividerLine_default, {}) }),
|
|
7181
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
6949
7182
|
TrueFalseActivityMaterialContent_default,
|
|
6950
7183
|
{
|
|
6951
7184
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -6964,7 +7197,7 @@ var TrueFalseActivityContent_default = TrueFalseActivityContent;
|
|
|
6964
7197
|
|
|
6965
7198
|
// src/components/activities/solution-contents/ActivitySolutionContent.tsx
|
|
6966
7199
|
var import_react_katex11 = require("react-katex");
|
|
6967
|
-
var
|
|
7200
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
6968
7201
|
var ActivitySolutionContent = ({
|
|
6969
7202
|
activityTemplateType,
|
|
6970
7203
|
data
|
|
@@ -6994,8 +7227,8 @@ var ActivitySolutionContent = ({
|
|
|
6994
7227
|
return null;
|
|
6995
7228
|
}
|
|
6996
7229
|
if (!solutionMap || Object.keys(solutionMap).length === 0) return null;
|
|
6997
|
-
return /* @__PURE__ */ (0,
|
|
6998
|
-
/* @__PURE__ */ (0,
|
|
7230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "p-4 border-catchup-blue border-2 rounded-catchup-xlarge", children: [
|
|
7231
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "text-xl font-bold text-center mb-3", children: i18n_default.t("solution") }),
|
|
6999
7232
|
Object.keys(solutionMap).map((key) => {
|
|
7000
7233
|
let currentItem;
|
|
7001
7234
|
try {
|
|
@@ -7005,12 +7238,12 @@ var ActivitySolutionContent = ({
|
|
|
7005
7238
|
return null;
|
|
7006
7239
|
}
|
|
7007
7240
|
const { value } = currentItem;
|
|
7008
|
-
return /* @__PURE__ */ (0,
|
|
7009
|
-
(inputPart, partIndex) => /* @__PURE__ */ (0,
|
|
7241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "my-3 text-xl", children: constructInputWithSpecialExpressionList(value).map(
|
|
7242
|
+
(inputPart, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7010
7243
|
"span",
|
|
7011
7244
|
{
|
|
7012
7245
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
7013
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
7246
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_katex11.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
7014
7247
|
},
|
|
7015
7248
|
`${key}_part_${partIndex}`
|
|
7016
7249
|
)
|
|
@@ -7022,7 +7255,7 @@ var ActivitySolutionContent_default = ActivitySolutionContent;
|
|
|
7022
7255
|
|
|
7023
7256
|
// src/components/activities/evaluation-rubric-contents/ActivityEvaluationRubricContent.tsx
|
|
7024
7257
|
var import_react_katex12 = require("react-katex");
|
|
7025
|
-
var
|
|
7258
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7026
7259
|
var ActivityEvaluationRubricContent = ({
|
|
7027
7260
|
activityTemplateType,
|
|
7028
7261
|
data
|
|
@@ -7052,21 +7285,21 @@ var ActivityEvaluationRubricContent = ({
|
|
|
7052
7285
|
}
|
|
7053
7286
|
if (!evaluationRubricMap || Object.keys(evaluationRubricMap).length === 0)
|
|
7054
7287
|
return null;
|
|
7055
|
-
return /* @__PURE__ */ (0,
|
|
7056
|
-
/* @__PURE__ */ (0,
|
|
7288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "p-4 border-catchup-gray-400 border-2 rounded-catchup-xlarge", children: [
|
|
7289
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-xl font-bold text-center mb-3", children: i18n_default.t("evaluation_rubric") }),
|
|
7057
7290
|
Object.keys(evaluationRubricMap).map((key, index) => {
|
|
7058
7291
|
const currentItem = JSON.parse(evaluationRubricMap[key]);
|
|
7059
7292
|
const { value } = currentItem;
|
|
7060
|
-
return /* @__PURE__ */ (0,
|
|
7293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7061
7294
|
"p",
|
|
7062
7295
|
{
|
|
7063
7296
|
className: "my-1 text-xl whitespace-pre-wrap",
|
|
7064
7297
|
children: constructInputWithSpecialExpressionList(value).map(
|
|
7065
|
-
(inputPart, index2) => /* @__PURE__ */ (0,
|
|
7298
|
+
(inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7066
7299
|
"span",
|
|
7067
7300
|
{
|
|
7068
7301
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
7069
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
7302
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_katex12.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
7070
7303
|
},
|
|
7071
7304
|
index2
|
|
7072
7305
|
)
|
|
@@ -7080,31 +7313,31 @@ var ActivityEvaluationRubricContent = ({
|
|
|
7080
7313
|
var ActivityEvaluationRubricContent_default = ActivityEvaluationRubricContent;
|
|
7081
7314
|
|
|
7082
7315
|
// src/components/activities/ActivityPreviewByData.tsx
|
|
7083
|
-
var
|
|
7316
|
+
var import_react25 = require("react");
|
|
7084
7317
|
|
|
7085
7318
|
// src/components/boxes/SelectionBox.tsx
|
|
7086
|
-
var
|
|
7319
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
7087
7320
|
var SelectionBox = ({
|
|
7088
7321
|
optionList,
|
|
7089
7322
|
selectedId,
|
|
7090
7323
|
handleSelectOnClick
|
|
7091
7324
|
}) => {
|
|
7092
|
-
return /* @__PURE__ */ (0,
|
|
7325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "flex flex-row items-center gap-x-4 gap-y-2 flex-wrap text-center", children: optionList.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7093
7326
|
"div",
|
|
7094
7327
|
{
|
|
7095
7328
|
className: `${option.id === selectedId ? "border-catchup-blue-400" : "border-catchup-gray-100 hover:border-catchup-blue-500"} border-2 rounded-catchup-xlarge py-3 px-8 cursor-pointer duration-300 transition-all`,
|
|
7096
7329
|
onClick: () => {
|
|
7097
7330
|
handleSelectOnClick(option.id);
|
|
7098
7331
|
},
|
|
7099
|
-
children: /* @__PURE__ */ (0,
|
|
7332
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
7100
7333
|
"div",
|
|
7101
7334
|
{
|
|
7102
7335
|
className: `flex flex-row items-center gap-x-1 ${option.id === selectedId ? "opacity-100" : "opacity-50"}`,
|
|
7103
7336
|
children: [
|
|
7104
7337
|
option.icon,
|
|
7105
|
-
/* @__PURE__ */ (0,
|
|
7106
|
-
/* @__PURE__ */ (0,
|
|
7107
|
-
option.subText ? /* @__PURE__ */ (0,
|
|
7338
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex-1 flex flex-col items-center", children: [
|
|
7339
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: option.text }),
|
|
7340
|
+
option.subText ? /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("p", { className: "text-md", children: [
|
|
7108
7341
|
"(",
|
|
7109
7342
|
option.subText,
|
|
7110
7343
|
")"
|
|
@@ -7120,7 +7353,7 @@ var SelectionBox = ({
|
|
|
7120
7353
|
var SelectionBox_default = SelectionBox;
|
|
7121
7354
|
|
|
7122
7355
|
// src/components/activities/ActivityPreviewByData.tsx
|
|
7123
|
-
var
|
|
7356
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7124
7357
|
var ActivityPreviewByData = ({
|
|
7125
7358
|
data,
|
|
7126
7359
|
showType,
|
|
@@ -7132,14 +7365,14 @@ var ActivityPreviewByData = ({
|
|
|
7132
7365
|
showDifficulty,
|
|
7133
7366
|
isFullScreen
|
|
7134
7367
|
}) => {
|
|
7135
|
-
const [key, setKey] = (0,
|
|
7136
|
-
const [selectedType, setSelectedType] = (0,
|
|
7137
|
-
const [optionList, setOptionList] = (0,
|
|
7138
|
-
(0,
|
|
7368
|
+
const [key, setKey] = (0, import_react25.useState)((/* @__PURE__ */ new Date()).getTime());
|
|
7369
|
+
const [selectedType, setSelectedType] = (0, import_react25.useState)(null);
|
|
7370
|
+
const [optionList, setOptionList] = (0, import_react25.useState)([]);
|
|
7371
|
+
(0, import_react25.useEffect)(() => {
|
|
7139
7372
|
if (!data) return;
|
|
7140
7373
|
setKey((/* @__PURE__ */ new Date()).getTime());
|
|
7141
7374
|
}, [data]);
|
|
7142
|
-
(0,
|
|
7375
|
+
(0, import_react25.useEffect)(() => {
|
|
7143
7376
|
if (!typeOptionList) return;
|
|
7144
7377
|
if (typeOptionList.length === 0) return;
|
|
7145
7378
|
let foundTypeOption;
|
|
@@ -7154,7 +7387,7 @@ var ActivityPreviewByData = ({
|
|
|
7154
7387
|
setSelectedType(typeOptionList[0].id);
|
|
7155
7388
|
}
|
|
7156
7389
|
}, [typeOptionList, lockedType]);
|
|
7157
|
-
(0,
|
|
7390
|
+
(0, import_react25.useEffect)(() => {
|
|
7158
7391
|
if (!data) return;
|
|
7159
7392
|
if (!typeOptionList) return;
|
|
7160
7393
|
if (typeOptionList.length === 0) return;
|
|
@@ -7178,11 +7411,11 @@ var ActivityPreviewByData = ({
|
|
|
7178
7411
|
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
7179
7412
|
if (!data) return;
|
|
7180
7413
|
const answer = constructAnswerBasedOnData(data);
|
|
7181
|
-
return /* @__PURE__ */ (0,
|
|
7182
|
-
showType ? /* @__PURE__ */ (0,
|
|
7183
|
-
/* @__PURE__ */ (0,
|
|
7184
|
-
showDescription ? /* @__PURE__ */ (0,
|
|
7185
|
-
/* @__PURE__ */ (0,
|
|
7414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
|
|
7415
|
+
showType ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
7416
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mb-4", children: [
|
|
7417
|
+
showDescription ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "my-2", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("p", { className: "font-semibold text-lg", children: i18n_default.t("activity_template") }) }) : null,
|
|
7418
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7186
7419
|
SelectionBox_default,
|
|
7187
7420
|
{
|
|
7188
7421
|
optionList,
|
|
@@ -7193,9 +7426,9 @@ var ActivityPreviewByData = ({
|
|
|
7193
7426
|
}
|
|
7194
7427
|
)
|
|
7195
7428
|
] }),
|
|
7196
|
-
/* @__PURE__ */ (0,
|
|
7429
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DividerLine_default, {})
|
|
7197
7430
|
] }) : null,
|
|
7198
|
-
selectedType ? /* @__PURE__ */ (0,
|
|
7431
|
+
selectedType ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "", children: selectedType === "ORDERING" && data["orderingBodyMap"] != null && data["orderingMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7199
7432
|
OrderingActivityContent_default,
|
|
7200
7433
|
{
|
|
7201
7434
|
answer,
|
|
@@ -7209,7 +7442,7 @@ var ActivityPreviewByData = ({
|
|
|
7209
7442
|
showCorrectAnswer: true,
|
|
7210
7443
|
isFullScreen
|
|
7211
7444
|
}
|
|
7212
|
-
) : selectedType === "DROPDOWN" && data["dropdownBodyMap"] != null && data["dropdownMaterialMap"] != null ? /* @__PURE__ */ (0,
|
|
7445
|
+
) : selectedType === "DROPDOWN" && data["dropdownBodyMap"] != null && data["dropdownMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7213
7446
|
DropdownActivityContent_default,
|
|
7214
7447
|
{
|
|
7215
7448
|
answer,
|
|
@@ -7223,7 +7456,7 @@ var ActivityPreviewByData = ({
|
|
|
7223
7456
|
showCorrectAnswer: true,
|
|
7224
7457
|
isFullScreen
|
|
7225
7458
|
}
|
|
7226
|
-
) : selectedType === "MCSA" && data["MCSABodyMap"] != null && data["MCSAMaterialMap"] != null ? /* @__PURE__ */ (0,
|
|
7459
|
+
) : selectedType === "MCSA" && data["MCSABodyMap"] != null && data["MCSAMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7227
7460
|
MCSAActivityContent_default,
|
|
7228
7461
|
{
|
|
7229
7462
|
answer,
|
|
@@ -7237,7 +7470,7 @@ var ActivityPreviewByData = ({
|
|
|
7237
7470
|
showCorrectAnswer: true,
|
|
7238
7471
|
isFullScreen
|
|
7239
7472
|
}
|
|
7240
|
-
) : selectedType === "MCMA" && data["MCMABodyMap"] != null && data["MCMAMaterialMap"] != null ? /* @__PURE__ */ (0,
|
|
7473
|
+
) : selectedType === "MCMA" && data["MCMABodyMap"] != null && data["MCMAMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7241
7474
|
MCMAActivityContent_default,
|
|
7242
7475
|
{
|
|
7243
7476
|
answer,
|
|
@@ -7251,7 +7484,7 @@ var ActivityPreviewByData = ({
|
|
|
7251
7484
|
showCorrectAnswer: true,
|
|
7252
7485
|
isFullScreen
|
|
7253
7486
|
}
|
|
7254
|
-
) : selectedType === "MATCHING" && data["matchingBodyMap"] != null && data["matchingMaterialMap"] != null ? /* @__PURE__ */ (0,
|
|
7487
|
+
) : selectedType === "MATCHING" && data["matchingBodyMap"] != null && data["matchingMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7255
7488
|
MatchingActivityContent_default,
|
|
7256
7489
|
{
|
|
7257
7490
|
answer,
|
|
@@ -7264,7 +7497,7 @@ var ActivityPreviewByData = ({
|
|
|
7264
7497
|
isPreview: true,
|
|
7265
7498
|
showCorrectAnswer: true
|
|
7266
7499
|
}
|
|
7267
|
-
) : selectedType === "GROUPING" && data["groupingBodyMap"] != null && data["groupingMaterialMap"] != null ? /* @__PURE__ */ (0,
|
|
7500
|
+
) : selectedType === "GROUPING" && data["groupingBodyMap"] != null && data["groupingMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7268
7501
|
GroupingActivityContent_default,
|
|
7269
7502
|
{
|
|
7270
7503
|
answer,
|
|
@@ -7277,7 +7510,7 @@ var ActivityPreviewByData = ({
|
|
|
7277
7510
|
isPreview: true,
|
|
7278
7511
|
showCorrectAnswer: true
|
|
7279
7512
|
}
|
|
7280
|
-
) : selectedType === "FILL_IN_THE_BLANKS" && data["fillInTheBlanksBodyMap"] != null && data["fillInTheBlanksMaterialMap"] != null ? /* @__PURE__ */ (0,
|
|
7513
|
+
) : selectedType === "FILL_IN_THE_BLANKS" && data["fillInTheBlanksBodyMap"] != null && data["fillInTheBlanksMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7281
7514
|
FillInTheBlanksActivityContent_default,
|
|
7282
7515
|
{
|
|
7283
7516
|
answer,
|
|
@@ -7291,7 +7524,7 @@ var ActivityPreviewByData = ({
|
|
|
7291
7524
|
showCorrectAnswer: true,
|
|
7292
7525
|
isFullScreen
|
|
7293
7526
|
}
|
|
7294
|
-
) : selectedType === "OPEN_ENDED" && data["openEndedBodyMap"] != null ? /* @__PURE__ */ (0,
|
|
7527
|
+
) : selectedType === "OPEN_ENDED" && data["openEndedBodyMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7295
7528
|
OpenEndedActivityContent_default,
|
|
7296
7529
|
{
|
|
7297
7530
|
answer,
|
|
@@ -7303,7 +7536,7 @@ var ActivityPreviewByData = ({
|
|
|
7303
7536
|
isPreview: true,
|
|
7304
7537
|
isFullScreen
|
|
7305
7538
|
}
|
|
7306
|
-
) : selectedType === "TRUE_FALSE" && data["trueFalseBodyMap"] != null && data["trueFalseMaterialMap"] != null ? /* @__PURE__ */ (0,
|
|
7539
|
+
) : selectedType === "TRUE_FALSE" && data["trueFalseBodyMap"] != null && data["trueFalseMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7307
7540
|
TrueFalseActivityContent_default,
|
|
7308
7541
|
{
|
|
7309
7542
|
answer,
|
|
@@ -7318,14 +7551,14 @@ var ActivityPreviewByData = ({
|
|
|
7318
7551
|
isFullScreen
|
|
7319
7552
|
}
|
|
7320
7553
|
) : null }, selectedType) : null,
|
|
7321
|
-
selectedType && showSolution ? /* @__PURE__ */ (0,
|
|
7554
|
+
selectedType && showSolution ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "my-4", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7322
7555
|
ActivitySolutionContent_default,
|
|
7323
7556
|
{
|
|
7324
7557
|
activityTemplateType: selectedType,
|
|
7325
7558
|
data
|
|
7326
7559
|
}
|
|
7327
7560
|
) }) : null,
|
|
7328
|
-
selectedType && showEvaluationRubric ? /* @__PURE__ */ (0,
|
|
7561
|
+
selectedType && showEvaluationRubric ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "my-4", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7329
7562
|
ActivityEvaluationRubricContent_default,
|
|
7330
7563
|
{
|
|
7331
7564
|
activityTemplateType: selectedType,
|
|
@@ -7337,8 +7570,8 @@ var ActivityPreviewByData = ({
|
|
|
7337
7570
|
var ActivityPreviewByData_default = ActivityPreviewByData;
|
|
7338
7571
|
|
|
7339
7572
|
// src/components/activities/ActivityPreviewByAnswerData.tsx
|
|
7340
|
-
var
|
|
7341
|
-
var
|
|
7573
|
+
var import_react26 = require("react");
|
|
7574
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
7342
7575
|
var ActivityPreviewByAnswerData = ({
|
|
7343
7576
|
data,
|
|
7344
7577
|
showType = true,
|
|
@@ -7352,11 +7585,11 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7352
7585
|
showCorrectAnswer = false
|
|
7353
7586
|
}) => {
|
|
7354
7587
|
var _a;
|
|
7355
|
-
const [key, setKey] = (0,
|
|
7356
|
-
const [selectedType, setSelectedType] = (0,
|
|
7357
|
-
const [optionList, setOptionList] = (0,
|
|
7358
|
-
const [answer, setAnswer] = (0,
|
|
7359
|
-
(0,
|
|
7588
|
+
const [key, setKey] = (0, import_react26.useState)((/* @__PURE__ */ new Date()).getTime());
|
|
7589
|
+
const [selectedType, setSelectedType] = (0, import_react26.useState)(null);
|
|
7590
|
+
const [optionList, setOptionList] = (0, import_react26.useState)([]);
|
|
7591
|
+
const [answer, setAnswer] = (0, import_react26.useState)({ data: [] });
|
|
7592
|
+
(0, import_react26.useEffect)(() => {
|
|
7360
7593
|
if (!data) return;
|
|
7361
7594
|
setKey((/* @__PURE__ */ new Date()).getTime());
|
|
7362
7595
|
}, [data]);
|
|
@@ -7369,7 +7602,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7369
7602
|
}
|
|
7370
7603
|
return null;
|
|
7371
7604
|
};
|
|
7372
|
-
(0,
|
|
7605
|
+
(0, import_react26.useEffect)(() => {
|
|
7373
7606
|
if (!data) return;
|
|
7374
7607
|
const constructAnswerBasedOnData2 = () => {
|
|
7375
7608
|
const newAnswer = { data: [] };
|
|
@@ -7408,7 +7641,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7408
7641
|
};
|
|
7409
7642
|
constructAnswerBasedOnData2();
|
|
7410
7643
|
}, [data, lockedType]);
|
|
7411
|
-
(0,
|
|
7644
|
+
(0, import_react26.useEffect)(() => {
|
|
7412
7645
|
if (!data || !answer.data.length) return;
|
|
7413
7646
|
let currentTypeOptionList = typeOptionList || answer.data.map((item) => ({
|
|
7414
7647
|
id: item.type,
|
|
@@ -7446,38 +7679,38 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7446
7679
|
};
|
|
7447
7680
|
switch (selectedType) {
|
|
7448
7681
|
case "ORDERING":
|
|
7449
|
-
return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ (0,
|
|
7682
|
+
return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(OrderingActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
7450
7683
|
case "DROPDOWN":
|
|
7451
|
-
return data.dropdownBodyMap && data.dropdownMaterialMap ? /* @__PURE__ */ (0,
|
|
7684
|
+
return data.dropdownBodyMap && data.dropdownMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DropdownActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
7452
7685
|
case "MCSA":
|
|
7453
|
-
return data.MCSABodyMap && data.MCSAMaterialMap ? /* @__PURE__ */ (0,
|
|
7686
|
+
return data.MCSABodyMap && data.MCSAMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MCSAActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
7454
7687
|
case "MCMA":
|
|
7455
|
-
return data.MCMABodyMap && data.MCMAMaterialMap ? /* @__PURE__ */ (0,
|
|
7688
|
+
return data.MCMABodyMap && data.MCMAMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MCMAActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
7456
7689
|
case "MATCHING":
|
|
7457
|
-
return data.matchingBodyMap && data.matchingMaterialMap ? /* @__PURE__ */ (0,
|
|
7690
|
+
return data.matchingBodyMap && data.matchingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MatchingActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
7458
7691
|
case "GROUPING":
|
|
7459
|
-
return data.groupingBodyMap && data.groupingMaterialMap ? /* @__PURE__ */ (0,
|
|
7692
|
+
return data.groupingBodyMap && data.groupingMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(GroupingActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
7460
7693
|
case "FILL_IN_THE_BLANKS":
|
|
7461
|
-
return data.fillInTheBlanksBodyMap && data.fillInTheBlanksMaterialMap ? /* @__PURE__ */ (0,
|
|
7694
|
+
return data.fillInTheBlanksBodyMap && data.fillInTheBlanksMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(FillInTheBlanksActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
7462
7695
|
case "OPEN_ENDED":
|
|
7463
|
-
return data.openEndedBodyMap ? /* @__PURE__ */ (0,
|
|
7696
|
+
return data.openEndedBodyMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7464
7697
|
OpenEndedActivityContent_default,
|
|
7465
7698
|
__spreadProps(__spreadValues({}, commonProps), {
|
|
7466
7699
|
showMaterialContent: true
|
|
7467
7700
|
})
|
|
7468
7701
|
) : null;
|
|
7469
7702
|
case "TRUE_FALSE":
|
|
7470
|
-
return data.trueFalseBodyMap && data.trueFalseMaterialMap ? /* @__PURE__ */ (0,
|
|
7703
|
+
return data.trueFalseBodyMap && data.trueFalseMaterialMap ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TrueFalseActivityContent_default, __spreadValues({}, commonProps)) : null;
|
|
7471
7704
|
default:
|
|
7472
7705
|
return null;
|
|
7473
7706
|
}
|
|
7474
7707
|
};
|
|
7475
7708
|
if (!data) return null;
|
|
7476
|
-
return /* @__PURE__ */ (0,
|
|
7477
|
-
showType && optionList.length > 0 ? /* @__PURE__ */ (0,
|
|
7478
|
-
/* @__PURE__ */ (0,
|
|
7479
|
-
showDescription ? /* @__PURE__ */ (0,
|
|
7480
|
-
/* @__PURE__ */ (0,
|
|
7709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
7710
|
+
showType && optionList.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
7711
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "mb-4", children: [
|
|
7712
|
+
showDescription ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "my-2", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "font-semibold text-lg", children: i18n_default.t("activity_template") }) }) : null,
|
|
7713
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7481
7714
|
SelectionBox_default,
|
|
7482
7715
|
{
|
|
7483
7716
|
optionList,
|
|
@@ -7488,20 +7721,20 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7488
7721
|
}
|
|
7489
7722
|
)
|
|
7490
7723
|
] }),
|
|
7491
|
-
/* @__PURE__ */ (0,
|
|
7724
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DividerLine_default, {})
|
|
7492
7725
|
] }) : null,
|
|
7493
|
-
/* @__PURE__ */ (0,
|
|
7494
|
-
((_a = answer == null ? void 0 : answer.data[0]) == null ? void 0 : _a.isEmpty) ? /* @__PURE__ */ (0,
|
|
7495
|
-
selectedType ? /* @__PURE__ */ (0,
|
|
7726
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-col my-2 w-full p-5", children: [
|
|
7727
|
+
((_a = answer == null ? void 0 : answer.data[0]) == null ? void 0 : _a.isEmpty) ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActivityEmptyContent_default, {}) : null,
|
|
7728
|
+
selectedType ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { children: RenderSelectedActivityContent() }, selectedType) : null
|
|
7496
7729
|
] }),
|
|
7497
|
-
selectedType && showSolution ? /* @__PURE__ */ (0,
|
|
7730
|
+
selectedType && showSolution ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "my-4", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7498
7731
|
ActivitySolutionContent_default,
|
|
7499
7732
|
{
|
|
7500
7733
|
activityTemplateType: selectedType,
|
|
7501
7734
|
data
|
|
7502
7735
|
}
|
|
7503
7736
|
) }) : null,
|
|
7504
|
-
selectedType && showEvaluationRubric ? /* @__PURE__ */ (0,
|
|
7737
|
+
selectedType && showEvaluationRubric ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "my-4", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7505
7738
|
ActivityEvaluationRubricContent_default,
|
|
7506
7739
|
{
|
|
7507
7740
|
activityTemplateType: selectedType,
|
|
@@ -7513,17 +7746,17 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7513
7746
|
var ActivityPreviewByAnswerData_default = ActivityPreviewByAnswerData;
|
|
7514
7747
|
|
|
7515
7748
|
// src/components/errors/StatusError.tsx
|
|
7516
|
-
var
|
|
7749
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
7517
7750
|
var StatusError = ({
|
|
7518
7751
|
statusCode,
|
|
7519
7752
|
statusText,
|
|
7520
7753
|
textSize
|
|
7521
7754
|
}) => {
|
|
7522
|
-
return /* @__PURE__ */ (0,
|
|
7523
|
-
/* @__PURE__ */ (0,
|
|
7524
|
-
/* @__PURE__ */ (0,
|
|
7525
|
-
/* @__PURE__ */ (0,
|
|
7526
|
-
/* @__PURE__ */ (0,
|
|
7755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "flex flex-col justify-center items-center", children: [
|
|
7756
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "text-6xl text-catchup-red my-5", children: i18n_default.t("ooops_text") }),
|
|
7757
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "text-center my-5", children: [
|
|
7758
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("p", { className: "italic", children: i18n_default.t("unexcepted_error_text") }),
|
|
7759
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("p", { className: `${textSize ? textSize : "text-lg"}`, children: [
|
|
7527
7760
|
"(",
|
|
7528
7761
|
statusCode ? `${statusCode} - ` : null,
|
|
7529
7762
|
statusText,
|
|
@@ -7535,9 +7768,9 @@ var StatusError = ({
|
|
|
7535
7768
|
var StatusError_default = StatusError;
|
|
7536
7769
|
|
|
7537
7770
|
// src/components/dividers/BlueVerticalDividerLine.tsx
|
|
7538
|
-
var
|
|
7771
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
7539
7772
|
var BlueVerticalDividerLine = ({ opacity }) => {
|
|
7540
|
-
return /* @__PURE__ */ (0,
|
|
7773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7541
7774
|
"div",
|
|
7542
7775
|
{
|
|
7543
7776
|
className: `w-[2px] h-[40px] my-4 bg-catchup-blue ${opacity === "medium" ? "opacity-50" : ""}`
|
|
@@ -7547,7 +7780,7 @@ var BlueVerticalDividerLine = ({ opacity }) => {
|
|
|
7547
7780
|
var BlueVerticalDividerLine_default = BlueVerticalDividerLine;
|
|
7548
7781
|
|
|
7549
7782
|
// src/components/groups/LeftTextRightInputGroup.tsx
|
|
7550
|
-
var
|
|
7783
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
7551
7784
|
var LeftTextRightInputGroup = ({
|
|
7552
7785
|
type,
|
|
7553
7786
|
title,
|
|
@@ -7557,9 +7790,9 @@ var LeftTextRightInputGroup = ({
|
|
|
7557
7790
|
disabled,
|
|
7558
7791
|
errorText
|
|
7559
7792
|
}) => {
|
|
7560
|
-
return /* @__PURE__ */ (0,
|
|
7561
|
-
/* @__PURE__ */ (0,
|
|
7562
|
-
/* @__PURE__ */ (0,
|
|
7793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { className: "w-full flex flex-row mx-2", children: [
|
|
7794
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "w-catchup-input-group-title py-5", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { children: title }) }),
|
|
7795
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7563
7796
|
InputGroup_default,
|
|
7564
7797
|
{
|
|
7565
7798
|
type,
|
|
@@ -7575,8 +7808,8 @@ var LeftTextRightInputGroup = ({
|
|
|
7575
7808
|
var LeftTextRightInputGroup_default = LeftTextRightInputGroup;
|
|
7576
7809
|
|
|
7577
7810
|
// src/components/groups/PageTravelGroup.tsx
|
|
7578
|
-
var
|
|
7579
|
-
var
|
|
7811
|
+
var import_react27 = require("react");
|
|
7812
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
7580
7813
|
var PageTravelGroup = ({
|
|
7581
7814
|
isImageProcessing,
|
|
7582
7815
|
handleImageProcessing,
|
|
@@ -7585,17 +7818,17 @@ var PageTravelGroup = ({
|
|
|
7585
7818
|
setPageNumber,
|
|
7586
7819
|
setImageReady
|
|
7587
7820
|
}) => {
|
|
7588
|
-
const [totalPageNumber, setTotalPageNumber] = (0,
|
|
7589
|
-
const [newPageNumber, setNewPageNumber] = (0,
|
|
7590
|
-
(0,
|
|
7821
|
+
const [totalPageNumber, setTotalPageNumber] = (0, import_react27.useState)(0);
|
|
7822
|
+
const [newPageNumber, setNewPageNumber] = (0, import_react27.useState)(0);
|
|
7823
|
+
(0, import_react27.useEffect)(() => {
|
|
7591
7824
|
if (!initialTotalPageNumber) return;
|
|
7592
7825
|
setTotalPageNumber(initialTotalPageNumber);
|
|
7593
7826
|
}, [initialTotalPageNumber]);
|
|
7594
|
-
(0,
|
|
7827
|
+
(0, import_react27.useEffect)(() => {
|
|
7595
7828
|
setNewPageNumber(pageNumber + 1);
|
|
7596
7829
|
}, [pageNumber]);
|
|
7597
|
-
return /* @__PURE__ */ (0,
|
|
7598
|
-
pageNumber === 0 ? null : /* @__PURE__ */ (0,
|
|
7830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "flex-1 flex flex-row justify-center items-center flex-wrap", children: [
|
|
7831
|
+
pageNumber === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "px-2 flex flex-col items-center", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7599
7832
|
BaseImage_default,
|
|
7600
7833
|
{
|
|
7601
7834
|
size: "small",
|
|
@@ -7613,7 +7846,7 @@ var PageTravelGroup = ({
|
|
|
7613
7846
|
}
|
|
7614
7847
|
}
|
|
7615
7848
|
) }),
|
|
7616
|
-
Array.from(Array(totalPageNumber).keys()).filter((index) => index < pageNumber + 5).filter((index) => index > pageNumber - 5).map((index) => /* @__PURE__ */ (0,
|
|
7849
|
+
Array.from(Array(totalPageNumber).keys()).filter((index) => index < pageNumber + 5).filter((index) => index > pageNumber - 5).map((index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "px-2", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7617
7850
|
"p",
|
|
7618
7851
|
{
|
|
7619
7852
|
className: `${pageNumber === index ? "text-2xl" : "text-md"} cursor-pointer`,
|
|
@@ -7628,7 +7861,7 @@ var PageTravelGroup = ({
|
|
|
7628
7861
|
children: index + 1
|
|
7629
7862
|
}
|
|
7630
7863
|
) }, index)),
|
|
7631
|
-
totalPageNumber === 0 || pageNumber === totalPageNumber - 1 ? null : /* @__PURE__ */ (0,
|
|
7864
|
+
totalPageNumber === 0 || pageNumber === totalPageNumber - 1 ? null : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "px-2 flex flex-col items-center", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7632
7865
|
BaseImage_default,
|
|
7633
7866
|
{
|
|
7634
7867
|
size: "small",
|
|
@@ -7646,7 +7879,7 @@ var PageTravelGroup = ({
|
|
|
7646
7879
|
}
|
|
7647
7880
|
}
|
|
7648
7881
|
) }),
|
|
7649
|
-
/* @__PURE__ */ (0,
|
|
7882
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7650
7883
|
"input",
|
|
7651
7884
|
{
|
|
7652
7885
|
className: `w-[90px] py-2 px-4 border border-catchup-gray-100 rounded-catchup-xlarge focus:outline-none placeholder-catchup-gray-200 focus:border-catchup-blue-400 focus:shadow-input`,
|
|
@@ -7670,14 +7903,14 @@ var PageTravelGroup = ({
|
|
|
7670
7903
|
var PageTravelGroup_default = PageTravelGroup;
|
|
7671
7904
|
|
|
7672
7905
|
// src/components/boxes/SelectionCheckbox.tsx
|
|
7673
|
-
var
|
|
7906
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
7674
7907
|
var SelectionCheckbox = ({
|
|
7675
7908
|
optionList,
|
|
7676
7909
|
selectedIdList,
|
|
7677
7910
|
handleSelectOnClick,
|
|
7678
7911
|
handleRemoveOnClick
|
|
7679
7912
|
}) => {
|
|
7680
|
-
return /* @__PURE__ */ (0,
|
|
7913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex flex-row items-center gap-x-4 gap-y-2 flex-wrap text-center", children: optionList.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7681
7914
|
"div",
|
|
7682
7915
|
{
|
|
7683
7916
|
className: `${selectedIdList.findIndex(
|
|
@@ -7692,14 +7925,14 @@ var SelectionCheckbox = ({
|
|
|
7692
7925
|
handleRemoveOnClick(option.id);
|
|
7693
7926
|
}
|
|
7694
7927
|
},
|
|
7695
|
-
children: /* @__PURE__ */ (0,
|
|
7928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
7696
7929
|
"div",
|
|
7697
7930
|
{
|
|
7698
7931
|
className: `flex flex-row items-center gap-x-1 ${selectedIdList.findIndex(
|
|
7699
7932
|
(selectedId) => selectedId === option.id
|
|
7700
7933
|
) > -1 ? "opacity-100" : "opacity-50"}`,
|
|
7701
7934
|
children: [
|
|
7702
|
-
/* @__PURE__ */ (0,
|
|
7935
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
7703
7936
|
BaseImage_default,
|
|
7704
7937
|
{
|
|
7705
7938
|
src: selectedIdList.findIndex(
|
|
@@ -7709,7 +7942,7 @@ var SelectionCheckbox = ({
|
|
|
7709
7942
|
size: "small"
|
|
7710
7943
|
}
|
|
7711
7944
|
),
|
|
7712
|
-
/* @__PURE__ */ (0,
|
|
7945
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: option.text }) })
|
|
7713
7946
|
]
|
|
7714
7947
|
}
|
|
7715
7948
|
)
|
|
@@ -7720,7 +7953,7 @@ var SelectionCheckbox = ({
|
|
|
7720
7953
|
var SelectionCheckbox_default = SelectionCheckbox;
|
|
7721
7954
|
|
|
7722
7955
|
// src/components/tabs/SelectionTab.tsx
|
|
7723
|
-
var
|
|
7956
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
7724
7957
|
var SelectionTab = ({
|
|
7725
7958
|
optionList,
|
|
7726
7959
|
selectedId,
|
|
@@ -7730,7 +7963,7 @@ var SelectionTab = ({
|
|
|
7730
7963
|
textColor,
|
|
7731
7964
|
borderColor
|
|
7732
7965
|
}) => {
|
|
7733
|
-
return /* @__PURE__ */ (0,
|
|
7966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "flex flex-row items-center gap-x-4 gap-y-2 flex-wrap mb-2 text-center", children: optionList.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
7734
7967
|
"div",
|
|
7735
7968
|
{
|
|
7736
7969
|
className: `${selectedId === option.id ? selectedTextColor ? selectedTextColor : "text-catchup-blue-500" : textColor ? textColor : "text-catchup-gray-300"} ${selectedId === option.id ? selectedBorderColor ? selectedBorderColor : "border-catchup-blue-500" : borderColor ? borderColor : "border-catchup-gray-50"} border-b-2 transition-all duration-300 p-3 cursor-pointer`,
|
|
@@ -7738,8 +7971,8 @@ var SelectionTab = ({
|
|
|
7738
7971
|
handleSelectOnClick(option.id);
|
|
7739
7972
|
},
|
|
7740
7973
|
children: [
|
|
7741
|
-
/* @__PURE__ */ (0,
|
|
7742
|
-
option.subTitle ? /* @__PURE__ */ (0,
|
|
7974
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-lg", children: option.title }),
|
|
7975
|
+
option.subTitle ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "text-md", children: option.subTitle }) : null
|
|
7743
7976
|
]
|
|
7744
7977
|
},
|
|
7745
7978
|
index
|
|
@@ -7748,20 +7981,20 @@ var SelectionTab = ({
|
|
|
7748
7981
|
var SelectionTab_default = SelectionTab;
|
|
7749
7982
|
|
|
7750
7983
|
// src/components/tabs/SelectionTabFill.tsx
|
|
7751
|
-
var
|
|
7984
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7752
7985
|
var SelectionTabFill = ({
|
|
7753
7986
|
optionList,
|
|
7754
7987
|
selectedId,
|
|
7755
7988
|
handleSelectOnClick
|
|
7756
7989
|
}) => {
|
|
7757
|
-
return /* @__PURE__ */ (0,
|
|
7990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "w-full flex flex-row bg-catchup-gray-50 gap-x-2 rounded-catchup-medium px-4 py-2 justify-center text-center", children: optionList.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7758
7991
|
"div",
|
|
7759
7992
|
{
|
|
7760
7993
|
className: "cursor-pointer",
|
|
7761
7994
|
onClick: () => {
|
|
7762
7995
|
handleSelectOnClick(option.id);
|
|
7763
7996
|
},
|
|
7764
|
-
children: /* @__PURE__ */ (0,
|
|
7997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
7765
7998
|
"p",
|
|
7766
7999
|
{
|
|
7767
8000
|
className: `${selectedId === option.id ? "text-catchup-white bg-catchup-blue-500" : "text-catchup-gray-300"} transition-all duration-300 rounded-catchup-medium px-2 py-1`,
|
|
@@ -7775,34 +8008,34 @@ var SelectionTabFill = ({
|
|
|
7775
8008
|
var SelectionTabFill_default = SelectionTabFill;
|
|
7776
8009
|
|
|
7777
8010
|
// src/components/labels/ActivityTemplateLabel.tsx
|
|
7778
|
-
var
|
|
8011
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
7779
8012
|
var ActivityTemplateLabel = ({
|
|
7780
8013
|
title,
|
|
7781
8014
|
icon,
|
|
7782
8015
|
font
|
|
7783
8016
|
}) => {
|
|
7784
|
-
return /* @__PURE__ */ (0,
|
|
7785
|
-
icon ? icon : /* @__PURE__ */ (0,
|
|
7786
|
-
/* @__PURE__ */ (0,
|
|
8017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-grade-label-border bg-grade-label text-grade-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
8018
|
+
icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(BaseImage_default, { src: "/icons/activity.webp", alt: "label", size: "xsmall" }),
|
|
8019
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("p", { className: font ? font : "text-sm", children: title })
|
|
7787
8020
|
] }) });
|
|
7788
8021
|
};
|
|
7789
8022
|
var ActivityTemplateLabel_default = ActivityTemplateLabel;
|
|
7790
8023
|
|
|
7791
8024
|
// src/components/labels/BrandLabel.tsx
|
|
7792
|
-
var
|
|
8025
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
7793
8026
|
var BrandLabel = ({ title, icon, font }) => {
|
|
7794
|
-
return /* @__PURE__ */ (0,
|
|
7795
|
-
icon ? icon : /* @__PURE__ */ (0,
|
|
7796
|
-
/* @__PURE__ */ (0,
|
|
8027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-brand-label-border bg-brand-label text-brand-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
8028
|
+
icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(BaseImage_default, { src: "/icons/brand-label.webp", alt: "label", size: "xsmall" }),
|
|
8029
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: font ? font : "text-sm", children: title })
|
|
7797
8030
|
] }) });
|
|
7798
8031
|
};
|
|
7799
8032
|
var BrandLabel_default = BrandLabel;
|
|
7800
8033
|
|
|
7801
8034
|
// src/components/labels/CategoryLabel.tsx
|
|
7802
|
-
var
|
|
8035
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
7803
8036
|
var CategoryLabel = ({ title, icon, font }) => {
|
|
7804
|
-
return /* @__PURE__ */ (0,
|
|
7805
|
-
icon ? icon : /* @__PURE__ */ (0,
|
|
8037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-category-label-border bg-category-label text-category-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
8038
|
+
icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
7806
8039
|
BaseImage_default,
|
|
7807
8040
|
{
|
|
7808
8041
|
src: "/icons/category-label.webp",
|
|
@@ -7810,40 +8043,40 @@ var CategoryLabel = ({ title, icon, font }) => {
|
|
|
7810
8043
|
size: "xsmall"
|
|
7811
8044
|
}
|
|
7812
8045
|
),
|
|
7813
|
-
/* @__PURE__ */ (0,
|
|
8046
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: font ? font : "text-sm", children: title })
|
|
7814
8047
|
] }) });
|
|
7815
8048
|
};
|
|
7816
8049
|
var CategoryLabel_default = CategoryLabel;
|
|
7817
8050
|
|
|
7818
8051
|
// src/components/labels/CoterieLabel.tsx
|
|
7819
|
-
var
|
|
8052
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
7820
8053
|
var CoterieLabel = ({ title, font }) => {
|
|
7821
|
-
return /* @__PURE__ */ (0,
|
|
8054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-brand-label-border bg-brand-label text-brand-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("p", { className: font ? font : "text-sm", children: title }) });
|
|
7822
8055
|
};
|
|
7823
8056
|
var CoterieLabel_default = CoterieLabel;
|
|
7824
8057
|
|
|
7825
8058
|
// src/components/labels/GradeLabel.tsx
|
|
7826
|
-
var
|
|
8059
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
7827
8060
|
var GradeLabel = ({ title, font }) => {
|
|
7828
|
-
return /* @__PURE__ */ (0,
|
|
8061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-grade-label-border bg-grade-label text-grade-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { className: font ? font : "text-sm", children: title }) });
|
|
7829
8062
|
};
|
|
7830
8063
|
var GradeLabel_default = GradeLabel;
|
|
7831
8064
|
|
|
7832
8065
|
// src/components/labels/OutcomeLabel.tsx
|
|
7833
|
-
var
|
|
8066
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
7834
8067
|
var OutcomeLabel = ({ title, font }) => {
|
|
7835
|
-
return /* @__PURE__ */ (0,
|
|
7836
|
-
/* @__PURE__ */ (0,
|
|
7837
|
-
/* @__PURE__ */ (0,
|
|
8068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-brand-label-border bg-brand-label text-brand-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
8069
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(BaseImage_default, { src: "/icons/category.webp", alt: "label", size: "xsmall" }),
|
|
8070
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: font ? font : "text-sm", children: title })
|
|
7838
8071
|
] }) });
|
|
7839
8072
|
};
|
|
7840
8073
|
var OutcomeLabel_default = OutcomeLabel;
|
|
7841
8074
|
|
|
7842
8075
|
// src/components/labels/PersonalLabel.tsx
|
|
7843
|
-
var
|
|
8076
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
7844
8077
|
var PersonalLabel = ({ title, icon, font }) => {
|
|
7845
|
-
return /* @__PURE__ */ (0,
|
|
7846
|
-
icon ? icon : /* @__PURE__ */ (0,
|
|
8078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-personal-label-border bg-personal-label text-personal-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
8079
|
+
icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
7847
8080
|
BaseImage_default,
|
|
7848
8081
|
{
|
|
7849
8082
|
src: "/icons/personal-label.webp",
|
|
@@ -7851,16 +8084,16 @@ var PersonalLabel = ({ title, icon, font }) => {
|
|
|
7851
8084
|
size: "xsmall"
|
|
7852
8085
|
}
|
|
7853
8086
|
),
|
|
7854
|
-
/* @__PURE__ */ (0,
|
|
8087
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: font ? font : "text-sm", children: title })
|
|
7855
8088
|
] }) });
|
|
7856
8089
|
};
|
|
7857
8090
|
var PersonalLabel_default = PersonalLabel;
|
|
7858
8091
|
|
|
7859
8092
|
// src/components/labels/PublishingHouseLabel.tsx
|
|
7860
|
-
var
|
|
8093
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
7861
8094
|
var PublishingHouseLabel = ({ title, icon, font }) => {
|
|
7862
|
-
return /* @__PURE__ */ (0,
|
|
7863
|
-
icon ? icon : /* @__PURE__ */ (0,
|
|
8095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-publishing-house-label-border bg-publishing-house-label text-publishing-house-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
8096
|
+
icon ? icon : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
7864
8097
|
BaseImage_default,
|
|
7865
8098
|
{
|
|
7866
8099
|
src: "/icons/publishing-house-label.webp",
|
|
@@ -7868,55 +8101,55 @@ var PublishingHouseLabel = ({ title, icon, font }) => {
|
|
|
7868
8101
|
size: "xsmall"
|
|
7869
8102
|
}
|
|
7870
8103
|
),
|
|
7871
|
-
/* @__PURE__ */ (0,
|
|
8104
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: font ? font : "text-sm", children: title })
|
|
7872
8105
|
] }) });
|
|
7873
8106
|
};
|
|
7874
8107
|
var PublishingHouseLabel_default = PublishingHouseLabel;
|
|
7875
8108
|
|
|
7876
8109
|
// src/components/labels/ActivityLabel.tsx
|
|
7877
|
-
var
|
|
8110
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
7878
8111
|
var ActivityLabel = ({ title, font }) => {
|
|
7879
|
-
return /* @__PURE__ */ (0,
|
|
8112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "px-3 py-1 gap-x-3 border border-publishing-house-label-border bg-publishing-house-label text-publishing-house-label-text rounded-catchup-3xlarge text-center", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: font ? font : "text-sm", children: title }) });
|
|
7880
8113
|
};
|
|
7881
8114
|
var ActivityLabel_default = ActivityLabel;
|
|
7882
8115
|
|
|
7883
8116
|
// src/components/infos/InfoWithText.tsx
|
|
7884
|
-
var
|
|
8117
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
7885
8118
|
var InfoWithText = (props) => {
|
|
7886
8119
|
const { value } = props;
|
|
7887
|
-
return /* @__PURE__ */ (0,
|
|
7888
|
-
/* @__PURE__ */ (0,
|
|
7889
|
-
/* @__PURE__ */ (0,
|
|
8120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "w-full flex flex-row items-center gap-x-2 my-2", children: [
|
|
8121
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(BaseImage_default, { src: "/icons/info.webp", alt: "info", size: "small" }),
|
|
8122
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "", children: value }) })
|
|
7890
8123
|
] });
|
|
7891
8124
|
};
|
|
7892
8125
|
var InfoWithText_default = InfoWithText;
|
|
7893
8126
|
|
|
7894
8127
|
// src/components/titles/BaseTitle.tsx
|
|
7895
|
-
var
|
|
8128
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
7896
8129
|
var BaseTitle = ({
|
|
7897
8130
|
title,
|
|
7898
8131
|
totalItemCount,
|
|
7899
8132
|
itemName,
|
|
7900
8133
|
description
|
|
7901
8134
|
}) => {
|
|
7902
|
-
return /* @__PURE__ */ (0,
|
|
7903
|
-
/* @__PURE__ */ (0,
|
|
8135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex flex-col gap-y-2", children: [
|
|
8136
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("p", { className: "text-2xl font-medium", children: [
|
|
7904
8137
|
title,
|
|
7905
|
-
totalItemCount && itemName ? /* @__PURE__ */ (0,
|
|
8138
|
+
totalItemCount && itemName ? /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("span", { className: "p-2 text-base text-catchup-blue-600 border border-catchup-blue-300 rounded-catchup-3xlarge mx-2 bg-catchup-blue-100", children: [
|
|
7906
8139
|
totalItemCount,
|
|
7907
8140
|
" ",
|
|
7908
8141
|
itemName
|
|
7909
8142
|
] }) : null
|
|
7910
8143
|
] }),
|
|
7911
|
-
description ? /* @__PURE__ */ (0,
|
|
8144
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "", children: description }) : null
|
|
7912
8145
|
] });
|
|
7913
8146
|
};
|
|
7914
8147
|
var BaseTitle_default = BaseTitle;
|
|
7915
8148
|
|
|
7916
8149
|
// src/components/titles/SubTitle.tsx
|
|
7917
|
-
var
|
|
8150
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
7918
8151
|
var SubTitle = ({ title }) => {
|
|
7919
|
-
return /* @__PURE__ */ (0,
|
|
8152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "text-xl font-medium text-catchup-darker-blue", children: title });
|
|
7920
8153
|
};
|
|
7921
8154
|
var SubTitle_default = SubTitle;
|
|
7922
8155
|
|