catchup-library-web 1.20.30 → 1.20.32
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 +306 -288
- package/dist/index.mjs +246 -228
- package/package.json +1 -1
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +189 -183
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent2.tsx +306 -0
package/dist/index.js
CHANGED
|
@@ -4860,95 +4860,34 @@ var DropdownActivityContent_default = DropdownActivityContent;
|
|
|
4860
4860
|
|
|
4861
4861
|
// src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
|
|
4862
4862
|
var import_react_katex4 = require("react-katex");
|
|
4863
|
-
var import_react19 = require("react");
|
|
4864
|
-
var import_react20 = require("react");
|
|
4865
|
-
var import_react_dnd3 = require("react-dnd");
|
|
4866
|
-
|
|
4867
|
-
// src/components/dnds/DraggableItem.tsx
|
|
4868
|
-
var import_react_dnd = require("react-dnd");
|
|
4869
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4870
|
-
var DraggableItem = ({
|
|
4871
|
-
item,
|
|
4872
|
-
type,
|
|
4873
|
-
component,
|
|
4874
|
-
moveCardHandler
|
|
4875
|
-
}) => {
|
|
4876
|
-
const [{ isDragging }, drag] = (0, import_react_dnd.useDrag)({
|
|
4877
|
-
type,
|
|
4878
|
-
item,
|
|
4879
|
-
end: (item2, monitor) => {
|
|
4880
|
-
const dropResult = monitor.getDropResult();
|
|
4881
|
-
if (dropResult) {
|
|
4882
|
-
moveCardHandler();
|
|
4883
|
-
}
|
|
4884
|
-
},
|
|
4885
|
-
collect: (monitor) => ({
|
|
4886
|
-
isDragging: monitor.isDragging()
|
|
4887
|
-
})
|
|
4888
|
-
});
|
|
4889
|
-
const opacity = isDragging ? 0.4 : 1;
|
|
4890
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4891
|
-
"div",
|
|
4892
|
-
{
|
|
4893
|
-
className: `${isDragging ? "w-[0px] opacity-0" : "opacity-100"} transition-all duration-500`,
|
|
4894
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: drag, className: "", style: { opacity }, children: component })
|
|
4895
|
-
}
|
|
4896
|
-
);
|
|
4897
|
-
};
|
|
4898
|
-
var DraggableItem_default = DraggableItem;
|
|
4899
|
-
|
|
4900
|
-
// src/components/dnds/DroppableItem.tsx
|
|
4901
4863
|
var import_react18 = require("react");
|
|
4902
|
-
var import_react_dnd2 = require("react-dnd");
|
|
4903
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4904
|
-
var DroppableItem = ({
|
|
4905
|
-
item,
|
|
4906
|
-
type,
|
|
4907
|
-
component,
|
|
4908
|
-
dropRef,
|
|
4909
|
-
target,
|
|
4910
|
-
setTarget
|
|
4911
|
-
}) => {
|
|
4912
|
-
const ref = (0, import_react18.useRef)(null);
|
|
4913
|
-
const [, drop] = (0, import_react_dnd2.useDrop)({
|
|
4914
|
-
accept: type,
|
|
4915
|
-
hover() {
|
|
4916
|
-
if (item.index !== null && target !== item.index) {
|
|
4917
|
-
setTarget(item.index);
|
|
4918
|
-
}
|
|
4919
|
-
}
|
|
4920
|
-
});
|
|
4921
|
-
dropRef(drop(ref));
|
|
4922
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: `w-full transition-all duration-500 h-full`, ref, children: component });
|
|
4923
|
-
};
|
|
4924
|
-
var DroppableItem_default = DroppableItem;
|
|
4925
4864
|
|
|
4926
4865
|
// src/components/texts/InputWithSpecialExpression.tsx
|
|
4927
4866
|
var import_react_katex3 = require("react-katex");
|
|
4928
|
-
var
|
|
4867
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
4929
4868
|
var InputWithSpecialExpression = ({
|
|
4930
4869
|
value,
|
|
4931
4870
|
showSpecialOnly
|
|
4932
4871
|
}) => {
|
|
4933
4872
|
const inputWithSpecialExpressionList = constructInputWithSpecialExpressionList(value);
|
|
4934
|
-
return showSpecialOnly ? inputWithSpecialExpressionList.length > 1 ? /* @__PURE__ */ (0,
|
|
4873
|
+
return showSpecialOnly ? inputWithSpecialExpressionList.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "m-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4935
4874
|
"span",
|
|
4936
4875
|
{
|
|
4937
4876
|
className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4938
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
4877
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-lg", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_katex3.InlineMath, { math: inputPart.value }, index) }) : inputPart.value
|
|
4939
4878
|
}
|
|
4940
|
-
)) }) }) : null : /* @__PURE__ */ (0,
|
|
4879
|
+
)) }) }) : null : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "m-2", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4941
4880
|
"span",
|
|
4942
4881
|
{
|
|
4943
4882
|
className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4944
|
-
children: inputPart.isEquation ? /* @__PURE__ */ (0,
|
|
4883
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-lg", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react_katex3.InlineMath, { math: inputPart.value }, index) }) : inputPart.value
|
|
4945
4884
|
}
|
|
4946
4885
|
)) }) });
|
|
4947
4886
|
};
|
|
4948
4887
|
var InputWithSpecialExpression_default = InputWithSpecialExpression;
|
|
4949
4888
|
|
|
4950
4889
|
// src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
|
|
4951
|
-
var
|
|
4890
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
4952
4891
|
var FillInTheBlanksActivityMaterialContent = ({
|
|
4953
4892
|
uniqueValue,
|
|
4954
4893
|
answer,
|
|
@@ -4960,22 +4899,14 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4960
4899
|
isPreview,
|
|
4961
4900
|
showCorrectAnswer
|
|
4962
4901
|
}) => {
|
|
4963
|
-
const [shuffleOptionList, setShuffleOptionList] = (0,
|
|
4964
|
-
const [selectedOption, setSelectedOption] = (0,
|
|
4965
|
-
const [
|
|
4966
|
-
const [
|
|
4967
|
-
|
|
4968
|
-
drop: () => {
|
|
4969
|
-
},
|
|
4970
|
-
collect: (monitor) => ({
|
|
4971
|
-
isOver: monitor.isOver(),
|
|
4972
|
-
canDrop: monitor.canDrop()
|
|
4973
|
-
})
|
|
4974
|
-
});
|
|
4975
|
-
(0, import_react20.useEffect)(() => {
|
|
4902
|
+
const [shuffleOptionList, setShuffleOptionList] = (0, import_react18.useState)([]);
|
|
4903
|
+
const [selectedOption, setSelectedOption] = (0, import_react18.useState)(null);
|
|
4904
|
+
const [draggedOption, setDraggedOption] = (0, import_react18.useState)(null);
|
|
4905
|
+
const [dropTargetIndex, setDropTargetIndex] = (0, import_react18.useState)(null);
|
|
4906
|
+
(0, import_react18.useEffect)(() => {
|
|
4976
4907
|
setShuffleOptionList(shuffleArray(optionList));
|
|
4977
4908
|
}, []);
|
|
4978
|
-
(0,
|
|
4909
|
+
(0, import_react18.useEffect)(() => {
|
|
4979
4910
|
if (!showCorrectAnswer) return;
|
|
4980
4911
|
const foundAnswer = answer.data.find(
|
|
4981
4912
|
(answerData) => answerData.type === "FILL_IN_THE_BLANKS"
|
|
@@ -5008,165 +4939,191 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
5008
4939
|
};
|
|
5009
4940
|
const handleSelectOption = (option) => {
|
|
5010
4941
|
setSelectedOption(option);
|
|
5011
|
-
|
|
4942
|
+
};
|
|
4943
|
+
const handleDragStart = (option) => {
|
|
4944
|
+
setDraggedOption(option);
|
|
4945
|
+
};
|
|
4946
|
+
const handleDragEnd = () => {
|
|
4947
|
+
if (dropTargetIndex !== null && draggedOption !== null) {
|
|
4948
|
+
onChange(answer, dropTargetIndex, draggedOption);
|
|
4949
|
+
}
|
|
4950
|
+
setDraggedOption(null);
|
|
4951
|
+
setDropTargetIndex(null);
|
|
4952
|
+
};
|
|
4953
|
+
const handleDropZoneEnter = (index) => {
|
|
4954
|
+
setDropTargetIndex(index);
|
|
4955
|
+
};
|
|
4956
|
+
const handleDropZoneDrop = (index) => {
|
|
4957
|
+
if (selectedOption !== null) {
|
|
4958
|
+
onChange(answer, index, selectedOption);
|
|
4959
|
+
setSelectedOption(null);
|
|
4960
|
+
} else if (draggedOption !== null) {
|
|
4961
|
+
onChange(answer, index, draggedOption);
|
|
4962
|
+
setDraggedOption(null);
|
|
4963
|
+
}
|
|
4964
|
+
setDropTargetIndex(null);
|
|
5012
4965
|
};
|
|
5013
4966
|
const answerMap = retrieveAnswerMap();
|
|
5014
|
-
return /* @__PURE__ */ (0,
|
|
5015
|
-
"div",
|
|
5016
|
-
{
|
|
5017
|
-
|
|
5018
|
-
children:
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
4967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "flex flex-row flex-wrap items-center", children: [
|
|
4968
|
+
/* @__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") }) }),
|
|
4969
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "hidden md:contents", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(DividerLine_default, {}) }),
|
|
4970
|
+
/* @__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(
|
|
4971
|
+
(option, index) => checkAnswerProvided(answerMap, option) ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "opacity-30", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4972
|
+
ShowMaterialMediaByContentType_default,
|
|
4973
|
+
{
|
|
4974
|
+
contentType: contentMap.type,
|
|
4975
|
+
src: option,
|
|
4976
|
+
canFullScreen: true
|
|
4977
|
+
},
|
|
4978
|
+
`${uniqueValue}-${index}`
|
|
4979
|
+
) }, index) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4980
|
+
"div",
|
|
4981
|
+
{
|
|
4982
|
+
draggable: true,
|
|
4983
|
+
onDragStart: () => handleDragStart(option),
|
|
4984
|
+
onDragEnd: handleDragEnd,
|
|
4985
|
+
className: `${draggedOption === option ? "opacity-40" : "opacity-100"} transition-opacity duration-200`,
|
|
4986
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4987
|
+
"div",
|
|
5024
4988
|
{
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
4989
|
+
className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge cursor-pointer select-none touch-none",
|
|
4990
|
+
onClick: () => handleSelectOption(option),
|
|
4991
|
+
onTouchEnd: () => handleSelectOption(option),
|
|
4992
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4993
|
+
InputWithSpecialExpression_default,
|
|
4994
|
+
{
|
|
4995
|
+
value: option,
|
|
4996
|
+
showSpecialOnly: false
|
|
4997
|
+
}
|
|
4998
|
+
) })
|
|
4999
|
+
}
|
|
5000
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5001
|
+
"div",
|
|
5032
5002
|
{
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5003
|
+
className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge cursor-pointer select-none touch-none",
|
|
5004
|
+
onClick: () => handleSelectOption(option),
|
|
5005
|
+
onTouchEnd: () => handleSelectOption(option),
|
|
5006
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5007
|
+
ShowMaterialMediaByContentType_default,
|
|
5008
|
+
{
|
|
5009
|
+
contentType: contentMap.type,
|
|
5010
|
+
src: option,
|
|
5011
|
+
canFullScreen: true
|
|
5012
|
+
},
|
|
5013
|
+
`${uniqueValue}-${index}`
|
|
5014
|
+
)
|
|
5015
|
+
}
|
|
5016
|
+
)
|
|
5017
|
+
},
|
|
5018
|
+
index
|
|
5019
|
+
)
|
|
5020
|
+
) }),
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(answerMap).map((materialKey, index) => {
|
|
5022
|
+
const learnerAnswerState = checkAnswerState(
|
|
5023
|
+
JSON.parse(materialMap[materialKey]),
|
|
5024
|
+
answerMap[materialKey]
|
|
5025
|
+
);
|
|
5026
|
+
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)(
|
|
5027
|
+
"div",
|
|
5028
|
+
{
|
|
5029
|
+
onDragOver: (e) => {
|
|
5030
|
+
e.preventDefault();
|
|
5031
|
+
handleDropZoneEnter(materialKey);
|
|
5032
|
+
},
|
|
5033
|
+
onDragLeave: () => setDropTargetIndex(null),
|
|
5034
|
+
onDrop: (e) => {
|
|
5035
|
+
e.preventDefault();
|
|
5036
|
+
handleDropZoneDrop(materialKey);
|
|
5037
|
+
},
|
|
5038
|
+
onClick: () => {
|
|
5039
|
+
if (selectedOption !== null) {
|
|
5040
|
+
handleDropZoneDrop(materialKey);
|
|
5041
|
+
}
|
|
5042
|
+
},
|
|
5043
|
+
className: `${dropTargetIndex === materialKey ? "ring-2 ring-blue-400" : ""}`,
|
|
5044
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
|
|
5045
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "my-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "text-xl", children: [
|
|
5046
|
+
parseFloat(materialKey) + 1,
|
|
5047
|
+
"."
|
|
5048
|
+
] }) }),
|
|
5049
|
+
/* @__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: [
|
|
5050
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5036
5051
|
"div",
|
|
5037
5052
|
{
|
|
5038
|
-
className: "border-catchup-blue
|
|
5039
|
-
onClick: () =>
|
|
5040
|
-
|
|
5053
|
+
className: `w-full min-h-[44px] border rounded-lg ${answerMap[materialKey] ? "border-catchup-blue-400 px-2" : "bg-catchup-gray-50 border-catchup-gray-200 border-dashed py-2 px-4"}`,
|
|
5054
|
+
onClick: () => {
|
|
5055
|
+
if (answerMap[materialKey]) {
|
|
5056
|
+
onChange(answer, materialKey, "");
|
|
5057
|
+
}
|
|
5058
|
+
},
|
|
5059
|
+
children: answerMap[materialKey] ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5041
5060
|
InputWithSpecialExpression_default,
|
|
5042
5061
|
{
|
|
5043
|
-
value:
|
|
5062
|
+
value: answerMap[materialKey],
|
|
5044
5063
|
showSpecialOnly: false
|
|
5045
5064
|
}
|
|
5046
|
-
) })
|
|
5065
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-gray-400 italic" })
|
|
5047
5066
|
}
|
|
5048
|
-
)
|
|
5049
|
-
|
|
5067
|
+
) }),
|
|
5068
|
+
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)(
|
|
5069
|
+
BaseImage_default,
|
|
5050
5070
|
{
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
ShowMaterialMediaByContentType_default,
|
|
5055
|
-
{
|
|
5056
|
-
contentType: contentMap.type,
|
|
5057
|
-
src: option,
|
|
5058
|
-
canFullScreen: true
|
|
5059
|
-
},
|
|
5060
|
-
`${uniqueValue}-${index}`
|
|
5061
|
-
)
|
|
5071
|
+
src: "/icons/checkbox.webp",
|
|
5072
|
+
alt: "checkbox",
|
|
5073
|
+
size: "small"
|
|
5062
5074
|
}
|
|
5063
|
-
),
|
|
5064
|
-
|
|
5065
|
-
|
|
5075
|
+
) }) : 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)(
|
|
5076
|
+
BaseImage_default,
|
|
5077
|
+
{
|
|
5078
|
+
src: "/icons/cross-red.webp",
|
|
5079
|
+
alt: "cross-red",
|
|
5080
|
+
size: "small"
|
|
5081
|
+
}
|
|
5082
|
+
) }) : null
|
|
5083
|
+
] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5084
|
+
"div",
|
|
5085
|
+
{
|
|
5086
|
+
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"}`,
|
|
5087
|
+
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") }) })
|
|
5066
5088
|
}
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5077
|
-
DroppableItem_default,
|
|
5078
|
-
{
|
|
5079
|
-
item: { index },
|
|
5080
|
-
type: "FILL_IN_THE_BLANKS",
|
|
5081
|
-
target: pasteOptionIndex,
|
|
5082
|
-
setTarget: setPasteOptionIndex,
|
|
5083
|
-
dropRef: drop,
|
|
5084
|
-
component: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
|
|
5085
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "my-auto", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("p", { className: "text-xl", children: [
|
|
5086
|
-
parseFloat(materialKey) + 1,
|
|
5087
|
-
"."
|
|
5088
|
-
] }) }),
|
|
5089
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1", children: checkCanAnswerQuestion() ? contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "relative", children: [
|
|
5090
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5091
|
-
"div",
|
|
5092
|
-
{
|
|
5093
|
-
className: `w-full min-h-[44px] border rounded-lg ${answerMap[materialKey] ? "border-catchup-blue-400 px-2" : "bg-catchup-gray-50 border-catchup-gray-200 border-dashed py-2 px-4"}`,
|
|
5094
|
-
onClick: () => {
|
|
5095
|
-
if (answerMap[materialKey]) {
|
|
5096
|
-
onChange(answer, materialKey, "");
|
|
5097
|
-
}
|
|
5098
|
-
},
|
|
5099
|
-
children: answerMap[materialKey] ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5100
|
-
InputWithSpecialExpression_default,
|
|
5101
|
-
{
|
|
5102
|
-
value: answerMap[materialKey],
|
|
5103
|
-
showSpecialOnly: false
|
|
5104
|
-
}
|
|
5105
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-gray-400 italic" })
|
|
5106
|
-
}
|
|
5107
|
-
) }),
|
|
5108
|
-
learnerAnswerState === "CORRECT" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5109
|
-
BaseImage_default,
|
|
5110
|
-
{
|
|
5111
|
-
src: "/icons/checkbox.webp",
|
|
5112
|
-
alt: "checkbox",
|
|
5113
|
-
size: "small"
|
|
5114
|
-
}
|
|
5115
|
-
) }) : learnerAnswerState === "INCORRECT" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5116
|
-
BaseImage_default,
|
|
5117
|
-
{
|
|
5118
|
-
src: "/icons/cross-red.webp",
|
|
5119
|
-
alt: "cross-red",
|
|
5120
|
-
size: "small"
|
|
5121
|
-
}
|
|
5122
|
-
) }) : null
|
|
5123
|
-
] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5124
|
-
"div",
|
|
5125
|
-
{
|
|
5126
|
-
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"}`,
|
|
5127
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "italic", children: i18n_default.t("please_drop_here") }) })
|
|
5128
|
-
}
|
|
5129
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5130
|
-
"div",
|
|
5131
|
-
{
|
|
5132
|
-
className: "flex-1 cursor-pointer",
|
|
5133
|
-
onClick: () => {
|
|
5134
|
-
onChange(answer, materialKey, "");
|
|
5135
|
-
},
|
|
5136
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5137
|
-
ShowMaterialMediaByContentType_default,
|
|
5138
|
-
{
|
|
5139
|
-
contentType: contentMap.type,
|
|
5140
|
-
src: answerMap[materialKey],
|
|
5141
|
-
canFullScreen: true
|
|
5142
|
-
},
|
|
5143
|
-
`${uniqueValue}-${index}`
|
|
5144
|
-
)
|
|
5145
|
-
}
|
|
5146
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
|
|
5147
|
-
answerMap[materialKey]
|
|
5148
|
-
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5149
|
-
"span",
|
|
5089
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5090
|
+
"div",
|
|
5091
|
+
{
|
|
5092
|
+
className: "flex-1 cursor-pointer",
|
|
5093
|
+
onClick: () => {
|
|
5094
|
+
onChange(answer, materialKey, "");
|
|
5095
|
+
},
|
|
5096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5097
|
+
ShowMaterialMediaByContentType_default,
|
|
5150
5098
|
{
|
|
5151
|
-
|
|
5152
|
-
|
|
5099
|
+
contentType: contentMap.type,
|
|
5100
|
+
src: answerMap[materialKey],
|
|
5101
|
+
canFullScreen: true
|
|
5153
5102
|
},
|
|
5154
|
-
|
|
5155
|
-
)
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5103
|
+
`${uniqueValue}-${index}`
|
|
5104
|
+
)
|
|
5105
|
+
}
|
|
5106
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
|
|
5107
|
+
answerMap[materialKey]
|
|
5108
|
+
).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
5109
|
+
"span",
|
|
5110
|
+
{
|
|
5111
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5112
|
+
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
|
|
5113
|
+
},
|
|
5114
|
+
index2
|
|
5115
|
+
)) }, materialKey) })
|
|
5116
|
+
] })
|
|
5117
|
+
}
|
|
5118
|
+
) }) }, index);
|
|
5119
|
+
}) })
|
|
5120
|
+
] });
|
|
5164
5121
|
};
|
|
5165
5122
|
var FillInTheBlanksActivityMaterialContent_default = FillInTheBlanksActivityMaterialContent;
|
|
5166
5123
|
|
|
5167
5124
|
// src/components/activities/FillInTheBlanksActivityContent.tsx
|
|
5168
|
-
var
|
|
5169
|
-
var
|
|
5125
|
+
var import_react19 = require("react");
|
|
5126
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
5170
5127
|
var FillInTheBlanksActivityContent = ({
|
|
5171
5128
|
answer,
|
|
5172
5129
|
data,
|
|
@@ -5186,7 +5143,7 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5186
5143
|
"FILL_IN_THE_BLANKS"
|
|
5187
5144
|
);
|
|
5188
5145
|
const fillInTheBlanksIncorrectList = data.fillInTheBlanksIncorrectList ? JSON.parse(data.fillInTheBlanksIncorrectList) : [];
|
|
5189
|
-
const [currentAnswerMap, setCurrentAnswerMap] = (0,
|
|
5146
|
+
const [currentAnswerMap, setCurrentAnswerMap] = (0, import_react19.useState)(() => {
|
|
5190
5147
|
return retrieveCurrentAnswerMap();
|
|
5191
5148
|
});
|
|
5192
5149
|
function retrieveCurrentAnswerMap() {
|
|
@@ -5195,7 +5152,7 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5195
5152
|
);
|
|
5196
5153
|
return answer.data[foundIndex].answerMap;
|
|
5197
5154
|
}
|
|
5198
|
-
(0,
|
|
5155
|
+
(0, import_react19.useEffect)(() => {
|
|
5199
5156
|
setCurrentAnswerMap(retrieveCurrentAnswerMap());
|
|
5200
5157
|
}, [answer]);
|
|
5201
5158
|
const constructAnswerOptionList = () => {
|
|
@@ -5234,8 +5191,8 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5234
5191
|
setCurrentAnswerMap(newAnswerMap);
|
|
5235
5192
|
changeAnswer(newAnswer);
|
|
5236
5193
|
};
|
|
5237
|
-
return /* @__PURE__ */ (0,
|
|
5238
|
-
/* @__PURE__ */ (0,
|
|
5194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "flex flex-row flex-wrap", children: [
|
|
5195
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[60%]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5239
5196
|
ActivityBodyContent_default,
|
|
5240
5197
|
{
|
|
5241
5198
|
bodyMap: fillInTheBlanksBodyMap,
|
|
@@ -5244,9 +5201,9 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5244
5201
|
templateType: "FILL_IN_THE_BLANKS"
|
|
5245
5202
|
}
|
|
5246
5203
|
) }),
|
|
5247
|
-
/* @__PURE__ */ (0,
|
|
5248
|
-
/* @__PURE__ */ (0,
|
|
5249
|
-
/* @__PURE__ */ (0,
|
|
5204
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: `${isFullScreen ? "contents" : "contents md:hidden"}`, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DividerLine_default, {}) }),
|
|
5205
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: `${isFullScreen ? "hidden" : "hidden md:block"}`, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(VerticalDividerLine_default, {}) }),
|
|
5206
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
5250
5207
|
FillInTheBlanksActivityMaterialContent_default,
|
|
5251
5208
|
{
|
|
5252
5209
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -5265,9 +5222,70 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5265
5222
|
var FillInTheBlanksActivityContent_default = FillInTheBlanksActivityContent;
|
|
5266
5223
|
|
|
5267
5224
|
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
5268
|
-
var
|
|
5269
|
-
var
|
|
5225
|
+
var import_react21 = require("react");
|
|
5226
|
+
var import_react_dnd3 = require("react-dnd");
|
|
5270
5227
|
var import_react_katex5 = require("react-katex");
|
|
5228
|
+
|
|
5229
|
+
// src/components/dnds/DraggableItem.tsx
|
|
5230
|
+
var import_react_dnd = require("react-dnd");
|
|
5231
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5232
|
+
var DraggableItem = ({
|
|
5233
|
+
item,
|
|
5234
|
+
type,
|
|
5235
|
+
component,
|
|
5236
|
+
moveCardHandler
|
|
5237
|
+
}) => {
|
|
5238
|
+
const [{ isDragging }, drag] = (0, import_react_dnd.useDrag)({
|
|
5239
|
+
type,
|
|
5240
|
+
item,
|
|
5241
|
+
end: (item2, monitor) => {
|
|
5242
|
+
const dropResult = monitor.getDropResult();
|
|
5243
|
+
if (dropResult) {
|
|
5244
|
+
moveCardHandler();
|
|
5245
|
+
}
|
|
5246
|
+
},
|
|
5247
|
+
collect: (monitor) => ({
|
|
5248
|
+
isDragging: monitor.isDragging()
|
|
5249
|
+
})
|
|
5250
|
+
});
|
|
5251
|
+
const opacity = isDragging ? 0.4 : 1;
|
|
5252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
5253
|
+
"div",
|
|
5254
|
+
{
|
|
5255
|
+
className: `${isDragging ? "w-[0px] opacity-0" : "opacity-100"} transition-all duration-500`,
|
|
5256
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref: drag, className: "", style: { opacity }, children: component })
|
|
5257
|
+
}
|
|
5258
|
+
);
|
|
5259
|
+
};
|
|
5260
|
+
var DraggableItem_default = DraggableItem;
|
|
5261
|
+
|
|
5262
|
+
// src/components/dnds/DroppableItem.tsx
|
|
5263
|
+
var import_react20 = require("react");
|
|
5264
|
+
var import_react_dnd2 = require("react-dnd");
|
|
5265
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5266
|
+
var DroppableItem = ({
|
|
5267
|
+
item,
|
|
5268
|
+
type,
|
|
5269
|
+
component,
|
|
5270
|
+
dropRef,
|
|
5271
|
+
target,
|
|
5272
|
+
setTarget
|
|
5273
|
+
}) => {
|
|
5274
|
+
const ref = (0, import_react20.useRef)(null);
|
|
5275
|
+
const [, drop] = (0, import_react_dnd2.useDrop)({
|
|
5276
|
+
accept: type,
|
|
5277
|
+
hover() {
|
|
5278
|
+
if (item.index !== null && target !== item.index) {
|
|
5279
|
+
setTarget(item.index);
|
|
5280
|
+
}
|
|
5281
|
+
}
|
|
5282
|
+
});
|
|
5283
|
+
dropRef(drop(ref));
|
|
5284
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: `w-full transition-all duration-500 h-full`, ref, children: component });
|
|
5285
|
+
};
|
|
5286
|
+
var DroppableItem_default = DroppableItem;
|
|
5287
|
+
|
|
5288
|
+
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
5271
5289
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
5272
5290
|
var GroupingActivityMaterialContent = ({
|
|
5273
5291
|
uniqueValue,
|
|
@@ -5279,11 +5297,11 @@ var GroupingActivityMaterialContent = ({
|
|
|
5279
5297
|
isPreview,
|
|
5280
5298
|
showCorrectAnswer
|
|
5281
5299
|
}) => {
|
|
5282
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
5283
|
-
const [selectedTargetKey, setSelectedTargetKey] = (0,
|
|
5284
|
-
const [isShuffled, setIsShuffled] = (0,
|
|
5285
|
-
const [shuffledMaterialList, setShuffledMaterialList] = (0,
|
|
5286
|
-
const [{ isOver, canDrop }, drop] = (0,
|
|
5300
|
+
const [selectedValue, setSelectedValue] = (0, import_react21.useState)(null);
|
|
5301
|
+
const [selectedTargetKey, setSelectedTargetKey] = (0, import_react21.useState)(null);
|
|
5302
|
+
const [isShuffled, setIsShuffled] = (0, import_react21.useState)(false);
|
|
5303
|
+
const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react21.useState)([]);
|
|
5304
|
+
const [{ isOver, canDrop }, drop] = (0, import_react_dnd3.useDrop)({
|
|
5287
5305
|
accept: "GROUPING",
|
|
5288
5306
|
drop: () => {
|
|
5289
5307
|
},
|
|
@@ -5292,8 +5310,8 @@ var GroupingActivityMaterialContent = ({
|
|
|
5292
5310
|
canDrop: monitor.canDrop()
|
|
5293
5311
|
})
|
|
5294
5312
|
});
|
|
5295
|
-
const ref = (0,
|
|
5296
|
-
(0,
|
|
5313
|
+
const ref = (0, import_react21.useRef)(null);
|
|
5314
|
+
(0, import_react21.useEffect)(() => {
|
|
5297
5315
|
const shuffleArray2 = (array) => {
|
|
5298
5316
|
if (!isShuffled) {
|
|
5299
5317
|
const copyArray = JSON.parse(JSON.stringify(array));
|
|
@@ -5314,7 +5332,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5314
5332
|
});
|
|
5315
5333
|
setShuffledMaterialList(shuffleArray2(materialList));
|
|
5316
5334
|
}, []);
|
|
5317
|
-
(0,
|
|
5335
|
+
(0, import_react21.useEffect)(() => {
|
|
5318
5336
|
if (!showCorrectAnswer) return;
|
|
5319
5337
|
answer.data.find(
|
|
5320
5338
|
(answerData) => answerData.type === "GROUPING"
|
|
@@ -5572,8 +5590,8 @@ var GroupingActivityContent = ({
|
|
|
5572
5590
|
var GroupingActivityContent_default = GroupingActivityContent;
|
|
5573
5591
|
|
|
5574
5592
|
// src/components/activities/material-contents/MatchingActivityMaterialContent.tsx
|
|
5575
|
-
var
|
|
5576
|
-
var
|
|
5593
|
+
var import_react22 = require("react");
|
|
5594
|
+
var import_react_dnd4 = require("react-dnd");
|
|
5577
5595
|
var import_react_katex6 = require("react-katex");
|
|
5578
5596
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
5579
5597
|
var MatchingActivityMaterialContent = ({
|
|
@@ -5586,11 +5604,11 @@ var MatchingActivityMaterialContent = ({
|
|
|
5586
5604
|
isPreview,
|
|
5587
5605
|
showCorrectAnswer
|
|
5588
5606
|
}) => {
|
|
5589
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
5590
|
-
const [selectedTargetKey, setSelectedTargetKey] = (0,
|
|
5591
|
-
const [isShuffled, setIsShuffled] = (0,
|
|
5592
|
-
const [shuffledMaterialList, setShuffledMaterialList] = (0,
|
|
5593
|
-
const [{ isOver, canDrop }, drop] = (0,
|
|
5607
|
+
const [selectedValue, setSelectedValue] = (0, import_react22.useState)(null);
|
|
5608
|
+
const [selectedTargetKey, setSelectedTargetKey] = (0, import_react22.useState)(null);
|
|
5609
|
+
const [isShuffled, setIsShuffled] = (0, import_react22.useState)(false);
|
|
5610
|
+
const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react22.useState)([]);
|
|
5611
|
+
const [{ isOver, canDrop }, drop] = (0, import_react_dnd4.useDrop)({
|
|
5594
5612
|
accept: "MATCHING",
|
|
5595
5613
|
drop: () => {
|
|
5596
5614
|
},
|
|
@@ -5599,8 +5617,8 @@ var MatchingActivityMaterialContent = ({
|
|
|
5599
5617
|
canDrop: monitor.canDrop()
|
|
5600
5618
|
})
|
|
5601
5619
|
});
|
|
5602
|
-
const itemsRef = (0,
|
|
5603
|
-
(0,
|
|
5620
|
+
const itemsRef = (0, import_react22.useRef)(null);
|
|
5621
|
+
(0, import_react22.useEffect)(() => {
|
|
5604
5622
|
const shuffleArray2 = (array) => {
|
|
5605
5623
|
if (!isShuffled) {
|
|
5606
5624
|
const copyArray = JSON.parse(JSON.stringify(array));
|
|
@@ -5619,7 +5637,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5619
5637
|
});
|
|
5620
5638
|
setShuffledMaterialList(shuffleArray2(materialList));
|
|
5621
5639
|
}, []);
|
|
5622
|
-
(0,
|
|
5640
|
+
(0, import_react22.useEffect)(() => {
|
|
5623
5641
|
if (!showCorrectAnswer) return;
|
|
5624
5642
|
answer.data.find(
|
|
5625
5643
|
(answerData) => answerData.type === "MATCHING"
|
|
@@ -6354,22 +6372,22 @@ var OpenEndedActivityContent = ({
|
|
|
6354
6372
|
var OpenEndedActivityContent_default = OpenEndedActivityContent;
|
|
6355
6373
|
|
|
6356
6374
|
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6357
|
-
var
|
|
6358
|
-
var
|
|
6375
|
+
var import_react25 = require("react");
|
|
6376
|
+
var import_react_dnd6 = require("react-dnd");
|
|
6359
6377
|
var import_react_katex9 = require("react-katex");
|
|
6360
6378
|
|
|
6361
6379
|
// src/hooks/useScreenSize.ts
|
|
6362
|
-
var
|
|
6380
|
+
var import_react23 = require("react");
|
|
6363
6381
|
var useScreenSize = () => {
|
|
6364
|
-
const [containerSize, setContainerSize] = (0,
|
|
6382
|
+
const [containerSize, setContainerSize] = (0, import_react23.useState)({
|
|
6365
6383
|
width: 0,
|
|
6366
6384
|
height: 0
|
|
6367
6385
|
});
|
|
6368
|
-
const [screenSize, setScreenSize] = (0,
|
|
6386
|
+
const [screenSize, setScreenSize] = (0, import_react23.useState)({
|
|
6369
6387
|
width: window.innerWidth,
|
|
6370
6388
|
height: window.innerHeight
|
|
6371
6389
|
});
|
|
6372
|
-
(0,
|
|
6390
|
+
(0, import_react23.useEffect)(() => {
|
|
6373
6391
|
const handleResize = () => {
|
|
6374
6392
|
setScreenSize({
|
|
6375
6393
|
width: window.innerWidth,
|
|
@@ -6394,8 +6412,8 @@ var useScreenSize = () => {
|
|
|
6394
6412
|
var useScreenSize_default = useScreenSize;
|
|
6395
6413
|
|
|
6396
6414
|
// src/components/dnds/DraggableDroppableItem.tsx
|
|
6397
|
-
var
|
|
6398
|
-
var
|
|
6415
|
+
var import_react24 = require("react");
|
|
6416
|
+
var import_react_dnd5 = require("react-dnd");
|
|
6399
6417
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
6400
6418
|
var DraggableDroppableItem = ({
|
|
6401
6419
|
item,
|
|
@@ -6406,8 +6424,8 @@ var DraggableDroppableItem = ({
|
|
|
6406
6424
|
target,
|
|
6407
6425
|
setTarget
|
|
6408
6426
|
}) => {
|
|
6409
|
-
const ref = (0,
|
|
6410
|
-
const [, drop] = (0,
|
|
6427
|
+
const ref = (0, import_react24.useRef)(null);
|
|
6428
|
+
const [, drop] = (0, import_react_dnd5.useDrop)({
|
|
6411
6429
|
accept: type,
|
|
6412
6430
|
hover() {
|
|
6413
6431
|
if (!ref.current) {
|
|
@@ -6418,7 +6436,7 @@ var DraggableDroppableItem = ({
|
|
|
6418
6436
|
}
|
|
6419
6437
|
}
|
|
6420
6438
|
});
|
|
6421
|
-
const [{ isDragging }, drag] = (0,
|
|
6439
|
+
const [{ isDragging }, drag] = (0, import_react_dnd5.useDrag)({
|
|
6422
6440
|
type,
|
|
6423
6441
|
item,
|
|
6424
6442
|
end: (item2, monitor) => {
|
|
@@ -6456,11 +6474,11 @@ var OrderingActivityMaterialContent = ({
|
|
|
6456
6474
|
isPreview,
|
|
6457
6475
|
showCorrectAnswer
|
|
6458
6476
|
}) => {
|
|
6459
|
-
const [selectedTargetKey, setSelectedTargetKey] = (0,
|
|
6460
|
-
const [selectedKey, setSelectedKey] = (0,
|
|
6477
|
+
const [selectedTargetKey, setSelectedTargetKey] = (0, import_react25.useState)(null);
|
|
6478
|
+
const [selectedKey, setSelectedKey] = (0, import_react25.useState)(null);
|
|
6461
6479
|
const { screenSize } = useScreenSize_default();
|
|
6462
|
-
const [view, setView] = (0,
|
|
6463
|
-
const [{ isOver, canDrop }, drop] = (0,
|
|
6480
|
+
const [view, setView] = (0, import_react25.useState)("PC");
|
|
6481
|
+
const [{ isOver, canDrop }, drop] = (0, import_react_dnd6.useDrop)({
|
|
6464
6482
|
accept: "ORDERING",
|
|
6465
6483
|
drop: () => {
|
|
6466
6484
|
},
|
|
@@ -6469,7 +6487,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6469
6487
|
canDrop: monitor.canDrop()
|
|
6470
6488
|
})
|
|
6471
6489
|
});
|
|
6472
|
-
(0,
|
|
6490
|
+
(0, import_react25.useEffect)(() => {
|
|
6473
6491
|
if (!screenSize) return;
|
|
6474
6492
|
if (screenSize.width <= 1024) {
|
|
6475
6493
|
setView("TABLET");
|
|
@@ -6477,7 +6495,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6477
6495
|
setView("PC");
|
|
6478
6496
|
}
|
|
6479
6497
|
}, [screenSize]);
|
|
6480
|
-
(0,
|
|
6498
|
+
(0, import_react25.useEffect)(() => {
|
|
6481
6499
|
if (!showCorrectAnswer) return;
|
|
6482
6500
|
const answerMap2 = answer.data.find(
|
|
6483
6501
|
(answerData) => answerData.type === "ORDERING"
|
|
@@ -6670,7 +6688,7 @@ var OrderingActivityContent = ({
|
|
|
6670
6688
|
var OrderingActivityContent_default = OrderingActivityContent;
|
|
6671
6689
|
|
|
6672
6690
|
// src/components/activities/material-contents/TrueFalseActivityMaterialContent.tsx
|
|
6673
|
-
var
|
|
6691
|
+
var import_react26 = require("react");
|
|
6674
6692
|
var import_react_katex10 = require("react-katex");
|
|
6675
6693
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
6676
6694
|
var TrueFalseActivityMaterialContent = ({
|
|
@@ -6684,8 +6702,8 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6684
6702
|
showCorrectAnswer
|
|
6685
6703
|
}) => {
|
|
6686
6704
|
const { screenSize } = useScreenSize_default();
|
|
6687
|
-
const [shuffleOptionList, setShuffleOptionList] = (0,
|
|
6688
|
-
(0,
|
|
6705
|
+
const [shuffleOptionList, setShuffleOptionList] = (0, import_react26.useState)([]);
|
|
6706
|
+
(0, import_react26.useEffect)(() => {
|
|
6689
6707
|
const optionList = [];
|
|
6690
6708
|
optionList.push(...materialMap.trueList);
|
|
6691
6709
|
optionList.push(...materialMap.falseList);
|
|
@@ -6695,7 +6713,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6695
6713
|
setShuffleOptionList(shuffleArray(optionList));
|
|
6696
6714
|
}
|
|
6697
6715
|
}, []);
|
|
6698
|
-
(0,
|
|
6716
|
+
(0, import_react26.useEffect)(() => {
|
|
6699
6717
|
if (!showCorrectAnswer) return;
|
|
6700
6718
|
answer.data.find(
|
|
6701
6719
|
(answerData) => answerData.type === "TRUE_FALSE"
|
|
@@ -7005,7 +7023,7 @@ var ActivityEvaluationRubricContent = ({
|
|
|
7005
7023
|
var ActivityEvaluationRubricContent_default = ActivityEvaluationRubricContent;
|
|
7006
7024
|
|
|
7007
7025
|
// src/components/activities/ActivityPreviewByData.tsx
|
|
7008
|
-
var
|
|
7026
|
+
var import_react27 = require("react");
|
|
7009
7027
|
|
|
7010
7028
|
// src/components/boxes/SelectionBox.tsx
|
|
7011
7029
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
@@ -7057,14 +7075,14 @@ var ActivityPreviewByData = ({
|
|
|
7057
7075
|
showDifficulty,
|
|
7058
7076
|
isFullScreen
|
|
7059
7077
|
}) => {
|
|
7060
|
-
const [key, setKey] = (0,
|
|
7061
|
-
const [selectedType, setSelectedType] = (0,
|
|
7062
|
-
const [optionList, setOptionList] = (0,
|
|
7063
|
-
(0,
|
|
7078
|
+
const [key, setKey] = (0, import_react27.useState)((/* @__PURE__ */ new Date()).getTime());
|
|
7079
|
+
const [selectedType, setSelectedType] = (0, import_react27.useState)(null);
|
|
7080
|
+
const [optionList, setOptionList] = (0, import_react27.useState)([]);
|
|
7081
|
+
(0, import_react27.useEffect)(() => {
|
|
7064
7082
|
if (!data) return;
|
|
7065
7083
|
setKey((/* @__PURE__ */ new Date()).getTime());
|
|
7066
7084
|
}, [data]);
|
|
7067
|
-
(0,
|
|
7085
|
+
(0, import_react27.useEffect)(() => {
|
|
7068
7086
|
if (!typeOptionList) return;
|
|
7069
7087
|
if (typeOptionList.length === 0) return;
|
|
7070
7088
|
let foundTypeOption;
|
|
@@ -7079,7 +7097,7 @@ var ActivityPreviewByData = ({
|
|
|
7079
7097
|
setSelectedType(typeOptionList[0].id);
|
|
7080
7098
|
}
|
|
7081
7099
|
}, [typeOptionList, lockedType]);
|
|
7082
|
-
(0,
|
|
7100
|
+
(0, import_react27.useEffect)(() => {
|
|
7083
7101
|
if (!data) return;
|
|
7084
7102
|
if (!typeOptionList) return;
|
|
7085
7103
|
if (typeOptionList.length === 0) return;
|
|
@@ -7262,7 +7280,7 @@ var ActivityPreviewByData = ({
|
|
|
7262
7280
|
var ActivityPreviewByData_default = ActivityPreviewByData;
|
|
7263
7281
|
|
|
7264
7282
|
// src/components/activities/ActivityPreviewByAnswerData.tsx
|
|
7265
|
-
var
|
|
7283
|
+
var import_react28 = require("react");
|
|
7266
7284
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
7267
7285
|
var ActivityPreviewByAnswerData = ({
|
|
7268
7286
|
data,
|
|
@@ -7277,11 +7295,11 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7277
7295
|
showCorrectAnswer = false
|
|
7278
7296
|
}) => {
|
|
7279
7297
|
var _a;
|
|
7280
|
-
const [key, setKey] = (0,
|
|
7281
|
-
const [selectedType, setSelectedType] = (0,
|
|
7282
|
-
const [optionList, setOptionList] = (0,
|
|
7283
|
-
const [answer, setAnswer] = (0,
|
|
7284
|
-
(0,
|
|
7298
|
+
const [key, setKey] = (0, import_react28.useState)((/* @__PURE__ */ new Date()).getTime());
|
|
7299
|
+
const [selectedType, setSelectedType] = (0, import_react28.useState)(null);
|
|
7300
|
+
const [optionList, setOptionList] = (0, import_react28.useState)([]);
|
|
7301
|
+
const [answer, setAnswer] = (0, import_react28.useState)({ data: [] });
|
|
7302
|
+
(0, import_react28.useEffect)(() => {
|
|
7285
7303
|
if (!data) return;
|
|
7286
7304
|
setKey((/* @__PURE__ */ new Date()).getTime());
|
|
7287
7305
|
}, [data]);
|
|
@@ -7294,7 +7312,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7294
7312
|
}
|
|
7295
7313
|
return null;
|
|
7296
7314
|
};
|
|
7297
|
-
(0,
|
|
7315
|
+
(0, import_react28.useEffect)(() => {
|
|
7298
7316
|
if (!data) return;
|
|
7299
7317
|
const constructAnswerBasedOnData2 = () => {
|
|
7300
7318
|
const newAnswer = { data: [] };
|
|
@@ -7333,7 +7351,7 @@ var ActivityPreviewByAnswerData = ({
|
|
|
7333
7351
|
};
|
|
7334
7352
|
constructAnswerBasedOnData2();
|
|
7335
7353
|
}, [data, lockedType]);
|
|
7336
|
-
(0,
|
|
7354
|
+
(0, import_react28.useEffect)(() => {
|
|
7337
7355
|
if (!data || !answer.data.length) return;
|
|
7338
7356
|
let currentTypeOptionList = typeOptionList || answer.data.map((item) => ({
|
|
7339
7357
|
id: item.type,
|
|
@@ -7500,7 +7518,7 @@ var LeftTextRightInputGroup = ({
|
|
|
7500
7518
|
var LeftTextRightInputGroup_default = LeftTextRightInputGroup;
|
|
7501
7519
|
|
|
7502
7520
|
// src/components/groups/PageTravelGroup.tsx
|
|
7503
|
-
var
|
|
7521
|
+
var import_react29 = require("react");
|
|
7504
7522
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
7505
7523
|
var PageTravelGroup = ({
|
|
7506
7524
|
isImageProcessing,
|
|
@@ -7510,13 +7528,13 @@ var PageTravelGroup = ({
|
|
|
7510
7528
|
setPageNumber,
|
|
7511
7529
|
setImageReady
|
|
7512
7530
|
}) => {
|
|
7513
|
-
const [totalPageNumber, setTotalPageNumber] = (0,
|
|
7514
|
-
const [newPageNumber, setNewPageNumber] = (0,
|
|
7515
|
-
(0,
|
|
7531
|
+
const [totalPageNumber, setTotalPageNumber] = (0, import_react29.useState)(0);
|
|
7532
|
+
const [newPageNumber, setNewPageNumber] = (0, import_react29.useState)(0);
|
|
7533
|
+
(0, import_react29.useEffect)(() => {
|
|
7516
7534
|
if (!initialTotalPageNumber) return;
|
|
7517
7535
|
setTotalPageNumber(initialTotalPageNumber);
|
|
7518
7536
|
}, [initialTotalPageNumber]);
|
|
7519
|
-
(0,
|
|
7537
|
+
(0, import_react29.useEffect)(() => {
|
|
7520
7538
|
setNewPageNumber(pageNumber + 1);
|
|
7521
7539
|
}, [pageNumber]);
|
|
7522
7540
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-1 flex flex-row justify-center items-center flex-wrap", children: [
|