catchup-library-web 1.19.0 → 1.20.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.d.mts +4 -5
- package/dist/index.d.ts +4 -5
- package/dist/index.js +274 -323
- package/dist/index.mjs +272 -321
- package/package.json +1 -1
- package/src/components/activities/ActivityPreviewByAnswerData.tsx +3 -3
- package/src/components/activities/ActivityPreviewByData.tsx +3 -4
- package/src/components/activities/DropdownActivityContent.tsx +3 -9
- package/src/components/activities/FillInTheBlanksActivityContent.tsx +4 -10
- package/src/components/activities/GroupingActivityContent.tsx +3 -3
- package/src/components/activities/MCMAActivityContent.tsx +3 -2
- package/src/components/activities/MCSAActivityContent.tsx +3 -2
- package/src/components/activities/MatchingActivityContent.tsx +3 -3
- package/src/components/activities/OpenEndedActivityContent.tsx +4 -2
- package/src/components/activities/OrderingActivityContent.tsx +3 -2
- package/src/components/activities/TrueFalseActivityContent.tsx +3 -2
- package/src/components/activities/{body-content → body-contents}/ShowBodyMediaByContentType.tsx +1 -1
- package/src/components/activities/{evaluation-rubric-content → evaluation-rubric-contents}/ActivityEvaluationRubricContent.tsx +1 -1
- package/src/components/activities/{material-content → material-contents}/DropdownActivityMaterialContent.tsx +3 -3
- package/src/components/activities/{material-content → material-contents}/FillInTheBlanksActivityMaterialContent.tsx +2 -2
- package/src/components/activities/material-contents/GroupingActivityMaterialContent.tsx +354 -0
- package/src/components/activities/{material-content → material-contents}/MCMAActivityMaterialContent.tsx +2 -2
- package/src/components/activities/{material-content → material-contents}/MCSAActivityMaterialContent.tsx +2 -2
- package/src/components/activities/material-contents/MatchingActivityMaterialContent.tsx +342 -0
- package/src/components/activities/{material-content → material-contents}/OrderingActivityMaterialContent.tsx +7 -5
- package/src/components/activities/{material-content → material-contents}/ShowMaterialMediaByContentType.tsx +4 -4
- package/src/components/activities/{material-content → material-contents}/TrueFalseActivityMaterialContent.tsx +1 -1
- package/src/components/activities/{solution-content → solution-contents}/ActivitySolutionContent.tsx +1 -1
- package/src/index.ts +4 -4
- package/src/properties/ActivityProperties.ts +1 -2
- package/src/components/activities/material-content/GroupingActivityMaterialContent.tsx +0 -359
- package/src/components/activities/material-content/MatchingActivityMaterialContent.tsx +0 -332
- /package/src/components/activities/{body-content → body-contents}/ActivityBodyContent.tsx +0 -0
- /package/src/components/activities/{empty-content → empty-contents}/ActivityEmptyContent.tsx +0 -0
- /package/src/components/activities/{material-content → material-contents}/OpenEndedActivityMaterialContent.tsx +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1057,14 +1057,14 @@ var BasePDF = ({ file }) => {
|
|
|
1057
1057
|
};
|
|
1058
1058
|
var BasePDF_default = BasePDF;
|
|
1059
1059
|
|
|
1060
|
-
// src/components/activities/empty-
|
|
1060
|
+
// src/components/activities/empty-contents/ActivityEmptyContent.tsx
|
|
1061
1061
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1062
1062
|
var ActivityEmptyContent = () => {
|
|
1063
1063
|
return /* @__PURE__ */ jsx17("div", { className: "flex flex-col items-center justify-center border-2 border-catchup-orange rounded-catchup-xlarge px-5 py-2 my-5 bg-catchup-orange", children: /* @__PURE__ */ jsx17("div", { className: "", children: /* @__PURE__ */ jsx17("p", { className: "text-catchup-white text-xl", children: i18n_default.t("you_have_set_this_activity_as_empty") }) }) });
|
|
1064
1064
|
};
|
|
1065
1065
|
var ActivityEmptyContent_default = ActivityEmptyContent;
|
|
1066
1066
|
|
|
1067
|
-
// src/components/activities/body-
|
|
1067
|
+
// src/components/activities/body-contents/ShowBodyMediaByContentType.tsx
|
|
1068
1068
|
import { useState as useState11 } from "react";
|
|
1069
1069
|
import Modal2 from "react-modal";
|
|
1070
1070
|
|
|
@@ -3147,7 +3147,7 @@ var retrieveOpticalExamPartTypeOptionList = () => {
|
|
|
3147
3147
|
];
|
|
3148
3148
|
};
|
|
3149
3149
|
|
|
3150
|
-
// src/components/activities/body-
|
|
3150
|
+
// src/components/activities/body-contents/ShowBodyMediaByContentType.tsx
|
|
3151
3151
|
import { InlineMath } from "react-katex";
|
|
3152
3152
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3153
3153
|
var ShowBodyMediaByContentType = ({
|
|
@@ -3175,7 +3175,7 @@ var ShowBodyMediaByContentType = ({
|
|
|
3175
3175
|
"span",
|
|
3176
3176
|
{
|
|
3177
3177
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
3178
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx18("span", { className: "text-
|
|
3178
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx18("span", { className: "text-xl", children: /* @__PURE__ */ jsx18(InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
3179
3179
|
},
|
|
3180
3180
|
inputPartIndex
|
|
3181
3181
|
);
|
|
@@ -3520,7 +3520,7 @@ var ShowBodyMediaByContentType = ({
|
|
|
3520
3520
|
};
|
|
3521
3521
|
var ShowBodyMediaByContentType_default = ShowBodyMediaByContentType;
|
|
3522
3522
|
|
|
3523
|
-
// src/components/activities/body-
|
|
3523
|
+
// src/components/activities/body-contents/ActivityBodyContent.tsx
|
|
3524
3524
|
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
3525
3525
|
var ActivityBodyContent = ({
|
|
3526
3526
|
templateType,
|
|
@@ -3629,7 +3629,7 @@ var VerticalDividerLine = () => {
|
|
|
3629
3629
|
};
|
|
3630
3630
|
var VerticalDividerLine_default = VerticalDividerLine;
|
|
3631
3631
|
|
|
3632
|
-
// src/components/activities/material-
|
|
3632
|
+
// src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
|
|
3633
3633
|
import { InlineMath as InlineMath2 } from "react-katex";
|
|
3634
3634
|
|
|
3635
3635
|
// src/components/groups/InputGroup.tsx
|
|
@@ -4060,7 +4060,7 @@ var InputGroup = ({
|
|
|
4060
4060
|
};
|
|
4061
4061
|
var InputGroup_default = InputGroup;
|
|
4062
4062
|
|
|
4063
|
-
// src/components/activities/material-
|
|
4063
|
+
// src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
|
|
4064
4064
|
import { useEffect as useEffect5 } from "react";
|
|
4065
4065
|
import { useState as useState15 } from "react";
|
|
4066
4066
|
|
|
@@ -4209,7 +4209,7 @@ var MediaDropdown = ({ id, answer, optionList }) => {
|
|
|
4209
4209
|
};
|
|
4210
4210
|
var MediaDropdown_default = MediaDropdown;
|
|
4211
4211
|
|
|
4212
|
-
// src/components/activities/material-
|
|
4212
|
+
// src/components/activities/material-contents/ShowMaterialMediaByContentType.tsx
|
|
4213
4213
|
import { useEffect as useEffect4, useRef as useRef2, useState as useState14 } from "react";
|
|
4214
4214
|
import Modal3 from "react-modal";
|
|
4215
4215
|
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
@@ -4302,7 +4302,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4302
4302
|
/* @__PURE__ */ jsx24("div", { className: "my-2", children: /* @__PURE__ */ jsx24("div", { className: "h-full flex flex-row flex-wrap items-center", children: /* @__PURE__ */ jsxs14(
|
|
4303
4303
|
"div",
|
|
4304
4304
|
{
|
|
4305
|
-
className: `${isFullHeight ? "h-catchup-activity-box-item" : "max-w-catchup-activity-box-item"} flex flex-col justify-center items-center relative`,
|
|
4305
|
+
className: `${isFullHeight ? "h-catchup-activity-media-box-item" : "max-w-catchup-activity-media-box-item"} flex flex-col justify-center items-center relative`,
|
|
4306
4306
|
children: [
|
|
4307
4307
|
/* @__PURE__ */ jsx24(
|
|
4308
4308
|
BaseImage_default,
|
|
@@ -4346,7 +4346,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4346
4346
|
] }, key) : contentType === "VIDEO" ? /* @__PURE__ */ jsx24("div", { className: "my-2", children: /* @__PURE__ */ jsx24("div", { className: "h-full flex flex-row flex-wrap items-center", children: /* @__PURE__ */ jsx24("div", { className: "h-full flex flex-col justify-center items-center", children: /* @__PURE__ */ jsx24(
|
|
4347
4347
|
"video",
|
|
4348
4348
|
{
|
|
4349
|
-
className: "h-catchup-activity-box-item rounded-catchup-xlarge",
|
|
4349
|
+
className: "h-catchup-activity-media-box-item rounded-catchup-xlarge",
|
|
4350
4350
|
src,
|
|
4351
4351
|
controls: true,
|
|
4352
4352
|
onClick: () => {
|
|
@@ -4355,7 +4355,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4355
4355
|
) }) }) }) : contentType === "AUDIO" ? /* @__PURE__ */ jsx24("div", { className: "my-2", children: /* @__PURE__ */ jsx24("div", { className: "h-full flex flex-row flex-wrap items-center", children: /* @__PURE__ */ jsx24("div", { className: "h-full flex flex-col justify-center items-center", children: /* @__PURE__ */ jsx24(
|
|
4356
4356
|
"audio",
|
|
4357
4357
|
{
|
|
4358
|
-
className: "h-catchup-activity-box-item rounded-catchup-xlarge",
|
|
4358
|
+
className: "h-catchup-activity-media-box-item rounded-catchup-xlarge",
|
|
4359
4359
|
src,
|
|
4360
4360
|
controls: true,
|
|
4361
4361
|
onClick: () => {
|
|
@@ -4365,7 +4365,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4365
4365
|
};
|
|
4366
4366
|
var ShowMaterialMediaByContentType_default = ShowMaterialMediaByContentType;
|
|
4367
4367
|
|
|
4368
|
-
// src/components/activities/material-
|
|
4368
|
+
// src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
|
|
4369
4369
|
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4370
4370
|
var DropdownActivityMaterialContent = ({
|
|
4371
4371
|
uniqueValue,
|
|
@@ -4438,7 +4438,7 @@ var DropdownActivityMaterialContent = ({
|
|
|
4438
4438
|
"span",
|
|
4439
4439
|
{
|
|
4440
4440
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4441
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx25("span", { className: "text-
|
|
4441
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx25("span", { className: "text-xl", children: /* @__PURE__ */ jsx25(
|
|
4442
4442
|
InlineMath2,
|
|
4443
4443
|
{
|
|
4444
4444
|
math: inputPart.value
|
|
@@ -4457,7 +4457,7 @@ var DropdownActivityMaterialContent = ({
|
|
|
4457
4457
|
MediaDropdown_default,
|
|
4458
4458
|
{
|
|
4459
4459
|
id: materialKey,
|
|
4460
|
-
answer: answerMap[materialKey] === "DEFAULT_OPTION" ? /* @__PURE__ */ jsx25("div", { className: "w-catchup-activity-box-item
|
|
4460
|
+
answer: answerMap[materialKey] === "DEFAULT_OPTION" ? /* @__PURE__ */ jsx25("div", { className: "w-catchup-activity-media-box-item h-catchup-activity-media-box-item border rounded-catchup-xlarge border-dashed border-catchup-blue", children: /* @__PURE__ */ jsx25("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ jsx25("span", { className: "italic", children: i18n_default.t("please_select") }) }) }) : /* @__PURE__ */ jsx25(
|
|
4461
4461
|
ShowMaterialMediaByContentType_default,
|
|
4462
4462
|
{
|
|
4463
4463
|
contentType: contentMap.type,
|
|
@@ -4494,7 +4494,7 @@ var DropdownActivityMaterialContent = ({
|
|
|
4494
4494
|
"span",
|
|
4495
4495
|
{
|
|
4496
4496
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4497
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx25("span", { className: "text-
|
|
4497
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx25("span", { className: "text-xl", children: /* @__PURE__ */ jsx25(InlineMath2, { math: inputPart.value }) }) : inputPart.value
|
|
4498
4498
|
},
|
|
4499
4499
|
index2
|
|
4500
4500
|
)) }) }),
|
|
@@ -4548,6 +4548,7 @@ var DropdownActivityContent = ({
|
|
|
4548
4548
|
setCurrentAnswerMap(retrieveCurrentAnswerMap());
|
|
4549
4549
|
}, [answer]);
|
|
4550
4550
|
const handleDropdownAnswerOnChange = (answerObj, key, value) => {
|
|
4551
|
+
if (isPreview) return;
|
|
4551
4552
|
const newAnswer = __spreadProps(__spreadValues({}, answerObj), {
|
|
4552
4553
|
data: answerObj.data.map((item) => {
|
|
4553
4554
|
if (item.type === "DROPDOWN") {
|
|
@@ -4593,7 +4594,7 @@ var DropdownActivityContent = ({
|
|
|
4593
4594
|
};
|
|
4594
4595
|
var DropdownActivityContent_default = DropdownActivityContent;
|
|
4595
4596
|
|
|
4596
|
-
// src/components/activities/material-
|
|
4597
|
+
// src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
|
|
4597
4598
|
import { InlineMath as InlineMath3 } from "react-katex";
|
|
4598
4599
|
import { useState as useState17 } from "react";
|
|
4599
4600
|
import { useEffect as useEffect7 } from "react";
|
|
@@ -4658,7 +4659,7 @@ var DroppableItem = ({
|
|
|
4658
4659
|
};
|
|
4659
4660
|
var DroppableItem_default = DroppableItem;
|
|
4660
4661
|
|
|
4661
|
-
// src/components/activities/material-
|
|
4662
|
+
// src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
|
|
4662
4663
|
import { jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4663
4664
|
var FillInTheBlanksActivityMaterialContent = ({
|
|
4664
4665
|
uniqueValue,
|
|
@@ -4824,7 +4825,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4824
4825
|
] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ jsx29(
|
|
4825
4826
|
"div",
|
|
4826
4827
|
{
|
|
4827
|
-
className: `w-catchup-activity-box-item
|
|
4828
|
+
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"}`,
|
|
4828
4829
|
children: /* @__PURE__ */ jsx29("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ jsx29("span", { className: "italic", children: i18n_default.t("please_drop_here") }) })
|
|
4829
4830
|
}
|
|
4830
4831
|
) : /* @__PURE__ */ jsx29(
|
|
@@ -4850,7 +4851,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4850
4851
|
"span",
|
|
4851
4852
|
{
|
|
4852
4853
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4853
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx29("span", { className: "text-
|
|
4854
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx29("span", { className: "text-xl", children: /* @__PURE__ */ jsx29(InlineMath3, { math: inputPart.value }) }) : inputPart.value
|
|
4854
4855
|
},
|
|
4855
4856
|
index2
|
|
4856
4857
|
)) }, materialKey) })
|
|
@@ -4916,6 +4917,7 @@ var FillInTheBlanksActivityContent = ({
|
|
|
4916
4917
|
return optionList;
|
|
4917
4918
|
};
|
|
4918
4919
|
const handleFillInTheBlanksAnswerOnChange = (answerObj, key, value) => {
|
|
4920
|
+
if (isPreview) return;
|
|
4919
4921
|
const newAnswer = __spreadProps(__spreadValues({}, answerObj), {
|
|
4920
4922
|
data: answerObj.data.map((item) => {
|
|
4921
4923
|
if (item.type === "FILL_IN_THE_BLANKS") {
|
|
@@ -4962,47 +4964,10 @@ var FillInTheBlanksActivityContent = ({
|
|
|
4962
4964
|
};
|
|
4963
4965
|
var FillInTheBlanksActivityContent_default = FillInTheBlanksActivityContent;
|
|
4964
4966
|
|
|
4965
|
-
// src/components/activities/material-
|
|
4966
|
-
import { useEffect as
|
|
4967
|
+
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
4968
|
+
import { useEffect as useEffect9, useRef as useRef4, useState as useState19 } from "react";
|
|
4967
4969
|
import { useDrop as useDrop3 } from "react-dnd";
|
|
4968
4970
|
import { InlineMath as InlineMath4 } from "react-katex";
|
|
4969
|
-
|
|
4970
|
-
// src/hooks/useScreenSize.ts
|
|
4971
|
-
import { useState as useState19, useEffect as useEffect9 } from "react";
|
|
4972
|
-
var useScreenSize = () => {
|
|
4973
|
-
const [containerSize, setContainerSize] = useState19({
|
|
4974
|
-
width: 0,
|
|
4975
|
-
height: 0
|
|
4976
|
-
});
|
|
4977
|
-
const [screenSize, setScreenSize] = useState19({
|
|
4978
|
-
width: window.innerWidth,
|
|
4979
|
-
height: window.innerHeight
|
|
4980
|
-
});
|
|
4981
|
-
useEffect9(() => {
|
|
4982
|
-
const handleResize = () => {
|
|
4983
|
-
setScreenSize({
|
|
4984
|
-
width: window.innerWidth,
|
|
4985
|
-
height: window.innerHeight
|
|
4986
|
-
});
|
|
4987
|
-
const container = document.getElementById("container");
|
|
4988
|
-
if (!container) return;
|
|
4989
|
-
const boundingClientRect = container.getBoundingClientRect();
|
|
4990
|
-
setContainerSize({
|
|
4991
|
-
width: boundingClientRect.width,
|
|
4992
|
-
height: boundingClientRect.height
|
|
4993
|
-
});
|
|
4994
|
-
};
|
|
4995
|
-
handleResize();
|
|
4996
|
-
window.addEventListener("resize", handleResize);
|
|
4997
|
-
return () => {
|
|
4998
|
-
window.removeEventListener("resize", handleResize);
|
|
4999
|
-
};
|
|
5000
|
-
}, []);
|
|
5001
|
-
return { screenSize, containerSize };
|
|
5002
|
-
};
|
|
5003
|
-
var useScreenSize_default = useScreenSize;
|
|
5004
|
-
|
|
5005
|
-
// src/components/activities/material-content/GroupingActivityMaterialContent.tsx
|
|
5006
4971
|
import { Fragment as Fragment2, jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5007
4972
|
var GroupingActivityMaterialContent = ({
|
|
5008
4973
|
uniqueValue,
|
|
@@ -5014,11 +4979,10 @@ var GroupingActivityMaterialContent = ({
|
|
|
5014
4979
|
isPreview,
|
|
5015
4980
|
showCorrectAnswer
|
|
5016
4981
|
}) => {
|
|
5017
|
-
const [selectedValue, setSelectedValue] =
|
|
5018
|
-
const [selectedTargetKey, setSelectedTargetKey] =
|
|
5019
|
-
const [isShuffled, setIsShuffled] =
|
|
5020
|
-
const [shuffledMaterialList, setShuffledMaterialList] =
|
|
5021
|
-
const { screenSize, containerSize } = useScreenSize_default();
|
|
4982
|
+
const [selectedValue, setSelectedValue] = useState19(null);
|
|
4983
|
+
const [selectedTargetKey, setSelectedTargetKey] = useState19(null);
|
|
4984
|
+
const [isShuffled, setIsShuffled] = useState19(false);
|
|
4985
|
+
const [shuffledMaterialList, setShuffledMaterialList] = useState19([]);
|
|
5022
4986
|
const [{ isOver, canDrop }, drop] = useDrop3({
|
|
5023
4987
|
accept: "GROUPING",
|
|
5024
4988
|
drop: () => {
|
|
@@ -5029,15 +4993,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5029
4993
|
})
|
|
5030
4994
|
});
|
|
5031
4995
|
const ref = useRef4(null);
|
|
5032
|
-
|
|
5033
|
-
const [maxWidth, setMaxWidth] = useState20(0);
|
|
5034
|
-
useEffect10(() => {
|
|
5035
|
-
if (!ref) return;
|
|
5036
|
-
if (!ref.current) return;
|
|
5037
|
-
if (!screenSize) return;
|
|
5038
|
-
setMaxWidth(ref.current.offsetWidth - 12);
|
|
5039
|
-
}, [ref, screenSize]);
|
|
5040
|
-
useEffect10(() => {
|
|
4996
|
+
useEffect9(() => {
|
|
5041
4997
|
const shuffleArray2 = (array) => {
|
|
5042
4998
|
if (!isShuffled) {
|
|
5043
4999
|
const copyArray = JSON.parse(JSON.stringify(array));
|
|
@@ -5058,7 +5014,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5058
5014
|
});
|
|
5059
5015
|
setShuffledMaterialList(shuffleArray2(materialList));
|
|
5060
5016
|
}, []);
|
|
5061
|
-
|
|
5017
|
+
useEffect9(() => {
|
|
5062
5018
|
if (!showCorrectAnswer) return;
|
|
5063
5019
|
answer.data.find(
|
|
5064
5020
|
(answerData) => answerData.type === "GROUPING"
|
|
@@ -5103,82 +5059,71 @@ var GroupingActivityMaterialContent = ({
|
|
|
5103
5059
|
const answerMap = retrieveAnswerMap();
|
|
5104
5060
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5105
5061
|
return /* @__PURE__ */ jsxs19(Fragment2, { children: [
|
|
5106
|
-
/* @__PURE__ */
|
|
5107
|
-
"div",
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5062
|
+
filteredMaterialList.length > 0 ? /* @__PURE__ */ jsxs19(Fragment2, { children: [
|
|
5063
|
+
/* @__PURE__ */ jsx31("div", { className: "flex-1 flex flex-row gap-x-4 overflow-x-auto py-2", children: filteredMaterialList.map((materialValue, index) => {
|
|
5064
|
+
return /* @__PURE__ */ jsx31(
|
|
5065
|
+
DraggableItem_default,
|
|
5066
|
+
{
|
|
5067
|
+
item: { index: materialValue },
|
|
5068
|
+
type: "GROUPING",
|
|
5069
|
+
component: /* @__PURE__ */ jsx31(
|
|
5070
|
+
"div",
|
|
5071
|
+
{
|
|
5072
|
+
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`,
|
|
5073
|
+
onMouseDown: () => {
|
|
5074
|
+
if (checkCanAnswerQuestion()) {
|
|
5075
|
+
setSelectedValue(materialValue);
|
|
5076
|
+
}
|
|
5077
|
+
},
|
|
5078
|
+
onMouseUp: () => {
|
|
5079
|
+
if (checkCanAnswerQuestion()) {
|
|
5080
|
+
setSelectedValue(null);
|
|
5081
|
+
}
|
|
5082
|
+
},
|
|
5083
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx31("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] overflow-y-auto", children: /* @__PURE__ */ jsx31("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5084
|
+
materialValue
|
|
5085
|
+
).map((inputPart, index2) => /* @__PURE__ */ jsx31(
|
|
5086
|
+
"span",
|
|
5087
|
+
{
|
|
5088
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5089
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx31("span", { className: "text-2xl", children: /* @__PURE__ */ jsx31(InlineMath4, { math: inputPart.value }) }) : inputPart.value
|
|
5125
5090
|
},
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5091
|
+
index2
|
|
5092
|
+
)) }) }) : /* @__PURE__ */ jsx31(
|
|
5093
|
+
ShowMaterialMediaByContentType_default,
|
|
5094
|
+
{
|
|
5095
|
+
contentType: contentMap.type,
|
|
5096
|
+
src: materialValue,
|
|
5097
|
+
canFullScreen: true
|
|
5130
5098
|
},
|
|
5131
|
-
|
|
5132
|
-
|
|
5133
|
-
{
|
|
5134
|
-
className: `flex flex-col items-center justify-center m-4 min-h-[64px] min-w-[200px]`,
|
|
5135
|
-
children: /* @__PURE__ */ jsx31("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5136
|
-
materialValue
|
|
5137
|
-
).map((inputPart, index2) => /* @__PURE__ */ jsx31(
|
|
5138
|
-
"span",
|
|
5139
|
-
{
|
|
5140
|
-
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5141
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx31("span", { className: "text-2xl", children: /* @__PURE__ */ jsx31(InlineMath4, { math: inputPart.value }) }) : inputPart.value
|
|
5142
|
-
},
|
|
5143
|
-
index2
|
|
5144
|
-
)) })
|
|
5145
|
-
}
|
|
5146
|
-
) : /* @__PURE__ */ jsx31(
|
|
5147
|
-
ShowMaterialMediaByContentType_default,
|
|
5148
|
-
{
|
|
5149
|
-
contentType: contentMap.type,
|
|
5150
|
-
src: materialValue,
|
|
5151
|
-
canFullScreen: true
|
|
5152
|
-
},
|
|
5153
|
-
`${uniqueValue}-${index}`
|
|
5154
|
-
)
|
|
5155
|
-
}
|
|
5156
|
-
),
|
|
5157
|
-
moveCardHandler: () => {
|
|
5158
|
-
if (!selectedTargetKey) return;
|
|
5159
|
-
if (!selectedValue) return;
|
|
5160
|
-
handleGroupingActivityItemOnChange(
|
|
5161
|
-
selectedTargetKey,
|
|
5162
|
-
selectedValue
|
|
5163
|
-
);
|
|
5099
|
+
`${uniqueValue}-${index}`
|
|
5100
|
+
)
|
|
5164
5101
|
}
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5102
|
+
),
|
|
5103
|
+
moveCardHandler: () => {
|
|
5104
|
+
if (!selectedTargetKey) return;
|
|
5105
|
+
if (!selectedValue) return;
|
|
5106
|
+
handleGroupingActivityItemOnChange(
|
|
5107
|
+
selectedTargetKey,
|
|
5108
|
+
selectedValue
|
|
5109
|
+
);
|
|
5110
|
+
}
|
|
5111
|
+
},
|
|
5112
|
+
index
|
|
5113
|
+
);
|
|
5114
|
+
}) }),
|
|
5115
|
+
/* @__PURE__ */ jsx31(DividerLine_default, {})
|
|
5116
|
+
] }) : null,
|
|
5117
|
+
/* @__PURE__ */ jsx31("div", { className: "overflow-y-auto max-h-[600px]", children: Object.keys(answerMap).map((answerMapKey, index) => /* @__PURE__ */ jsxs19("div", { className: "flex flex-row w-full", children: [
|
|
5173
5118
|
/* @__PURE__ */ jsx31("div", { className: "w-1/3", children: /* @__PURE__ */ jsx31(
|
|
5174
5119
|
"div",
|
|
5175
5120
|
{
|
|
5176
|
-
className: `border-catchup-blue h-catchup-activity-outer-box-item flex flex-col items-center justify-center
|
|
5121
|
+
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`,
|
|
5177
5122
|
children: /* @__PURE__ */ jsx31(
|
|
5178
5123
|
"div",
|
|
5179
5124
|
{
|
|
5180
5125
|
className: `flex flex-col items-center justify-center transition-all duration-300 m-4`,
|
|
5181
|
-
children: /* @__PURE__ */ jsx31("p", { className: "text-
|
|
5126
|
+
children: /* @__PURE__ */ jsx31("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(answerMapKey).map(
|
|
5182
5127
|
(inputPart, index2) => /* @__PURE__ */ jsx31(
|
|
5183
5128
|
"span",
|
|
5184
5129
|
{
|
|
@@ -5193,7 +5138,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5193
5138
|
}
|
|
5194
5139
|
) }),
|
|
5195
5140
|
/* @__PURE__ */ jsx31("div", { className: "mx-4 w-[2px] bg-catchup-lighter-gray" }),
|
|
5196
|
-
/* @__PURE__ */ jsx31("div", { className: "flex-1", ref, children: /* @__PURE__ */ jsx31("div", { className: "h-full py-3", children: /* @__PURE__ */ jsx31(
|
|
5141
|
+
/* @__PURE__ */ jsx31("div", { className: "flex-1 min-w-0", ref, children: /* @__PURE__ */ jsx31("div", { className: "h-full py-3", children: /* @__PURE__ */ jsx31(
|
|
5197
5142
|
"div",
|
|
5198
5143
|
{
|
|
5199
5144
|
className: `${canDrop ? selectedTargetKey === answerMapKey ? "bg-catchup-light-blue" : "bg-catchup-light-blue opacity-40" : ""} flex-1 border-catchup-blue rounded-catchup-xlarge border-2 h-full p-1`,
|
|
@@ -5205,20 +5150,17 @@ var GroupingActivityMaterialContent = ({
|
|
|
5205
5150
|
target: selectedTargetKey,
|
|
5206
5151
|
setTarget: setSelectedTargetKey,
|
|
5207
5152
|
dropRef: drop,
|
|
5208
|
-
component: /* @__PURE__ */ jsx31(
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
answerMapValue
|
|
5220
|
-
);
|
|
5221
|
-
return /* @__PURE__ */ jsx31("div", { className: "p-1", children: /* @__PURE__ */ jsx31("div", { className: "h-catchup-activity-box-item", children: /* @__PURE__ */ jsx31(
|
|
5153
|
+
component: /* @__PURE__ */ jsx31("div", { className: "h-full w-full overflow-x-auto", children: /* @__PURE__ */ jsx31("div", { className: "flex flex-row items-center gap-2 w-max h-full", children: answerMap[answerMapKey].map(
|
|
5154
|
+
(answerMapValue, answerMapIndex) => {
|
|
5155
|
+
const learnerAnswerState = checkAnswerState(
|
|
5156
|
+
materialMap[answerMapKey],
|
|
5157
|
+
answerMapValue
|
|
5158
|
+
);
|
|
5159
|
+
return /* @__PURE__ */ jsx31("div", { className: "p-1", children: /* @__PURE__ */ jsx31(
|
|
5160
|
+
"div",
|
|
5161
|
+
{
|
|
5162
|
+
className: `${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"}`,
|
|
5163
|
+
children: /* @__PURE__ */ jsx31(
|
|
5222
5164
|
"div",
|
|
5223
5165
|
{
|
|
5224
5166
|
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`,
|
|
@@ -5234,47 +5176,41 @@ var GroupingActivityMaterialContent = ({
|
|
|
5234
5176
|
setSelectedValue(null);
|
|
5235
5177
|
}
|
|
5236
5178
|
},
|
|
5237
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx31(
|
|
5238
|
-
|
|
5179
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx31("div", { className: "flex flex-col items-center justify-center transition-all duration-300 min-w-[200px] overflow-y-auto", children: /* @__PURE__ */ jsx31("div", { className: "m-2", children: /* @__PURE__ */ jsx31("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5180
|
+
answerMapValue
|
|
5181
|
+
).map((inputPart, index2) => /* @__PURE__ */ jsx31(
|
|
5182
|
+
"span",
|
|
5239
5183
|
{
|
|
5240
|
-
className:
|
|
5241
|
-
children: /* @__PURE__ */ jsx31("
|
|
5242
|
-
|
|
5243
|
-
).map((inputPart, index2) => /* @__PURE__ */ jsx31(
|
|
5244
|
-
"span",
|
|
5184
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5185
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx31("span", { className: "text-2xl", children: /* @__PURE__ */ jsx31(
|
|
5186
|
+
InlineMath4,
|
|
5245
5187
|
{
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
) }) : inputPart.value
|
|
5253
|
-
},
|
|
5254
|
-
index2
|
|
5255
|
-
)) }) })
|
|
5256
|
-
}
|
|
5257
|
-
) : /* @__PURE__ */ jsx31(
|
|
5188
|
+
math: inputPart.value
|
|
5189
|
+
}
|
|
5190
|
+
) }) : inputPart.value
|
|
5191
|
+
},
|
|
5192
|
+
index2
|
|
5193
|
+
)) }) }) }) : /* @__PURE__ */ jsx31(
|
|
5258
5194
|
ShowMaterialMediaByContentType_default,
|
|
5259
5195
|
{
|
|
5260
5196
|
contentType: contentMap.type,
|
|
5261
5197
|
src: answerMapValue,
|
|
5262
5198
|
canFullScreen: false
|
|
5263
5199
|
},
|
|
5264
|
-
`${uniqueValue}-${
|
|
5200
|
+
`${uniqueValue}-${answerMapIndex}`
|
|
5265
5201
|
)
|
|
5266
5202
|
}
|
|
5267
|
-
)
|
|
5203
|
+
)
|
|
5268
5204
|
}
|
|
5269
|
-
)
|
|
5205
|
+
) }, answerMapIndex);
|
|
5270
5206
|
}
|
|
5271
|
-
)
|
|
5207
|
+
) }) })
|
|
5272
5208
|
},
|
|
5273
5209
|
index
|
|
5274
5210
|
)
|
|
5275
5211
|
}
|
|
5276
5212
|
) }) })
|
|
5277
|
-
] }, index))
|
|
5213
|
+
] }, index)) })
|
|
5278
5214
|
] });
|
|
5279
5215
|
};
|
|
5280
5216
|
var GroupingActivityMaterialContent_default = GroupingActivityMaterialContent;
|
|
@@ -5287,13 +5223,13 @@ var GroupingActivityContent = ({
|
|
|
5287
5223
|
canAnswerQuestion,
|
|
5288
5224
|
changeAnswer,
|
|
5289
5225
|
isPreview,
|
|
5290
|
-
showCorrectAnswer
|
|
5291
|
-
isFullScreen
|
|
5226
|
+
showCorrectAnswer
|
|
5292
5227
|
}) => {
|
|
5293
5228
|
const contentMap = parseContentMapFromData(data);
|
|
5294
5229
|
const groupingBodyMap = parseBodyMapFromData(data, "GROUPING");
|
|
5295
5230
|
const groupingMaterialMap = parseMaterialMapFromData(data, "GROUPING");
|
|
5296
5231
|
const handleGroupingAnswerOnChange = (answer2, key, value, index) => {
|
|
5232
|
+
if (isPreview) return;
|
|
5297
5233
|
let foundIndex = answer2.data.findIndex(
|
|
5298
5234
|
(answerData) => answerData.type === "GROUPING"
|
|
5299
5235
|
);
|
|
@@ -5331,8 +5267,8 @@ var GroupingActivityContent = ({
|
|
|
5331
5267
|
};
|
|
5332
5268
|
var GroupingActivityContent_default = GroupingActivityContent;
|
|
5333
5269
|
|
|
5334
|
-
// src/components/activities/material-
|
|
5335
|
-
import { useEffect as
|
|
5270
|
+
// src/components/activities/material-contents/MatchingActivityMaterialContent.tsx
|
|
5271
|
+
import { useEffect as useEffect10, useRef as useRef5, useState as useState20 } from "react";
|
|
5336
5272
|
import { useDrop as useDrop4 } from "react-dnd";
|
|
5337
5273
|
import { InlineMath as InlineMath5 } from "react-katex";
|
|
5338
5274
|
import { Fragment as Fragment4, jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
@@ -5346,10 +5282,10 @@ var MatchingActivityMaterialContent = ({
|
|
|
5346
5282
|
isPreview,
|
|
5347
5283
|
showCorrectAnswer
|
|
5348
5284
|
}) => {
|
|
5349
|
-
const [selectedValue, setSelectedValue] =
|
|
5350
|
-
const [selectedTargetKey, setSelectedTargetKey] =
|
|
5351
|
-
const [isShuffled, setIsShuffled] =
|
|
5352
|
-
const [shuffledMaterialList, setShuffledMaterialList] =
|
|
5285
|
+
const [selectedValue, setSelectedValue] = useState20(null);
|
|
5286
|
+
const [selectedTargetKey, setSelectedTargetKey] = useState20(null);
|
|
5287
|
+
const [isShuffled, setIsShuffled] = useState20(false);
|
|
5288
|
+
const [shuffledMaterialList, setShuffledMaterialList] = useState20([]);
|
|
5353
5289
|
const [{ isOver, canDrop }, drop] = useDrop4({
|
|
5354
5290
|
accept: "MATCHING",
|
|
5355
5291
|
drop: () => {
|
|
@@ -5359,9 +5295,8 @@ var MatchingActivityMaterialContent = ({
|
|
|
5359
5295
|
canDrop: monitor.canDrop()
|
|
5360
5296
|
})
|
|
5361
5297
|
});
|
|
5362
|
-
const { containerSize } = useScreenSize_default();
|
|
5363
5298
|
const itemsRef = useRef5(null);
|
|
5364
|
-
|
|
5299
|
+
useEffect10(() => {
|
|
5365
5300
|
const shuffleArray2 = (array) => {
|
|
5366
5301
|
if (!isShuffled) {
|
|
5367
5302
|
const copyArray = JSON.parse(JSON.stringify(array));
|
|
@@ -5380,31 +5315,17 @@ var MatchingActivityMaterialContent = ({
|
|
|
5380
5315
|
});
|
|
5381
5316
|
setShuffledMaterialList(shuffleArray2(materialList));
|
|
5382
5317
|
}, []);
|
|
5383
|
-
|
|
5318
|
+
useEffect10(() => {
|
|
5384
5319
|
if (!showCorrectAnswer) return;
|
|
5385
5320
|
answer.data.find(
|
|
5386
5321
|
(answerData) => answerData.type === "MATCHING"
|
|
5387
5322
|
).answerMap = materialMap;
|
|
5388
5323
|
}, [showCorrectAnswer]);
|
|
5389
|
-
useEffect11(() => {
|
|
5390
|
-
if (!itemsRef) return;
|
|
5391
|
-
if (!itemsRef.current) return;
|
|
5392
|
-
if (!containerSize) return;
|
|
5393
|
-
itemsRef.current.style.width = `${containerSize.width - 220}px`;
|
|
5394
|
-
}, [itemsRef, containerSize]);
|
|
5395
5324
|
const retrieveAnswerMap = () => {
|
|
5396
5325
|
const foundIndex = answer.data.findIndex(
|
|
5397
5326
|
(answerData) => answerData.type === "MATCHING"
|
|
5398
5327
|
);
|
|
5399
|
-
|
|
5400
|
-
const sortedAnswerMapKeys = Object.keys(answerMap2).sort(
|
|
5401
|
-
(a, b) => answerMap2[a] ? answerMap2[b] ? answerMap2[a].localeCompare(answerMap2[b]) : 1 : -1
|
|
5402
|
-
);
|
|
5403
|
-
const sortedAnswerMap = {};
|
|
5404
|
-
for (const answerMapKey of sortedAnswerMapKeys) {
|
|
5405
|
-
sortedAnswerMap[answerMapKey] = answerMap2[answerMapKey];
|
|
5406
|
-
}
|
|
5407
|
-
return sortedAnswerMap;
|
|
5328
|
+
return answer.data[foundIndex].answerMap;
|
|
5408
5329
|
};
|
|
5409
5330
|
const retrieveFilteredMaterialList = (answerMap2) => {
|
|
5410
5331
|
const selectedValueList = [];
|
|
@@ -5432,71 +5353,73 @@ var MatchingActivityMaterialContent = ({
|
|
|
5432
5353
|
const answerMap = retrieveAnswerMap();
|
|
5433
5354
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5434
5355
|
return /* @__PURE__ */ jsxs21(Fragment4, { children: [
|
|
5435
|
-
/* @__PURE__ */
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
onMouseUp: () => {
|
|
5455
|
-
if (checkCanAnswerQuestion()) {
|
|
5456
|
-
setSelectedValue(null);
|
|
5457
|
-
}
|
|
5458
|
-
},
|
|
5459
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33(
|
|
5460
|
-
"div",
|
|
5461
|
-
{
|
|
5462
|
-
className: `flex flex-col items-center justify-center m-4 min-h-[64px] min-w-[200px]`,
|
|
5463
|
-
children: /* @__PURE__ */ jsx33("p", { className: "text-xl p-5 whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5464
|
-
materialValue
|
|
5465
|
-
).map((inputPart, index2) => /* @__PURE__ */ jsx33(
|
|
5466
|
-
"span",
|
|
5467
|
-
{
|
|
5468
|
-
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5469
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx33("span", { className: "text-2xl", children: /* @__PURE__ */ jsx33(InlineMath5, { math: inputPart.value }) }) : inputPart.value
|
|
5470
|
-
},
|
|
5471
|
-
index2
|
|
5472
|
-
)) })
|
|
5473
|
-
}
|
|
5474
|
-
) : /* @__PURE__ */ jsx33(
|
|
5475
|
-
ShowMaterialMediaByContentType_default,
|
|
5476
|
-
{
|
|
5477
|
-
contentType: contentMap.type,
|
|
5478
|
-
src: materialValue,
|
|
5479
|
-
canFullScreen: true
|
|
5356
|
+
filteredMaterialList.length > 0 ? /* @__PURE__ */ jsxs21(Fragment4, { children: [
|
|
5357
|
+
/* @__PURE__ */ jsx33(
|
|
5358
|
+
"div",
|
|
5359
|
+
{
|
|
5360
|
+
ref: itemsRef,
|
|
5361
|
+
className: "flex-shrink-0 flex flex-row gap-x-4 gap-y-4 overflow-x-auto py-2",
|
|
5362
|
+
children: filteredMaterialList.map((materialValue, index) => /* @__PURE__ */ jsx33(
|
|
5363
|
+
DraggableItem_default,
|
|
5364
|
+
{
|
|
5365
|
+
item: { index: materialValue },
|
|
5366
|
+
type: "MATCHING",
|
|
5367
|
+
component: /* @__PURE__ */ jsx33(
|
|
5368
|
+
"div",
|
|
5369
|
+
{
|
|
5370
|
+
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`,
|
|
5371
|
+
onMouseDown: () => {
|
|
5372
|
+
if (checkCanAnswerQuestion()) {
|
|
5373
|
+
setSelectedValue(materialValue);
|
|
5374
|
+
}
|
|
5480
5375
|
},
|
|
5481
|
-
|
|
5482
|
-
|
|
5376
|
+
onMouseUp: () => {
|
|
5377
|
+
if (checkCanAnswerQuestion()) {
|
|
5378
|
+
setSelectedValue(null);
|
|
5379
|
+
}
|
|
5380
|
+
},
|
|
5381
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33(
|
|
5382
|
+
"div",
|
|
5383
|
+
{
|
|
5384
|
+
className: `flex flex-col items-center justify-center m-2 min-w-[200px] overflow-y-auto`,
|
|
5385
|
+
children: /* @__PURE__ */ jsx33("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5386
|
+
materialValue
|
|
5387
|
+
).map((inputPart, index2) => /* @__PURE__ */ jsx33(
|
|
5388
|
+
"span",
|
|
5389
|
+
{
|
|
5390
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5391
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx33("span", { className: "text-xl", children: /* @__PURE__ */ jsx33(InlineMath5, { math: inputPart.value }) }) : inputPart.value
|
|
5392
|
+
},
|
|
5393
|
+
index2
|
|
5394
|
+
)) })
|
|
5395
|
+
}
|
|
5396
|
+
) : /* @__PURE__ */ jsx33(
|
|
5397
|
+
ShowMaterialMediaByContentType_default,
|
|
5398
|
+
{
|
|
5399
|
+
contentType: contentMap.type,
|
|
5400
|
+
src: materialValue,
|
|
5401
|
+
canFullScreen: true
|
|
5402
|
+
},
|
|
5403
|
+
`${uniqueValue}-${index}`
|
|
5404
|
+
)
|
|
5405
|
+
}
|
|
5406
|
+
),
|
|
5407
|
+
moveCardHandler: () => {
|
|
5408
|
+
if (!selectedTargetKey) return;
|
|
5409
|
+
if (!selectedValue) return;
|
|
5410
|
+
handleMatchingActivityItemOnChange(
|
|
5411
|
+
selectedTargetKey,
|
|
5412
|
+
selectedValue
|
|
5413
|
+
);
|
|
5483
5414
|
}
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
}
|
|
5493
|
-
},
|
|
5494
|
-
index
|
|
5495
|
-
))
|
|
5496
|
-
}
|
|
5497
|
-
),
|
|
5498
|
-
filteredMaterialList.length > 0 ? /* @__PURE__ */ jsx33(DividerLine_default, {}) : null,
|
|
5499
|
-
Object.keys(answerMap).map((answerMapKey, index) => {
|
|
5415
|
+
},
|
|
5416
|
+
index
|
|
5417
|
+
))
|
|
5418
|
+
}
|
|
5419
|
+
),
|
|
5420
|
+
/* @__PURE__ */ jsx33("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx33(DividerLine_default, {}) })
|
|
5421
|
+
] }) : null,
|
|
5422
|
+
/* @__PURE__ */ jsx33("div", { className: "overflow-y-auto max-h-[600px]", children: Object.keys(answerMap).map((answerMapKey, index) => {
|
|
5500
5423
|
const learnerAnswerState = checkAnswerState(
|
|
5501
5424
|
materialMap[answerMapKey],
|
|
5502
5425
|
answerMap[answerMapKey]
|
|
@@ -5505,30 +5428,24 @@ var MatchingActivityMaterialContent = ({
|
|
|
5505
5428
|
/* @__PURE__ */ jsx33("div", { className: "w-1/3", children: /* @__PURE__ */ jsx33(
|
|
5506
5429
|
"div",
|
|
5507
5430
|
{
|
|
5508
|
-
className:
|
|
5509
|
-
children: /* @__PURE__ */ jsx33(
|
|
5510
|
-
|
|
5431
|
+
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"}`,
|
|
5432
|
+
children: /* @__PURE__ */ jsx33("div", { className: "flex flex-col items-center justify-center transition-all duration-300 m-4", children: /* @__PURE__ */ jsx33("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5433
|
+
answerMapKey
|
|
5434
|
+
).map((inputPart, index2) => /* @__PURE__ */ jsx33(
|
|
5435
|
+
"span",
|
|
5511
5436
|
{
|
|
5512
|
-
className:
|
|
5513
|
-
children: /* @__PURE__ */ jsx33("
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5518
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx33("span", { className: "text-2xl", children: /* @__PURE__ */ jsx33(InlineMath5, { math: inputPart.value }) }) : inputPart.value
|
|
5519
|
-
},
|
|
5520
|
-
index2
|
|
5521
|
-
)
|
|
5522
|
-
) })
|
|
5523
|
-
}
|
|
5524
|
-
)
|
|
5437
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5438
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx33("span", { className: "text-xl", children: /* @__PURE__ */ jsx33(InlineMath5, { math: inputPart.value }) }) : inputPart.value
|
|
5439
|
+
},
|
|
5440
|
+
index2
|
|
5441
|
+
)) }) })
|
|
5525
5442
|
}
|
|
5526
5443
|
) }),
|
|
5527
5444
|
/* @__PURE__ */ jsx33("div", { className: "mx-4 w-[2px] bg-catchup-lighter-gray" }),
|
|
5528
5445
|
/* @__PURE__ */ jsx33("div", { className: "flex-1", children: /* @__PURE__ */ jsx33(
|
|
5529
5446
|
"div",
|
|
5530
5447
|
{
|
|
5531
|
-
className: `${canDrop ? selectedTargetKey === answerMapKey ? "bg-catchup-light-blue" : "bg-catchup-light-blue opacity-40" : ""} h-catchup-activity-
|
|
5448
|
+
className: `${canDrop ? selectedTargetKey === answerMapKey ? "bg-catchup-light-blue" : "bg-catchup-light-blue opacity-40" : ""} ${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"}`,
|
|
5532
5449
|
onClick: () => {
|
|
5533
5450
|
if (checkCanAnswerQuestion()) {
|
|
5534
5451
|
setSelectedValue(null);
|
|
@@ -5545,7 +5462,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5545
5462
|
component: /* @__PURE__ */ jsx33(
|
|
5546
5463
|
"div",
|
|
5547
5464
|
{
|
|
5548
|
-
className:
|
|
5465
|
+
className: "h-full flex-1 flex flex-row items-center justify-center",
|
|
5549
5466
|
onClick: (e) => {
|
|
5550
5467
|
e.preventDefault();
|
|
5551
5468
|
if (checkCanAnswerQuestion()) {
|
|
@@ -5555,13 +5472,13 @@ var MatchingActivityMaterialContent = ({
|
|
|
5555
5472
|
);
|
|
5556
5473
|
}
|
|
5557
5474
|
},
|
|
5558
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33("p", { className: "text-
|
|
5475
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5559
5476
|
answerMap[answerMapKey]
|
|
5560
5477
|
).map((inputPart, index2) => /* @__PURE__ */ jsx33(
|
|
5561
5478
|
"span",
|
|
5562
5479
|
{
|
|
5563
5480
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5564
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx33("span", { className: "text-
|
|
5481
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx33("span", { className: "text-xl", children: /* @__PURE__ */ jsx33(InlineMath5, { math: inputPart.value }) }) : inputPart.value
|
|
5565
5482
|
},
|
|
5566
5483
|
index2
|
|
5567
5484
|
)) }) : /* @__PURE__ */ jsx33(
|
|
@@ -5581,7 +5498,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5581
5498
|
}
|
|
5582
5499
|
) })
|
|
5583
5500
|
] }, index);
|
|
5584
|
-
})
|
|
5501
|
+
}) })
|
|
5585
5502
|
] });
|
|
5586
5503
|
};
|
|
5587
5504
|
var MatchingActivityMaterialContent_default = MatchingActivityMaterialContent;
|
|
@@ -5594,13 +5511,13 @@ var MatchingActivityContent = ({
|
|
|
5594
5511
|
canAnswerQuestion,
|
|
5595
5512
|
changeAnswer,
|
|
5596
5513
|
isPreview,
|
|
5597
|
-
showCorrectAnswer
|
|
5598
|
-
isFullScreen
|
|
5514
|
+
showCorrectAnswer
|
|
5599
5515
|
}) => {
|
|
5600
5516
|
const contentMap = parseContentMapFromData(data);
|
|
5601
5517
|
const matchingBodyMap = parseBodyMapFromData(data, "MATCHING");
|
|
5602
5518
|
const matchingMaterialMap = parseMaterialMapFromData(data, "MATCHING");
|
|
5603
5519
|
const handleMatchingAnswerOnChange = (answer2, key, value) => {
|
|
5520
|
+
if (isPreview) return;
|
|
5604
5521
|
let foundIndex = answer2.data.findIndex(
|
|
5605
5522
|
(answerData) => answerData.type === "MATCHING"
|
|
5606
5523
|
);
|
|
@@ -5634,7 +5551,7 @@ var MatchingActivityContent = ({
|
|
|
5634
5551
|
};
|
|
5635
5552
|
var MatchingActivityContent_default = MatchingActivityContent;
|
|
5636
5553
|
|
|
5637
|
-
// src/components/activities/material-
|
|
5554
|
+
// src/components/activities/material-contents/MCMAActivityMaterialContent.tsx
|
|
5638
5555
|
import { InlineMath as InlineMath6 } from "react-katex";
|
|
5639
5556
|
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5640
5557
|
var MCMAActivityMaterialContent = ({
|
|
@@ -5709,7 +5626,7 @@ var MCMAActivityMaterialContent = ({
|
|
|
5709
5626
|
"span",
|
|
5710
5627
|
{
|
|
5711
5628
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5712
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx35("span", { className: "text-
|
|
5629
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx35("span", { className: "text-xl", children: /* @__PURE__ */ jsx35(InlineMath6, { math: inputPart.value }) }) : inputPart.value
|
|
5713
5630
|
},
|
|
5714
5631
|
index3
|
|
5715
5632
|
)) }) : /* @__PURE__ */ jsx35(
|
|
@@ -5732,7 +5649,7 @@ var MCMAActivityMaterialContent = ({
|
|
|
5732
5649
|
"span",
|
|
5733
5650
|
{
|
|
5734
5651
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5735
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx35("span", { className: "text-
|
|
5652
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx35("span", { className: "text-xl", children: /* @__PURE__ */ jsx35(InlineMath6, { math: inputPart.value }) }) : inputPart.value
|
|
5736
5653
|
},
|
|
5737
5654
|
index2
|
|
5738
5655
|
)) }, materialKey)
|
|
@@ -5755,6 +5672,7 @@ var MCMAActivityContent = ({
|
|
|
5755
5672
|
const MCMABodyMap = parseBodyMapFromData(data, "MCMA");
|
|
5756
5673
|
const MCMAMaterialMap = parseMaterialMapFromData(data, "MCMA");
|
|
5757
5674
|
const handleMCMAAnswerOnChange = (answer2, key, value) => {
|
|
5675
|
+
if (isPreview) return;
|
|
5758
5676
|
let foundIndex = answer2.data.findIndex(
|
|
5759
5677
|
(answerData) => answerData.type === "MCMA"
|
|
5760
5678
|
);
|
|
@@ -5789,7 +5707,7 @@ var MCMAActivityContent = ({
|
|
|
5789
5707
|
};
|
|
5790
5708
|
var MCMAActivityContent_default = MCMAActivityContent;
|
|
5791
5709
|
|
|
5792
|
-
// src/components/activities/material-
|
|
5710
|
+
// src/components/activities/material-contents/MCSAActivityMaterialContent.tsx
|
|
5793
5711
|
import { InlineMath as InlineMath7 } from "react-katex";
|
|
5794
5712
|
import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5795
5713
|
var MCSAActivityMaterialContent = ({
|
|
@@ -5859,7 +5777,7 @@ var MCSAActivityMaterialContent = ({
|
|
|
5859
5777
|
"span",
|
|
5860
5778
|
{
|
|
5861
5779
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5862
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx37("span", { className: "text-
|
|
5780
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx37("span", { className: "text-xl", children: /* @__PURE__ */ jsx37(InlineMath7, { math: inputPart.value }) }) : inputPart.value
|
|
5863
5781
|
},
|
|
5864
5782
|
index3
|
|
5865
5783
|
)) }) : /* @__PURE__ */ jsx37(
|
|
@@ -5884,7 +5802,7 @@ var MCSAActivityMaterialContent = ({
|
|
|
5884
5802
|
"span",
|
|
5885
5803
|
{
|
|
5886
5804
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5887
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx37("span", { className: "text-
|
|
5805
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx37("span", { className: "text-xl", children: /* @__PURE__ */ jsx37(InlineMath7, { math: inputPart.value }) }) : inputPart.value
|
|
5888
5806
|
},
|
|
5889
5807
|
index2
|
|
5890
5808
|
)) })
|
|
@@ -5907,6 +5825,7 @@ var MCSAActivityContent = ({
|
|
|
5907
5825
|
const MCSABodyMap = parseBodyMapFromData(data, "MCSA");
|
|
5908
5826
|
const MCSAMaterialMap = parseMaterialMapFromData(data, "MCSA");
|
|
5909
5827
|
const handleMCSAAnswerOnChange = (answer2, key, value) => {
|
|
5828
|
+
if (isPreview) return;
|
|
5910
5829
|
let foundIndex = answer2.data.findIndex(
|
|
5911
5830
|
(answerData) => answerData.type === "MCSA"
|
|
5912
5831
|
);
|
|
@@ -5962,7 +5881,7 @@ var retrieveDocumentTypeFromExtension = (format) => {
|
|
|
5962
5881
|
return "";
|
|
5963
5882
|
};
|
|
5964
5883
|
|
|
5965
|
-
// src/components/activities/material-
|
|
5884
|
+
// src/components/activities/material-contents/OpenEndedActivityMaterialContent.tsx
|
|
5966
5885
|
import { Fragment as Fragment6, jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5967
5886
|
var OpenEndedActivityMaterialContent = ({
|
|
5968
5887
|
answer,
|
|
@@ -6075,11 +5994,13 @@ var OpenEndedActivityContent = ({
|
|
|
6075
5994
|
changeAnswer,
|
|
6076
5995
|
canAnswerQuestion,
|
|
6077
5996
|
showMaterialContent,
|
|
5997
|
+
isPreview,
|
|
6078
5998
|
isFullScreen
|
|
6079
5999
|
}) => {
|
|
6080
6000
|
const contentMap = parseContentMapFromData(data);
|
|
6081
6001
|
const openEndedBodyMap = parseBodyMapFromData(data, "OPEN_ENDED");
|
|
6082
6002
|
const handleOpenEndedAnswerOnChange = (answer2, value) => {
|
|
6003
|
+
if (isPreview) return;
|
|
6083
6004
|
let foundIndex = answer2.data.findIndex(
|
|
6084
6005
|
(answerData) => answerData.type === "OPEN_ENDED"
|
|
6085
6006
|
);
|
|
@@ -6124,11 +6045,46 @@ var OpenEndedActivityContent = ({
|
|
|
6124
6045
|
};
|
|
6125
6046
|
var OpenEndedActivityContent_default = OpenEndedActivityContent;
|
|
6126
6047
|
|
|
6127
|
-
// src/components/activities/material-
|
|
6048
|
+
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6128
6049
|
import { useEffect as useEffect12, useState as useState22 } from "react";
|
|
6129
6050
|
import { useDrop as useDrop6 } from "react-dnd";
|
|
6130
6051
|
import { InlineMath as InlineMath8 } from "react-katex";
|
|
6131
6052
|
|
|
6053
|
+
// src/hooks/useScreenSize.ts
|
|
6054
|
+
import { useState as useState21, useEffect as useEffect11 } from "react";
|
|
6055
|
+
var useScreenSize = () => {
|
|
6056
|
+
const [containerSize, setContainerSize] = useState21({
|
|
6057
|
+
width: 0,
|
|
6058
|
+
height: 0
|
|
6059
|
+
});
|
|
6060
|
+
const [screenSize, setScreenSize] = useState21({
|
|
6061
|
+
width: window.innerWidth,
|
|
6062
|
+
height: window.innerHeight
|
|
6063
|
+
});
|
|
6064
|
+
useEffect11(() => {
|
|
6065
|
+
const handleResize = () => {
|
|
6066
|
+
setScreenSize({
|
|
6067
|
+
width: window.innerWidth,
|
|
6068
|
+
height: window.innerHeight
|
|
6069
|
+
});
|
|
6070
|
+
const container = document.getElementById("container");
|
|
6071
|
+
if (!container) return;
|
|
6072
|
+
const boundingClientRect = container.getBoundingClientRect();
|
|
6073
|
+
setContainerSize({
|
|
6074
|
+
width: boundingClientRect.width,
|
|
6075
|
+
height: boundingClientRect.height
|
|
6076
|
+
});
|
|
6077
|
+
};
|
|
6078
|
+
handleResize();
|
|
6079
|
+
window.addEventListener("resize", handleResize);
|
|
6080
|
+
return () => {
|
|
6081
|
+
window.removeEventListener("resize", handleResize);
|
|
6082
|
+
};
|
|
6083
|
+
}, []);
|
|
6084
|
+
return { screenSize, containerSize };
|
|
6085
|
+
};
|
|
6086
|
+
var useScreenSize_default = useScreenSize;
|
|
6087
|
+
|
|
6132
6088
|
// src/components/dnds/DraggableDroppableItem.tsx
|
|
6133
6089
|
import { useRef as useRef6 } from "react";
|
|
6134
6090
|
import { useDrag as useDrag2, useDrop as useDrop5 } from "react-dnd";
|
|
@@ -6180,7 +6136,7 @@ var DraggableDroppableItem = ({
|
|
|
6180
6136
|
};
|
|
6181
6137
|
var DraggableDroppableItem_default = DraggableDroppableItem;
|
|
6182
6138
|
|
|
6183
|
-
// src/components/activities/material-
|
|
6139
|
+
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6184
6140
|
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6185
6141
|
var OrderingActivityMaterialContent = ({
|
|
6186
6142
|
uniqueValue,
|
|
@@ -6271,19 +6227,13 @@ var OrderingActivityMaterialContent = ({
|
|
|
6271
6227
|
marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
|
|
6272
6228
|
},
|
|
6273
6229
|
children: [
|
|
6274
|
-
/* @__PURE__ */ jsx42("div", { className: "mr-3", children: /* @__PURE__ */ jsx42(
|
|
6230
|
+
/* @__PURE__ */ jsx42("div", { className: "mr-3", children: /* @__PURE__ */ jsx42("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__ */ jsx42(
|
|
6275
6231
|
"div",
|
|
6276
6232
|
{
|
|
6277
|
-
className:
|
|
6278
|
-
children: /* @__PURE__ */ jsx42(
|
|
6279
|
-
"div",
|
|
6280
|
-
{
|
|
6281
|
-
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]`,
|
|
6282
|
-
children: /* @__PURE__ */ jsx42("p", { className: "", children: parseFloat(materialKey) + 1 })
|
|
6283
|
-
}
|
|
6284
|
-
)
|
|
6233
|
+
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]`,
|
|
6234
|
+
children: /* @__PURE__ */ jsx42("p", { className: "", children: parseFloat(materialKey) + 1 })
|
|
6285
6235
|
}
|
|
6286
|
-
) }),
|
|
6236
|
+
) }) }),
|
|
6287
6237
|
/* @__PURE__ */ jsx42(
|
|
6288
6238
|
DraggableDroppableItem_default,
|
|
6289
6239
|
{
|
|
@@ -6293,7 +6243,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6293
6243
|
component: /* @__PURE__ */ jsx42(
|
|
6294
6244
|
"div",
|
|
6295
6245
|
{
|
|
6296
|
-
className: `${canDrop ? selectedKey !== materialKey ? selectedTargetKey === materialKey ? "bg-catchup-light-blue rounded-catchup-xlarge" : "bg-catchup-light-blue rounded-catchup-xlarge opacity-40" : "" : ""}
|
|
6246
|
+
className: `${canDrop ? selectedKey !== materialKey ? selectedTargetKey === materialKey ? "bg-catchup-light-blue rounded-catchup-xlarge" : "bg-catchup-light-blue rounded-catchup-xlarge opacity-40" : "" : ""} ${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"}`,
|
|
6297
6247
|
onMouseDown: () => {
|
|
6298
6248
|
if (checkCanAnswerQuestion()) {
|
|
6299
6249
|
setSelectedKey(materialKey);
|
|
@@ -6305,7 +6255,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6305
6255
|
"span",
|
|
6306
6256
|
{
|
|
6307
6257
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6308
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx42("span", { className: "text-
|
|
6258
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx42("span", { className: "text-xl", children: /* @__PURE__ */ jsx42(InlineMath8, { math: inputPart.value }) }) : inputPart.value
|
|
6309
6259
|
},
|
|
6310
6260
|
index2
|
|
6311
6261
|
)) }) : /* @__PURE__ */ jsx42(
|
|
@@ -6354,6 +6304,7 @@ var OrderingActivityContent = ({
|
|
|
6354
6304
|
const orderingBodyMap = parseBodyMapFromData(data, "ORDERING");
|
|
6355
6305
|
const orderingMaterialMap = parseMaterialMapFromData(data, "ORDERING");
|
|
6356
6306
|
const handleOrderingAnswerOnChange = (answer2, primaryKey, secondaryKey) => {
|
|
6307
|
+
if (isPreview) return;
|
|
6357
6308
|
let foundIndex = answer2.data.findIndex(
|
|
6358
6309
|
(answerData) => answerData.type === "ORDERING"
|
|
6359
6310
|
);
|
|
@@ -6389,7 +6340,7 @@ var OrderingActivityContent = ({
|
|
|
6389
6340
|
};
|
|
6390
6341
|
var OrderingActivityContent_default = OrderingActivityContent;
|
|
6391
6342
|
|
|
6392
|
-
// src/components/activities/material-
|
|
6343
|
+
// src/components/activities/material-contents/TrueFalseActivityMaterialContent.tsx
|
|
6393
6344
|
import { useEffect as useEffect13, useState as useState23 } from "react";
|
|
6394
6345
|
import { InlineMath as InlineMath9 } from "react-katex";
|
|
6395
6346
|
import { Fragment as Fragment9, jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
@@ -6474,7 +6425,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6474
6425
|
"span",
|
|
6475
6426
|
{
|
|
6476
6427
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6477
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx44("span", { className: "text-
|
|
6428
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx44("span", { className: "text-xl", children: /* @__PURE__ */ jsx44(InlineMath9, { math: inputPart.value }) }) : inputPart.value
|
|
6478
6429
|
},
|
|
6479
6430
|
index2
|
|
6480
6431
|
)) }) : /* @__PURE__ */ jsx44(
|
|
@@ -6549,6 +6500,7 @@ var TrueFalseActivityContent = ({
|
|
|
6549
6500
|
return answer.data[foundIndex].answerMap;
|
|
6550
6501
|
};
|
|
6551
6502
|
const handleTrueFalseAnswerOnChange = (answer2, key, value) => {
|
|
6503
|
+
if (isPreview) return;
|
|
6552
6504
|
const answerMap = retrieveCurrentAnswerMap();
|
|
6553
6505
|
if (key === "TRUE") {
|
|
6554
6506
|
const foundFalseIndex = answerMap.falseList.findIndex(
|
|
@@ -6606,7 +6558,7 @@ var TrueFalseActivityContent = ({
|
|
|
6606
6558
|
};
|
|
6607
6559
|
var TrueFalseActivityContent_default = TrueFalseActivityContent;
|
|
6608
6560
|
|
|
6609
|
-
// src/components/activities/solution-
|
|
6561
|
+
// src/components/activities/solution-contents/ActivitySolutionContent.tsx
|
|
6610
6562
|
import { InlineMath as InlineMath10 } from "react-katex";
|
|
6611
6563
|
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6612
6564
|
var ActivitySolutionContent = ({
|
|
@@ -6654,7 +6606,7 @@ var ActivitySolutionContent = ({
|
|
|
6654
6606
|
"span",
|
|
6655
6607
|
{
|
|
6656
6608
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6657
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx46("span", { className: "text-
|
|
6609
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx46("span", { className: "text-xl", children: /* @__PURE__ */ jsx46(InlineMath10, { math: inputPart.value }) }) : inputPart.value
|
|
6658
6610
|
},
|
|
6659
6611
|
`${key}_part_${partIndex}`
|
|
6660
6612
|
)
|
|
@@ -6664,7 +6616,7 @@ var ActivitySolutionContent = ({
|
|
|
6664
6616
|
};
|
|
6665
6617
|
var ActivitySolutionContent_default = ActivitySolutionContent;
|
|
6666
6618
|
|
|
6667
|
-
// src/components/activities/evaluation-rubric-
|
|
6619
|
+
// src/components/activities/evaluation-rubric-contents/ActivityEvaluationRubricContent.tsx
|
|
6668
6620
|
import { InlineMath as InlineMath11 } from "react-katex";
|
|
6669
6621
|
import { jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6670
6622
|
var ActivityEvaluationRubricContent = ({
|
|
@@ -6709,7 +6661,7 @@ var ActivityEvaluationRubricContent = ({
|
|
|
6709
6661
|
"span",
|
|
6710
6662
|
{
|
|
6711
6663
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6712
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx47("span", { className: "text-
|
|
6664
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx47("span", { className: "text-xl", children: /* @__PURE__ */ jsx47(InlineMath11, { math: inputPart.value }) }) : inputPart.value
|
|
6713
6665
|
},
|
|
6714
6666
|
index2
|
|
6715
6667
|
)
|
|
@@ -6905,8 +6857,7 @@ var ActivityPreviewByData = ({
|
|
|
6905
6857
|
},
|
|
6906
6858
|
data,
|
|
6907
6859
|
isPreview: true,
|
|
6908
|
-
showCorrectAnswer: true
|
|
6909
|
-
isFullScreen
|
|
6860
|
+
showCorrectAnswer: true
|
|
6910
6861
|
}
|
|
6911
6862
|
) : selectedType === "GROUPING" && data["groupingBodyMap"] != null && data["groupingMaterialMap"] != null ? /* @__PURE__ */ jsx49(
|
|
6912
6863
|
GroupingActivityContent_default,
|
|
@@ -6919,8 +6870,7 @@ var ActivityPreviewByData = ({
|
|
|
6919
6870
|
},
|
|
6920
6871
|
data,
|
|
6921
6872
|
isPreview: true,
|
|
6922
|
-
showCorrectAnswer: true
|
|
6923
|
-
isFullScreen
|
|
6873
|
+
showCorrectAnswer: true
|
|
6924
6874
|
}
|
|
6925
6875
|
) : selectedType === "FILL_IN_THE_BLANKS" && data["fillInTheBlanksBodyMap"] != null && data["fillInTheBlanksMaterialMap"] != null ? /* @__PURE__ */ jsx49(
|
|
6926
6876
|
FillInTheBlanksActivityContent_default,
|
|
@@ -6945,6 +6895,7 @@ var ActivityPreviewByData = ({
|
|
|
6945
6895
|
},
|
|
6946
6896
|
showMaterialContent: true,
|
|
6947
6897
|
data,
|
|
6898
|
+
isPreview: true,
|
|
6948
6899
|
isFullScreen
|
|
6949
6900
|
}
|
|
6950
6901
|
) : selectedType === "TRUE_FALSE" && data["trueFalseBodyMap"] != null && data["trueFalseMaterialMap"] != null ? /* @__PURE__ */ jsx49(
|