catchup-library-web 1.20.36 → 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 +448 -243
- package/dist/index.mjs +448 -243
- package/package.json +2 -6
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +62 -2
- package/src/components/activities/material-contents/GroupingActivityMaterialContent.tsx +74 -2
- package/src/components/activities/material-contents/MatchingActivityMaterialContent.tsx +74 -2
- 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/GroupingActivityMaterialContent2.tsx +0 -362
- package/src/components/activities/material-contents/MatchingActivityMaterialContent2.tsx +0 -350
- 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
|
|
|
@@ -5297,6 +5350,10 @@ var GroupingActivityMaterialContent = ({
|
|
|
5297
5350
|
const [isShuffled, setIsShuffled] = (0, import_react20.useState)(false);
|
|
5298
5351
|
const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react20.useState)([]);
|
|
5299
5352
|
const dragElementRef = (0, import_react20.useRef)(null);
|
|
5353
|
+
const [mousePosition, setMousePosition] = (0, import_react20.useState)({
|
|
5354
|
+
x: 0,
|
|
5355
|
+
y: 0
|
|
5356
|
+
});
|
|
5300
5357
|
const [touchPosition, setTouchPosition] = (0, import_react20.useState)({
|
|
5301
5358
|
x: 0,
|
|
5302
5359
|
y: 0
|
|
@@ -5364,6 +5421,19 @@ var GroupingActivityMaterialContent = ({
|
|
|
5364
5421
|
e.preventDefault();
|
|
5365
5422
|
setDraggedValue(materialValue);
|
|
5366
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
|
+
}
|
|
5367
5437
|
};
|
|
5368
5438
|
const handleMouseUp = () => {
|
|
5369
5439
|
if (dropTargetKey !== null && draggedValue !== null) {
|
|
@@ -5371,6 +5441,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5371
5441
|
}
|
|
5372
5442
|
setDraggedValue(null);
|
|
5373
5443
|
setDropTargetKey(null);
|
|
5444
|
+
setMousePosition({ x: 0, y: 0 });
|
|
5374
5445
|
};
|
|
5375
5446
|
const handleTouchStart = (e, materialValue, element) => {
|
|
5376
5447
|
if (!checkCanAnswerQuestion()) return;
|
|
@@ -5403,6 +5474,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5403
5474
|
setDraggedValue(null);
|
|
5404
5475
|
setDropTargetKey(null);
|
|
5405
5476
|
setDraggedElement(null);
|
|
5477
|
+
setTouchPosition({ x: 0, y: 0 });
|
|
5406
5478
|
};
|
|
5407
5479
|
const handleSelectItem = (materialValue) => {
|
|
5408
5480
|
if (!checkCanAnswerQuestion()) return;
|
|
@@ -5417,7 +5489,36 @@ var GroupingActivityMaterialContent = ({
|
|
|
5417
5489
|
};
|
|
5418
5490
|
const answerMap = retrieveAnswerMap();
|
|
5419
5491
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5420
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { onMouseUp: handleMouseUp, children: [
|
|
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
|
+
),
|
|
5421
5522
|
draggedValue && touchPosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5422
5523
|
"div",
|
|
5423
5524
|
{
|
|
@@ -5443,7 +5544,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5443
5544
|
src: draggedValue,
|
|
5444
5545
|
canFullScreen: false
|
|
5445
5546
|
},
|
|
5446
|
-
`${uniqueValue}-drag`
|
|
5547
|
+
`${uniqueValue}-drag-touch`
|
|
5447
5548
|
) })
|
|
5448
5549
|
}
|
|
5449
5550
|
),
|
|
@@ -5652,6 +5753,10 @@ var MatchingActivityMaterialContent = ({
|
|
|
5652
5753
|
const [isShuffled, setIsShuffled] = (0, import_react21.useState)(false);
|
|
5653
5754
|
const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react21.useState)([]);
|
|
5654
5755
|
const dragElementRef = (0, import_react21.useRef)(null);
|
|
5756
|
+
const [mousePosition, setMousePosition] = (0, import_react21.useState)({
|
|
5757
|
+
x: 0,
|
|
5758
|
+
y: 0
|
|
5759
|
+
});
|
|
5655
5760
|
const [touchPosition, setTouchPosition] = (0, import_react21.useState)({
|
|
5656
5761
|
x: 0,
|
|
5657
5762
|
y: 0
|
|
@@ -5710,6 +5815,19 @@ var MatchingActivityMaterialContent = ({
|
|
|
5710
5815
|
e.preventDefault();
|
|
5711
5816
|
setDraggedValue(materialValue);
|
|
5712
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
|
+
}
|
|
5713
5831
|
};
|
|
5714
5832
|
const handleMouseUp = () => {
|
|
5715
5833
|
if (dropTargetKey !== null && draggedValue !== null) {
|
|
@@ -5717,6 +5835,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5717
5835
|
}
|
|
5718
5836
|
setDraggedValue(null);
|
|
5719
5837
|
setDropTargetKey(null);
|
|
5838
|
+
setMousePosition({ x: 0, y: 0 });
|
|
5720
5839
|
};
|
|
5721
5840
|
const handleTouchStart = (e, materialValue, element) => {
|
|
5722
5841
|
if (!checkCanAnswerQuestion()) return;
|
|
@@ -5749,6 +5868,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5749
5868
|
setDraggedValue(null);
|
|
5750
5869
|
setDropTargetKey(null);
|
|
5751
5870
|
setDraggedElement(null);
|
|
5871
|
+
setTouchPosition({ x: 0, y: 0 });
|
|
5752
5872
|
};
|
|
5753
5873
|
const handleSelectItem = (materialValue) => {
|
|
5754
5874
|
if (!checkCanAnswerQuestion()) return;
|
|
@@ -5763,7 +5883,36 @@ var MatchingActivityMaterialContent = ({
|
|
|
5763
5883
|
};
|
|
5764
5884
|
const answerMap = retrieveAnswerMap();
|
|
5765
5885
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5766
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { onMouseUp: handleMouseUp, children: [
|
|
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
|
+
),
|
|
5767
5916
|
draggedValue && touchPosition.x > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
5768
5917
|
"div",
|
|
5769
5918
|
{
|
|
@@ -5789,7 +5938,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5789
5938
|
src: draggedValue,
|
|
5790
5939
|
canFullScreen: false
|
|
5791
5940
|
},
|
|
5792
|
-
`${uniqueValue}-drag`
|
|
5941
|
+
`${uniqueValue}-drag-touch`
|
|
5793
5942
|
) })
|
|
5794
5943
|
}
|
|
5795
5944
|
),
|
|
@@ -6510,6 +6659,10 @@ var OrderingActivityMaterialContent = ({
|
|
|
6510
6659
|
null
|
|
6511
6660
|
);
|
|
6512
6661
|
const dragElementRef = (0, import_react23.useRef)(null);
|
|
6662
|
+
const [mousePosition, setMousePosition] = (0, import_react23.useState)({
|
|
6663
|
+
x: 0,
|
|
6664
|
+
y: 0
|
|
6665
|
+
});
|
|
6513
6666
|
const [touchPosition, setTouchPosition] = (0, import_react23.useState)({
|
|
6514
6667
|
x: 0,
|
|
6515
6668
|
y: 0
|
|
@@ -6571,6 +6724,19 @@ var OrderingActivityMaterialContent = ({
|
|
|
6571
6724
|
e.preventDefault();
|
|
6572
6725
|
setDraggedKey(materialKey);
|
|
6573
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
|
+
}
|
|
6574
6740
|
};
|
|
6575
6741
|
const handleMouseUp = () => {
|
|
6576
6742
|
if (dropTargetKey !== null && draggedKey !== null && dropTargetKey !== draggedKey) {
|
|
@@ -6578,6 +6744,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6578
6744
|
}
|
|
6579
6745
|
setDraggedKey(null);
|
|
6580
6746
|
setDropTargetKey(null);
|
|
6747
|
+
setMousePosition({ x: 0, y: 0 });
|
|
6581
6748
|
};
|
|
6582
6749
|
const handleTouchStart = (e, materialKey, element) => {
|
|
6583
6750
|
if (!checkCanAnswerQuestion()) return;
|
|
@@ -6610,6 +6777,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6610
6777
|
setDraggedKey(null);
|
|
6611
6778
|
setDropTargetKey(null);
|
|
6612
6779
|
setDraggedElement(null);
|
|
6780
|
+
setTouchPosition({ x: 0, y: 0 });
|
|
6613
6781
|
};
|
|
6614
6782
|
const handleSelectItem = (materialKey) => {
|
|
6615
6783
|
if (!checkCanAnswerQuestion()) return;
|
|
@@ -6624,100 +6792,137 @@ var OrderingActivityMaterialContent = ({
|
|
|
6624
6792
|
setDraggedKey(null);
|
|
6625
6793
|
};
|
|
6626
6794
|
const answerMap = retrieveAnswerMap();
|
|
6627
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
},
|
|
6637
|
-
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(
|
|
6638
|
-
materialMap[answerMap[draggedKey]]
|
|
6639
|
-
).map((inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6640
|
-
"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",
|
|
6641
6804
|
{
|
|
6642
|
-
className:
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
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",
|
|
6648
6833
|
{
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
answerMap[materialKey] + "",
|
|
6660
|
-
index + ""
|
|
6661
|
-
);
|
|
6662
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "w-full lg:w-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
6663
|
-
"div",
|
|
6664
|
-
{
|
|
6665
|
-
className: `flex flex-row items-center my-4 mx-2`,
|
|
6666
|
-
style: {
|
|
6667
|
-
marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
|
|
6668
|
-
},
|
|
6669
|
-
children: [
|
|
6670
|
-
/* @__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)(
|
|
6671
|
-
"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",
|
|
6672
6844
|
{
|
|
6673
|
-
className: `${
|
|
6674
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("
|
|
6675
|
-
}
|
|
6676
|
-
|
|
6677
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6678
|
-
|
|
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,
|
|
6679
6851
|
{
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
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)(
|
|
6690
6874
|
"div",
|
|
6691
6875
|
{
|
|
6692
|
-
className: `${
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
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",
|
|
6705
6894
|
{
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
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
|
+
}
|
|
6711
6916
|
)
|
|
6712
6917
|
}
|
|
6713
6918
|
)
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
}
|
|
6718
|
-
|
|
6719
|
-
}
|
|
6720
|
-
|
|
6919
|
+
]
|
|
6920
|
+
}
|
|
6921
|
+
) }, index);
|
|
6922
|
+
})
|
|
6923
|
+
]
|
|
6924
|
+
}
|
|
6925
|
+
);
|
|
6721
6926
|
};
|
|
6722
6927
|
var OrderingActivityMaterialContent_default = OrderingActivityMaterialContent;
|
|
6723
6928
|
|