catchup-library-web 1.18.17 → 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 +280 -331
- package/dist/index.mjs +278 -329
- 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}/ActivityBodyContent.tsx +6 -9
- 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/{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,
|
|
@@ -3538,40 +3538,38 @@ var ActivityBodyContent = ({
|
|
|
3538
3538
|
if (isEmpty) {
|
|
3539
3539
|
processedValue = processedValue.replace(
|
|
3540
3540
|
"@@",
|
|
3541
|
-
`----(${currentQQIndex + 1})----`
|
|
3541
|
+
() => `----(${currentQQIndex + 1})----`
|
|
3542
3542
|
);
|
|
3543
3543
|
} else {
|
|
3544
3544
|
const trimmedAnswer = typeof answer === "string" ? answer.trim() : String(answer);
|
|
3545
|
-
console.log("trimmed answer: ", trimmedAnswer);
|
|
3546
3545
|
switch (contentType) {
|
|
3547
3546
|
case "TEXT":
|
|
3548
3547
|
processedValue = processedValue.replace(
|
|
3549
3548
|
"@@",
|
|
3550
|
-
`--TEXT--${trimmedAnswer}--TEXT--`
|
|
3549
|
+
() => `--TEXT--${trimmedAnswer}--TEXT--`
|
|
3551
3550
|
);
|
|
3552
3551
|
break;
|
|
3553
3552
|
case "IMAGE":
|
|
3554
3553
|
processedValue = processedValue.replace(
|
|
3555
3554
|
"@@",
|
|
3556
|
-
`--IMAGE--${trimmedAnswer}--IMAGE--`
|
|
3555
|
+
() => `--IMAGE--${trimmedAnswer}--IMAGE--`
|
|
3557
3556
|
);
|
|
3558
3557
|
break;
|
|
3559
3558
|
case "VIDEO":
|
|
3560
3559
|
processedValue = processedValue.replace(
|
|
3561
3560
|
"@@",
|
|
3562
|
-
`--VIDEO--${trimmedAnswer}--VIDEO--`
|
|
3561
|
+
() => `--VIDEO--${trimmedAnswer}--VIDEO--`
|
|
3563
3562
|
);
|
|
3564
3563
|
break;
|
|
3565
3564
|
case "AUDIO":
|
|
3566
3565
|
processedValue = processedValue.replace(
|
|
3567
3566
|
"@@",
|
|
3568
|
-
`--AUDIO--${trimmedAnswer}--AUDIO--`
|
|
3567
|
+
() => `--AUDIO--${trimmedAnswer}--AUDIO--`
|
|
3569
3568
|
);
|
|
3570
3569
|
break;
|
|
3571
3570
|
default:
|
|
3572
|
-
processedValue = processedValue.replace("@@", trimmedAnswer);
|
|
3571
|
+
processedValue = processedValue.replace("@@", () => trimmedAnswer);
|
|
3573
3572
|
}
|
|
3574
|
-
console.log("processed value: ", processedValue);
|
|
3575
3573
|
}
|
|
3576
3574
|
currentQQIndex++;
|
|
3577
3575
|
}
|
|
@@ -3631,7 +3629,7 @@ var VerticalDividerLine = () => {
|
|
|
3631
3629
|
};
|
|
3632
3630
|
var VerticalDividerLine_default = VerticalDividerLine;
|
|
3633
3631
|
|
|
3634
|
-
// src/components/activities/material-
|
|
3632
|
+
// src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
|
|
3635
3633
|
import { InlineMath as InlineMath2 } from "react-katex";
|
|
3636
3634
|
|
|
3637
3635
|
// src/components/groups/InputGroup.tsx
|
|
@@ -4062,7 +4060,7 @@ var InputGroup = ({
|
|
|
4062
4060
|
};
|
|
4063
4061
|
var InputGroup_default = InputGroup;
|
|
4064
4062
|
|
|
4065
|
-
// src/components/activities/material-
|
|
4063
|
+
// src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
|
|
4066
4064
|
import { useEffect as useEffect5 } from "react";
|
|
4067
4065
|
import { useState as useState15 } from "react";
|
|
4068
4066
|
|
|
@@ -4211,7 +4209,7 @@ var MediaDropdown = ({ id, answer, optionList }) => {
|
|
|
4211
4209
|
};
|
|
4212
4210
|
var MediaDropdown_default = MediaDropdown;
|
|
4213
4211
|
|
|
4214
|
-
// src/components/activities/material-
|
|
4212
|
+
// src/components/activities/material-contents/ShowMaterialMediaByContentType.tsx
|
|
4215
4213
|
import { useEffect as useEffect4, useRef as useRef2, useState as useState14 } from "react";
|
|
4216
4214
|
import Modal3 from "react-modal";
|
|
4217
4215
|
import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
@@ -4304,7 +4302,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4304
4302
|
/* @__PURE__ */ jsx24("div", { className: "my-2", children: /* @__PURE__ */ jsx24("div", { className: "h-full flex flex-row flex-wrap items-center", children: /* @__PURE__ */ jsxs14(
|
|
4305
4303
|
"div",
|
|
4306
4304
|
{
|
|
4307
|
-
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`,
|
|
4308
4306
|
children: [
|
|
4309
4307
|
/* @__PURE__ */ jsx24(
|
|
4310
4308
|
BaseImage_default,
|
|
@@ -4348,7 +4346,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4348
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(
|
|
4349
4347
|
"video",
|
|
4350
4348
|
{
|
|
4351
|
-
className: "h-catchup-activity-box-item rounded-catchup-xlarge",
|
|
4349
|
+
className: "h-catchup-activity-media-box-item rounded-catchup-xlarge",
|
|
4352
4350
|
src,
|
|
4353
4351
|
controls: true,
|
|
4354
4352
|
onClick: () => {
|
|
@@ -4357,7 +4355,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4357
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(
|
|
4358
4356
|
"audio",
|
|
4359
4357
|
{
|
|
4360
|
-
className: "h-catchup-activity-box-item rounded-catchup-xlarge",
|
|
4358
|
+
className: "h-catchup-activity-media-box-item rounded-catchup-xlarge",
|
|
4361
4359
|
src,
|
|
4362
4360
|
controls: true,
|
|
4363
4361
|
onClick: () => {
|
|
@@ -4367,7 +4365,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4367
4365
|
};
|
|
4368
4366
|
var ShowMaterialMediaByContentType_default = ShowMaterialMediaByContentType;
|
|
4369
4367
|
|
|
4370
|
-
// src/components/activities/material-
|
|
4368
|
+
// src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
|
|
4371
4369
|
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
4372
4370
|
var DropdownActivityMaterialContent = ({
|
|
4373
4371
|
uniqueValue,
|
|
@@ -4440,7 +4438,7 @@ var DropdownActivityMaterialContent = ({
|
|
|
4440
4438
|
"span",
|
|
4441
4439
|
{
|
|
4442
4440
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4443
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx25("span", { className: "text-
|
|
4441
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx25("span", { className: "text-xl", children: /* @__PURE__ */ jsx25(
|
|
4444
4442
|
InlineMath2,
|
|
4445
4443
|
{
|
|
4446
4444
|
math: inputPart.value
|
|
@@ -4459,7 +4457,7 @@ var DropdownActivityMaterialContent = ({
|
|
|
4459
4457
|
MediaDropdown_default,
|
|
4460
4458
|
{
|
|
4461
4459
|
id: materialKey,
|
|
4462
|
-
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(
|
|
4463
4461
|
ShowMaterialMediaByContentType_default,
|
|
4464
4462
|
{
|
|
4465
4463
|
contentType: contentMap.type,
|
|
@@ -4496,7 +4494,7 @@ var DropdownActivityMaterialContent = ({
|
|
|
4496
4494
|
"span",
|
|
4497
4495
|
{
|
|
4498
4496
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4499
|
-
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
|
|
4500
4498
|
},
|
|
4501
4499
|
index2
|
|
4502
4500
|
)) }) }),
|
|
@@ -4550,6 +4548,7 @@ var DropdownActivityContent = ({
|
|
|
4550
4548
|
setCurrentAnswerMap(retrieveCurrentAnswerMap());
|
|
4551
4549
|
}, [answer]);
|
|
4552
4550
|
const handleDropdownAnswerOnChange = (answerObj, key, value) => {
|
|
4551
|
+
if (isPreview) return;
|
|
4553
4552
|
const newAnswer = __spreadProps(__spreadValues({}, answerObj), {
|
|
4554
4553
|
data: answerObj.data.map((item) => {
|
|
4555
4554
|
if (item.type === "DROPDOWN") {
|
|
@@ -4595,7 +4594,7 @@ var DropdownActivityContent = ({
|
|
|
4595
4594
|
};
|
|
4596
4595
|
var DropdownActivityContent_default = DropdownActivityContent;
|
|
4597
4596
|
|
|
4598
|
-
// src/components/activities/material-
|
|
4597
|
+
// src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
|
|
4599
4598
|
import { InlineMath as InlineMath3 } from "react-katex";
|
|
4600
4599
|
import { useState as useState17 } from "react";
|
|
4601
4600
|
import { useEffect as useEffect7 } from "react";
|
|
@@ -4660,7 +4659,7 @@ var DroppableItem = ({
|
|
|
4660
4659
|
};
|
|
4661
4660
|
var DroppableItem_default = DroppableItem;
|
|
4662
4661
|
|
|
4663
|
-
// src/components/activities/material-
|
|
4662
|
+
// src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
|
|
4664
4663
|
import { jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4665
4664
|
var FillInTheBlanksActivityMaterialContent = ({
|
|
4666
4665
|
uniqueValue,
|
|
@@ -4826,7 +4825,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4826
4825
|
] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ jsx29(
|
|
4827
4826
|
"div",
|
|
4828
4827
|
{
|
|
4829
|
-
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"}`,
|
|
4830
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") }) })
|
|
4831
4830
|
}
|
|
4832
4831
|
) : /* @__PURE__ */ jsx29(
|
|
@@ -4852,7 +4851,7 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4852
4851
|
"span",
|
|
4853
4852
|
{
|
|
4854
4853
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4855
|
-
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
|
|
4856
4855
|
},
|
|
4857
4856
|
index2
|
|
4858
4857
|
)) }, materialKey) })
|
|
@@ -4918,6 +4917,7 @@ var FillInTheBlanksActivityContent = ({
|
|
|
4918
4917
|
return optionList;
|
|
4919
4918
|
};
|
|
4920
4919
|
const handleFillInTheBlanksAnswerOnChange = (answerObj, key, value) => {
|
|
4920
|
+
if (isPreview) return;
|
|
4921
4921
|
const newAnswer = __spreadProps(__spreadValues({}, answerObj), {
|
|
4922
4922
|
data: answerObj.data.map((item) => {
|
|
4923
4923
|
if (item.type === "FILL_IN_THE_BLANKS") {
|
|
@@ -4964,47 +4964,10 @@ var FillInTheBlanksActivityContent = ({
|
|
|
4964
4964
|
};
|
|
4965
4965
|
var FillInTheBlanksActivityContent_default = FillInTheBlanksActivityContent;
|
|
4966
4966
|
|
|
4967
|
-
// src/components/activities/material-
|
|
4968
|
-
import { useEffect as
|
|
4967
|
+
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
4968
|
+
import { useEffect as useEffect9, useRef as useRef4, useState as useState19 } from "react";
|
|
4969
4969
|
import { useDrop as useDrop3 } from "react-dnd";
|
|
4970
4970
|
import { InlineMath as InlineMath4 } from "react-katex";
|
|
4971
|
-
|
|
4972
|
-
// src/hooks/useScreenSize.ts
|
|
4973
|
-
import { useState as useState19, useEffect as useEffect9 } from "react";
|
|
4974
|
-
var useScreenSize = () => {
|
|
4975
|
-
const [containerSize, setContainerSize] = useState19({
|
|
4976
|
-
width: 0,
|
|
4977
|
-
height: 0
|
|
4978
|
-
});
|
|
4979
|
-
const [screenSize, setScreenSize] = useState19({
|
|
4980
|
-
width: window.innerWidth,
|
|
4981
|
-
height: window.innerHeight
|
|
4982
|
-
});
|
|
4983
|
-
useEffect9(() => {
|
|
4984
|
-
const handleResize = () => {
|
|
4985
|
-
setScreenSize({
|
|
4986
|
-
width: window.innerWidth,
|
|
4987
|
-
height: window.innerHeight
|
|
4988
|
-
});
|
|
4989
|
-
const container = document.getElementById("container");
|
|
4990
|
-
if (!container) return;
|
|
4991
|
-
const boundingClientRect = container.getBoundingClientRect();
|
|
4992
|
-
setContainerSize({
|
|
4993
|
-
width: boundingClientRect.width,
|
|
4994
|
-
height: boundingClientRect.height
|
|
4995
|
-
});
|
|
4996
|
-
};
|
|
4997
|
-
handleResize();
|
|
4998
|
-
window.addEventListener("resize", handleResize);
|
|
4999
|
-
return () => {
|
|
5000
|
-
window.removeEventListener("resize", handleResize);
|
|
5001
|
-
};
|
|
5002
|
-
}, []);
|
|
5003
|
-
return { screenSize, containerSize };
|
|
5004
|
-
};
|
|
5005
|
-
var useScreenSize_default = useScreenSize;
|
|
5006
|
-
|
|
5007
|
-
// src/components/activities/material-content/GroupingActivityMaterialContent.tsx
|
|
5008
4971
|
import { Fragment as Fragment2, jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5009
4972
|
var GroupingActivityMaterialContent = ({
|
|
5010
4973
|
uniqueValue,
|
|
@@ -5016,11 +4979,10 @@ var GroupingActivityMaterialContent = ({
|
|
|
5016
4979
|
isPreview,
|
|
5017
4980
|
showCorrectAnswer
|
|
5018
4981
|
}) => {
|
|
5019
|
-
const [selectedValue, setSelectedValue] =
|
|
5020
|
-
const [selectedTargetKey, setSelectedTargetKey] =
|
|
5021
|
-
const [isShuffled, setIsShuffled] =
|
|
5022
|
-
const [shuffledMaterialList, setShuffledMaterialList] =
|
|
5023
|
-
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([]);
|
|
5024
4986
|
const [{ isOver, canDrop }, drop] = useDrop3({
|
|
5025
4987
|
accept: "GROUPING",
|
|
5026
4988
|
drop: () => {
|
|
@@ -5031,15 +4993,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5031
4993
|
})
|
|
5032
4994
|
});
|
|
5033
4995
|
const ref = useRef4(null);
|
|
5034
|
-
|
|
5035
|
-
const [maxWidth, setMaxWidth] = useState20(0);
|
|
5036
|
-
useEffect10(() => {
|
|
5037
|
-
if (!ref) return;
|
|
5038
|
-
if (!ref.current) return;
|
|
5039
|
-
if (!screenSize) return;
|
|
5040
|
-
setMaxWidth(ref.current.offsetWidth - 12);
|
|
5041
|
-
}, [ref, screenSize]);
|
|
5042
|
-
useEffect10(() => {
|
|
4996
|
+
useEffect9(() => {
|
|
5043
4997
|
const shuffleArray2 = (array) => {
|
|
5044
4998
|
if (!isShuffled) {
|
|
5045
4999
|
const copyArray = JSON.parse(JSON.stringify(array));
|
|
@@ -5060,7 +5014,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5060
5014
|
});
|
|
5061
5015
|
setShuffledMaterialList(shuffleArray2(materialList));
|
|
5062
5016
|
}, []);
|
|
5063
|
-
|
|
5017
|
+
useEffect9(() => {
|
|
5064
5018
|
if (!showCorrectAnswer) return;
|
|
5065
5019
|
answer.data.find(
|
|
5066
5020
|
(answerData) => answerData.type === "GROUPING"
|
|
@@ -5105,82 +5059,71 @@ var GroupingActivityMaterialContent = ({
|
|
|
5105
5059
|
const answerMap = retrieveAnswerMap();
|
|
5106
5060
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5107
5061
|
return /* @__PURE__ */ jsxs19(Fragment2, { children: [
|
|
5108
|
-
/* @__PURE__ */
|
|
5109
|
-
"div",
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
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
|
|
5127
5090
|
},
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5091
|
+
index2
|
|
5092
|
+
)) }) }) : /* @__PURE__ */ jsx31(
|
|
5093
|
+
ShowMaterialMediaByContentType_default,
|
|
5094
|
+
{
|
|
5095
|
+
contentType: contentMap.type,
|
|
5096
|
+
src: materialValue,
|
|
5097
|
+
canFullScreen: true
|
|
5132
5098
|
},
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
{
|
|
5136
|
-
className: `flex flex-col items-center justify-center m-4 min-h-[64px] min-w-[200px]`,
|
|
5137
|
-
children: /* @__PURE__ */ jsx31("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5138
|
-
materialValue
|
|
5139
|
-
).map((inputPart, index2) => /* @__PURE__ */ jsx31(
|
|
5140
|
-
"span",
|
|
5141
|
-
{
|
|
5142
|
-
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5143
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx31("span", { className: "text-2xl", children: /* @__PURE__ */ jsx31(InlineMath4, { math: inputPart.value }) }) : inputPart.value
|
|
5144
|
-
},
|
|
5145
|
-
index2
|
|
5146
|
-
)) })
|
|
5147
|
-
}
|
|
5148
|
-
) : /* @__PURE__ */ jsx31(
|
|
5149
|
-
ShowMaterialMediaByContentType_default,
|
|
5150
|
-
{
|
|
5151
|
-
contentType: contentMap.type,
|
|
5152
|
-
src: materialValue,
|
|
5153
|
-
canFullScreen: true
|
|
5154
|
-
},
|
|
5155
|
-
`${uniqueValue}-${index}`
|
|
5156
|
-
)
|
|
5157
|
-
}
|
|
5158
|
-
),
|
|
5159
|
-
moveCardHandler: () => {
|
|
5160
|
-
if (!selectedTargetKey) return;
|
|
5161
|
-
if (!selectedValue) return;
|
|
5162
|
-
handleGroupingActivityItemOnChange(
|
|
5163
|
-
selectedTargetKey,
|
|
5164
|
-
selectedValue
|
|
5165
|
-
);
|
|
5099
|
+
`${uniqueValue}-${index}`
|
|
5100
|
+
)
|
|
5166
5101
|
}
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
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: [
|
|
5175
5118
|
/* @__PURE__ */ jsx31("div", { className: "w-1/3", children: /* @__PURE__ */ jsx31(
|
|
5176
5119
|
"div",
|
|
5177
5120
|
{
|
|
5178
|
-
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`,
|
|
5179
5122
|
children: /* @__PURE__ */ jsx31(
|
|
5180
5123
|
"div",
|
|
5181
5124
|
{
|
|
5182
5125
|
className: `flex flex-col items-center justify-center transition-all duration-300 m-4`,
|
|
5183
|
-
children: /* @__PURE__ */ jsx31("p", { className: "text-
|
|
5126
|
+
children: /* @__PURE__ */ jsx31("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(answerMapKey).map(
|
|
5184
5127
|
(inputPart, index2) => /* @__PURE__ */ jsx31(
|
|
5185
5128
|
"span",
|
|
5186
5129
|
{
|
|
@@ -5195,7 +5138,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5195
5138
|
}
|
|
5196
5139
|
) }),
|
|
5197
5140
|
/* @__PURE__ */ jsx31("div", { className: "mx-4 w-[2px] bg-catchup-lighter-gray" }),
|
|
5198
|
-
/* @__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(
|
|
5199
5142
|
"div",
|
|
5200
5143
|
{
|
|
5201
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`,
|
|
@@ -5207,20 +5150,17 @@ var GroupingActivityMaterialContent = ({
|
|
|
5207
5150
|
target: selectedTargetKey,
|
|
5208
5151
|
setTarget: setSelectedTargetKey,
|
|
5209
5152
|
dropRef: drop,
|
|
5210
|
-
component: /* @__PURE__ */ jsx31(
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
answerMapValue
|
|
5222
|
-
);
|
|
5223
|
-
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(
|
|
5224
5164
|
"div",
|
|
5225
5165
|
{
|
|
5226
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`,
|
|
@@ -5236,47 +5176,41 @@ var GroupingActivityMaterialContent = ({
|
|
|
5236
5176
|
setSelectedValue(null);
|
|
5237
5177
|
}
|
|
5238
5178
|
},
|
|
5239
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx31(
|
|
5240
|
-
|
|
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",
|
|
5241
5183
|
{
|
|
5242
|
-
className:
|
|
5243
|
-
children: /* @__PURE__ */ jsx31("
|
|
5244
|
-
|
|
5245
|
-
).map((inputPart, index2) => /* @__PURE__ */ jsx31(
|
|
5246
|
-
"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,
|
|
5247
5187
|
{
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
) }) : inputPart.value
|
|
5255
|
-
},
|
|
5256
|
-
index2
|
|
5257
|
-
)) }) })
|
|
5258
|
-
}
|
|
5259
|
-
) : /* @__PURE__ */ jsx31(
|
|
5188
|
+
math: inputPart.value
|
|
5189
|
+
}
|
|
5190
|
+
) }) : inputPart.value
|
|
5191
|
+
},
|
|
5192
|
+
index2
|
|
5193
|
+
)) }) }) }) : /* @__PURE__ */ jsx31(
|
|
5260
5194
|
ShowMaterialMediaByContentType_default,
|
|
5261
5195
|
{
|
|
5262
5196
|
contentType: contentMap.type,
|
|
5263
5197
|
src: answerMapValue,
|
|
5264
5198
|
canFullScreen: false
|
|
5265
5199
|
},
|
|
5266
|
-
`${uniqueValue}-${
|
|
5200
|
+
`${uniqueValue}-${answerMapIndex}`
|
|
5267
5201
|
)
|
|
5268
5202
|
}
|
|
5269
|
-
)
|
|
5203
|
+
)
|
|
5270
5204
|
}
|
|
5271
|
-
)
|
|
5205
|
+
) }, answerMapIndex);
|
|
5272
5206
|
}
|
|
5273
|
-
)
|
|
5207
|
+
) }) })
|
|
5274
5208
|
},
|
|
5275
5209
|
index
|
|
5276
5210
|
)
|
|
5277
5211
|
}
|
|
5278
5212
|
) }) })
|
|
5279
|
-
] }, index))
|
|
5213
|
+
] }, index)) })
|
|
5280
5214
|
] });
|
|
5281
5215
|
};
|
|
5282
5216
|
var GroupingActivityMaterialContent_default = GroupingActivityMaterialContent;
|
|
@@ -5289,13 +5223,13 @@ var GroupingActivityContent = ({
|
|
|
5289
5223
|
canAnswerQuestion,
|
|
5290
5224
|
changeAnswer,
|
|
5291
5225
|
isPreview,
|
|
5292
|
-
showCorrectAnswer
|
|
5293
|
-
isFullScreen
|
|
5226
|
+
showCorrectAnswer
|
|
5294
5227
|
}) => {
|
|
5295
5228
|
const contentMap = parseContentMapFromData(data);
|
|
5296
5229
|
const groupingBodyMap = parseBodyMapFromData(data, "GROUPING");
|
|
5297
5230
|
const groupingMaterialMap = parseMaterialMapFromData(data, "GROUPING");
|
|
5298
5231
|
const handleGroupingAnswerOnChange = (answer2, key, value, index) => {
|
|
5232
|
+
if (isPreview) return;
|
|
5299
5233
|
let foundIndex = answer2.data.findIndex(
|
|
5300
5234
|
(answerData) => answerData.type === "GROUPING"
|
|
5301
5235
|
);
|
|
@@ -5333,8 +5267,8 @@ var GroupingActivityContent = ({
|
|
|
5333
5267
|
};
|
|
5334
5268
|
var GroupingActivityContent_default = GroupingActivityContent;
|
|
5335
5269
|
|
|
5336
|
-
// src/components/activities/material-
|
|
5337
|
-
import { useEffect as
|
|
5270
|
+
// src/components/activities/material-contents/MatchingActivityMaterialContent.tsx
|
|
5271
|
+
import { useEffect as useEffect10, useRef as useRef5, useState as useState20 } from "react";
|
|
5338
5272
|
import { useDrop as useDrop4 } from "react-dnd";
|
|
5339
5273
|
import { InlineMath as InlineMath5 } from "react-katex";
|
|
5340
5274
|
import { Fragment as Fragment4, jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
@@ -5348,10 +5282,10 @@ var MatchingActivityMaterialContent = ({
|
|
|
5348
5282
|
isPreview,
|
|
5349
5283
|
showCorrectAnswer
|
|
5350
5284
|
}) => {
|
|
5351
|
-
const [selectedValue, setSelectedValue] =
|
|
5352
|
-
const [selectedTargetKey, setSelectedTargetKey] =
|
|
5353
|
-
const [isShuffled, setIsShuffled] =
|
|
5354
|
-
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([]);
|
|
5355
5289
|
const [{ isOver, canDrop }, drop] = useDrop4({
|
|
5356
5290
|
accept: "MATCHING",
|
|
5357
5291
|
drop: () => {
|
|
@@ -5361,9 +5295,8 @@ var MatchingActivityMaterialContent = ({
|
|
|
5361
5295
|
canDrop: monitor.canDrop()
|
|
5362
5296
|
})
|
|
5363
5297
|
});
|
|
5364
|
-
const { containerSize } = useScreenSize_default();
|
|
5365
5298
|
const itemsRef = useRef5(null);
|
|
5366
|
-
|
|
5299
|
+
useEffect10(() => {
|
|
5367
5300
|
const shuffleArray2 = (array) => {
|
|
5368
5301
|
if (!isShuffled) {
|
|
5369
5302
|
const copyArray = JSON.parse(JSON.stringify(array));
|
|
@@ -5382,31 +5315,17 @@ var MatchingActivityMaterialContent = ({
|
|
|
5382
5315
|
});
|
|
5383
5316
|
setShuffledMaterialList(shuffleArray2(materialList));
|
|
5384
5317
|
}, []);
|
|
5385
|
-
|
|
5318
|
+
useEffect10(() => {
|
|
5386
5319
|
if (!showCorrectAnswer) return;
|
|
5387
5320
|
answer.data.find(
|
|
5388
5321
|
(answerData) => answerData.type === "MATCHING"
|
|
5389
5322
|
).answerMap = materialMap;
|
|
5390
5323
|
}, [showCorrectAnswer]);
|
|
5391
|
-
useEffect11(() => {
|
|
5392
|
-
if (!itemsRef) return;
|
|
5393
|
-
if (!itemsRef.current) return;
|
|
5394
|
-
if (!containerSize) return;
|
|
5395
|
-
itemsRef.current.style.width = `${containerSize.width - 220}px`;
|
|
5396
|
-
}, [itemsRef, containerSize]);
|
|
5397
5324
|
const retrieveAnswerMap = () => {
|
|
5398
5325
|
const foundIndex = answer.data.findIndex(
|
|
5399
5326
|
(answerData) => answerData.type === "MATCHING"
|
|
5400
5327
|
);
|
|
5401
|
-
|
|
5402
|
-
const sortedAnswerMapKeys = Object.keys(answerMap2).sort(
|
|
5403
|
-
(a, b) => answerMap2[a] ? answerMap2[b] ? answerMap2[a].localeCompare(answerMap2[b]) : 1 : -1
|
|
5404
|
-
);
|
|
5405
|
-
const sortedAnswerMap = {};
|
|
5406
|
-
for (const answerMapKey of sortedAnswerMapKeys) {
|
|
5407
|
-
sortedAnswerMap[answerMapKey] = answerMap2[answerMapKey];
|
|
5408
|
-
}
|
|
5409
|
-
return sortedAnswerMap;
|
|
5328
|
+
return answer.data[foundIndex].answerMap;
|
|
5410
5329
|
};
|
|
5411
5330
|
const retrieveFilteredMaterialList = (answerMap2) => {
|
|
5412
5331
|
const selectedValueList = [];
|
|
@@ -5434,71 +5353,73 @@ var MatchingActivityMaterialContent = ({
|
|
|
5434
5353
|
const answerMap = retrieveAnswerMap();
|
|
5435
5354
|
const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
|
|
5436
5355
|
return /* @__PURE__ */ jsxs21(Fragment4, { children: [
|
|
5437
|
-
/* @__PURE__ */
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
onMouseUp: () => {
|
|
5457
|
-
if (checkCanAnswerQuestion()) {
|
|
5458
|
-
setSelectedValue(null);
|
|
5459
|
-
}
|
|
5460
|
-
},
|
|
5461
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33(
|
|
5462
|
-
"div",
|
|
5463
|
-
{
|
|
5464
|
-
className: `flex flex-col items-center justify-center m-4 min-h-[64px] min-w-[200px]`,
|
|
5465
|
-
children: /* @__PURE__ */ jsx33("p", { className: "text-xl p-5 whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
5466
|
-
materialValue
|
|
5467
|
-
).map((inputPart, index2) => /* @__PURE__ */ jsx33(
|
|
5468
|
-
"span",
|
|
5469
|
-
{
|
|
5470
|
-
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5471
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx33("span", { className: "text-2xl", children: /* @__PURE__ */ jsx33(InlineMath5, { math: inputPart.value }) }) : inputPart.value
|
|
5472
|
-
},
|
|
5473
|
-
index2
|
|
5474
|
-
)) })
|
|
5475
|
-
}
|
|
5476
|
-
) : /* @__PURE__ */ jsx33(
|
|
5477
|
-
ShowMaterialMediaByContentType_default,
|
|
5478
|
-
{
|
|
5479
|
-
contentType: contentMap.type,
|
|
5480
|
-
src: materialValue,
|
|
5481
|
-
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
|
+
}
|
|
5482
5375
|
},
|
|
5483
|
-
|
|
5484
|
-
|
|
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
|
+
);
|
|
5485
5414
|
}
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
}
|
|
5495
|
-
},
|
|
5496
|
-
index
|
|
5497
|
-
))
|
|
5498
|
-
}
|
|
5499
|
-
),
|
|
5500
|
-
filteredMaterialList.length > 0 ? /* @__PURE__ */ jsx33(DividerLine_default, {}) : null,
|
|
5501
|
-
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) => {
|
|
5502
5423
|
const learnerAnswerState = checkAnswerState(
|
|
5503
5424
|
materialMap[answerMapKey],
|
|
5504
5425
|
answerMap[answerMapKey]
|
|
@@ -5507,30 +5428,24 @@ var MatchingActivityMaterialContent = ({
|
|
|
5507
5428
|
/* @__PURE__ */ jsx33("div", { className: "w-1/3", children: /* @__PURE__ */ jsx33(
|
|
5508
5429
|
"div",
|
|
5509
5430
|
{
|
|
5510
|
-
className:
|
|
5511
|
-
children: /* @__PURE__ */ jsx33(
|
|
5512
|
-
|
|
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",
|
|
5513
5436
|
{
|
|
5514
|
-
className:
|
|
5515
|
-
children: /* @__PURE__ */ jsx33("
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5520
|
-
children: inputPart.isEquation ? /* @__PURE__ */ jsx33("span", { className: "text-2xl", children: /* @__PURE__ */ jsx33(InlineMath5, { math: inputPart.value }) }) : inputPart.value
|
|
5521
|
-
},
|
|
5522
|
-
index2
|
|
5523
|
-
)
|
|
5524
|
-
) })
|
|
5525
|
-
}
|
|
5526
|
-
)
|
|
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
|
+
)) }) })
|
|
5527
5442
|
}
|
|
5528
5443
|
) }),
|
|
5529
5444
|
/* @__PURE__ */ jsx33("div", { className: "mx-4 w-[2px] bg-catchup-lighter-gray" }),
|
|
5530
5445
|
/* @__PURE__ */ jsx33("div", { className: "flex-1", children: /* @__PURE__ */ jsx33(
|
|
5531
5446
|
"div",
|
|
5532
5447
|
{
|
|
5533
|
-
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"}`,
|
|
5534
5449
|
onClick: () => {
|
|
5535
5450
|
if (checkCanAnswerQuestion()) {
|
|
5536
5451
|
setSelectedValue(null);
|
|
@@ -5547,7 +5462,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5547
5462
|
component: /* @__PURE__ */ jsx33(
|
|
5548
5463
|
"div",
|
|
5549
5464
|
{
|
|
5550
|
-
className:
|
|
5465
|
+
className: "h-full flex-1 flex flex-row items-center justify-center",
|
|
5551
5466
|
onClick: (e) => {
|
|
5552
5467
|
e.preventDefault();
|
|
5553
5468
|
if (checkCanAnswerQuestion()) {
|
|
@@ -5557,13 +5472,13 @@ var MatchingActivityMaterialContent = ({
|
|
|
5557
5472
|
);
|
|
5558
5473
|
}
|
|
5559
5474
|
},
|
|
5560
|
-
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(
|
|
5561
5476
|
answerMap[answerMapKey]
|
|
5562
5477
|
).map((inputPart, index2) => /* @__PURE__ */ jsx33(
|
|
5563
5478
|
"span",
|
|
5564
5479
|
{
|
|
5565
5480
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5566
|
-
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
|
|
5567
5482
|
},
|
|
5568
5483
|
index2
|
|
5569
5484
|
)) }) : /* @__PURE__ */ jsx33(
|
|
@@ -5583,7 +5498,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5583
5498
|
}
|
|
5584
5499
|
) })
|
|
5585
5500
|
] }, index);
|
|
5586
|
-
})
|
|
5501
|
+
}) })
|
|
5587
5502
|
] });
|
|
5588
5503
|
};
|
|
5589
5504
|
var MatchingActivityMaterialContent_default = MatchingActivityMaterialContent;
|
|
@@ -5596,13 +5511,13 @@ var MatchingActivityContent = ({
|
|
|
5596
5511
|
canAnswerQuestion,
|
|
5597
5512
|
changeAnswer,
|
|
5598
5513
|
isPreview,
|
|
5599
|
-
showCorrectAnswer
|
|
5600
|
-
isFullScreen
|
|
5514
|
+
showCorrectAnswer
|
|
5601
5515
|
}) => {
|
|
5602
5516
|
const contentMap = parseContentMapFromData(data);
|
|
5603
5517
|
const matchingBodyMap = parseBodyMapFromData(data, "MATCHING");
|
|
5604
5518
|
const matchingMaterialMap = parseMaterialMapFromData(data, "MATCHING");
|
|
5605
5519
|
const handleMatchingAnswerOnChange = (answer2, key, value) => {
|
|
5520
|
+
if (isPreview) return;
|
|
5606
5521
|
let foundIndex = answer2.data.findIndex(
|
|
5607
5522
|
(answerData) => answerData.type === "MATCHING"
|
|
5608
5523
|
);
|
|
@@ -5636,7 +5551,7 @@ var MatchingActivityContent = ({
|
|
|
5636
5551
|
};
|
|
5637
5552
|
var MatchingActivityContent_default = MatchingActivityContent;
|
|
5638
5553
|
|
|
5639
|
-
// src/components/activities/material-
|
|
5554
|
+
// src/components/activities/material-contents/MCMAActivityMaterialContent.tsx
|
|
5640
5555
|
import { InlineMath as InlineMath6 } from "react-katex";
|
|
5641
5556
|
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5642
5557
|
var MCMAActivityMaterialContent = ({
|
|
@@ -5711,7 +5626,7 @@ var MCMAActivityMaterialContent = ({
|
|
|
5711
5626
|
"span",
|
|
5712
5627
|
{
|
|
5713
5628
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5714
|
-
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
|
|
5715
5630
|
},
|
|
5716
5631
|
index3
|
|
5717
5632
|
)) }) : /* @__PURE__ */ jsx35(
|
|
@@ -5734,7 +5649,7 @@ var MCMAActivityMaterialContent = ({
|
|
|
5734
5649
|
"span",
|
|
5735
5650
|
{
|
|
5736
5651
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5737
|
-
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
|
|
5738
5653
|
},
|
|
5739
5654
|
index2
|
|
5740
5655
|
)) }, materialKey)
|
|
@@ -5757,6 +5672,7 @@ var MCMAActivityContent = ({
|
|
|
5757
5672
|
const MCMABodyMap = parseBodyMapFromData(data, "MCMA");
|
|
5758
5673
|
const MCMAMaterialMap = parseMaterialMapFromData(data, "MCMA");
|
|
5759
5674
|
const handleMCMAAnswerOnChange = (answer2, key, value) => {
|
|
5675
|
+
if (isPreview) return;
|
|
5760
5676
|
let foundIndex = answer2.data.findIndex(
|
|
5761
5677
|
(answerData) => answerData.type === "MCMA"
|
|
5762
5678
|
);
|
|
@@ -5791,7 +5707,7 @@ var MCMAActivityContent = ({
|
|
|
5791
5707
|
};
|
|
5792
5708
|
var MCMAActivityContent_default = MCMAActivityContent;
|
|
5793
5709
|
|
|
5794
|
-
// src/components/activities/material-
|
|
5710
|
+
// src/components/activities/material-contents/MCSAActivityMaterialContent.tsx
|
|
5795
5711
|
import { InlineMath as InlineMath7 } from "react-katex";
|
|
5796
5712
|
import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5797
5713
|
var MCSAActivityMaterialContent = ({
|
|
@@ -5861,7 +5777,7 @@ var MCSAActivityMaterialContent = ({
|
|
|
5861
5777
|
"span",
|
|
5862
5778
|
{
|
|
5863
5779
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5864
|
-
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
|
|
5865
5781
|
},
|
|
5866
5782
|
index3
|
|
5867
5783
|
)) }) : /* @__PURE__ */ jsx37(
|
|
@@ -5886,7 +5802,7 @@ var MCSAActivityMaterialContent = ({
|
|
|
5886
5802
|
"span",
|
|
5887
5803
|
{
|
|
5888
5804
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
5889
|
-
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
|
|
5890
5806
|
},
|
|
5891
5807
|
index2
|
|
5892
5808
|
)) })
|
|
@@ -5909,6 +5825,7 @@ var MCSAActivityContent = ({
|
|
|
5909
5825
|
const MCSABodyMap = parseBodyMapFromData(data, "MCSA");
|
|
5910
5826
|
const MCSAMaterialMap = parseMaterialMapFromData(data, "MCSA");
|
|
5911
5827
|
const handleMCSAAnswerOnChange = (answer2, key, value) => {
|
|
5828
|
+
if (isPreview) return;
|
|
5912
5829
|
let foundIndex = answer2.data.findIndex(
|
|
5913
5830
|
(answerData) => answerData.type === "MCSA"
|
|
5914
5831
|
);
|
|
@@ -5964,7 +5881,7 @@ var retrieveDocumentTypeFromExtension = (format) => {
|
|
|
5964
5881
|
return "";
|
|
5965
5882
|
};
|
|
5966
5883
|
|
|
5967
|
-
// src/components/activities/material-
|
|
5884
|
+
// src/components/activities/material-contents/OpenEndedActivityMaterialContent.tsx
|
|
5968
5885
|
import { Fragment as Fragment6, jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5969
5886
|
var OpenEndedActivityMaterialContent = ({
|
|
5970
5887
|
answer,
|
|
@@ -6077,11 +5994,13 @@ var OpenEndedActivityContent = ({
|
|
|
6077
5994
|
changeAnswer,
|
|
6078
5995
|
canAnswerQuestion,
|
|
6079
5996
|
showMaterialContent,
|
|
5997
|
+
isPreview,
|
|
6080
5998
|
isFullScreen
|
|
6081
5999
|
}) => {
|
|
6082
6000
|
const contentMap = parseContentMapFromData(data);
|
|
6083
6001
|
const openEndedBodyMap = parseBodyMapFromData(data, "OPEN_ENDED");
|
|
6084
6002
|
const handleOpenEndedAnswerOnChange = (answer2, value) => {
|
|
6003
|
+
if (isPreview) return;
|
|
6085
6004
|
let foundIndex = answer2.data.findIndex(
|
|
6086
6005
|
(answerData) => answerData.type === "OPEN_ENDED"
|
|
6087
6006
|
);
|
|
@@ -6126,11 +6045,46 @@ var OpenEndedActivityContent = ({
|
|
|
6126
6045
|
};
|
|
6127
6046
|
var OpenEndedActivityContent_default = OpenEndedActivityContent;
|
|
6128
6047
|
|
|
6129
|
-
// src/components/activities/material-
|
|
6048
|
+
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6130
6049
|
import { useEffect as useEffect12, useState as useState22 } from "react";
|
|
6131
6050
|
import { useDrop as useDrop6 } from "react-dnd";
|
|
6132
6051
|
import { InlineMath as InlineMath8 } from "react-katex";
|
|
6133
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
|
+
|
|
6134
6088
|
// src/components/dnds/DraggableDroppableItem.tsx
|
|
6135
6089
|
import { useRef as useRef6 } from "react";
|
|
6136
6090
|
import { useDrag as useDrag2, useDrop as useDrop5 } from "react-dnd";
|
|
@@ -6182,7 +6136,7 @@ var DraggableDroppableItem = ({
|
|
|
6182
6136
|
};
|
|
6183
6137
|
var DraggableDroppableItem_default = DraggableDroppableItem;
|
|
6184
6138
|
|
|
6185
|
-
// src/components/activities/material-
|
|
6139
|
+
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6186
6140
|
import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6187
6141
|
var OrderingActivityMaterialContent = ({
|
|
6188
6142
|
uniqueValue,
|
|
@@ -6273,19 +6227,13 @@ var OrderingActivityMaterialContent = ({
|
|
|
6273
6227
|
marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
|
|
6274
6228
|
},
|
|
6275
6229
|
children: [
|
|
6276
|
-
/* @__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(
|
|
6277
6231
|
"div",
|
|
6278
6232
|
{
|
|
6279
|
-
className:
|
|
6280
|
-
children: /* @__PURE__ */ jsx42(
|
|
6281
|
-
"div",
|
|
6282
|
-
{
|
|
6283
|
-
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]`,
|
|
6284
|
-
children: /* @__PURE__ */ jsx42("p", { className: "", children: parseFloat(materialKey) + 1 })
|
|
6285
|
-
}
|
|
6286
|
-
)
|
|
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 })
|
|
6287
6235
|
}
|
|
6288
|
-
) }),
|
|
6236
|
+
) }) }),
|
|
6289
6237
|
/* @__PURE__ */ jsx42(
|
|
6290
6238
|
DraggableDroppableItem_default,
|
|
6291
6239
|
{
|
|
@@ -6295,7 +6243,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6295
6243
|
component: /* @__PURE__ */ jsx42(
|
|
6296
6244
|
"div",
|
|
6297
6245
|
{
|
|
6298
|
-
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"}`,
|
|
6299
6247
|
onMouseDown: () => {
|
|
6300
6248
|
if (checkCanAnswerQuestion()) {
|
|
6301
6249
|
setSelectedKey(materialKey);
|
|
@@ -6307,7 +6255,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6307
6255
|
"span",
|
|
6308
6256
|
{
|
|
6309
6257
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6310
|
-
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
|
|
6311
6259
|
},
|
|
6312
6260
|
index2
|
|
6313
6261
|
)) }) : /* @__PURE__ */ jsx42(
|
|
@@ -6356,6 +6304,7 @@ var OrderingActivityContent = ({
|
|
|
6356
6304
|
const orderingBodyMap = parseBodyMapFromData(data, "ORDERING");
|
|
6357
6305
|
const orderingMaterialMap = parseMaterialMapFromData(data, "ORDERING");
|
|
6358
6306
|
const handleOrderingAnswerOnChange = (answer2, primaryKey, secondaryKey) => {
|
|
6307
|
+
if (isPreview) return;
|
|
6359
6308
|
let foundIndex = answer2.data.findIndex(
|
|
6360
6309
|
(answerData) => answerData.type === "ORDERING"
|
|
6361
6310
|
);
|
|
@@ -6391,7 +6340,7 @@ var OrderingActivityContent = ({
|
|
|
6391
6340
|
};
|
|
6392
6341
|
var OrderingActivityContent_default = OrderingActivityContent;
|
|
6393
6342
|
|
|
6394
|
-
// src/components/activities/material-
|
|
6343
|
+
// src/components/activities/material-contents/TrueFalseActivityMaterialContent.tsx
|
|
6395
6344
|
import { useEffect as useEffect13, useState as useState23 } from "react";
|
|
6396
6345
|
import { InlineMath as InlineMath9 } from "react-katex";
|
|
6397
6346
|
import { Fragment as Fragment9, jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
@@ -6476,7 +6425,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6476
6425
|
"span",
|
|
6477
6426
|
{
|
|
6478
6427
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6479
|
-
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
|
|
6480
6429
|
},
|
|
6481
6430
|
index2
|
|
6482
6431
|
)) }) : /* @__PURE__ */ jsx44(
|
|
@@ -6551,6 +6500,7 @@ var TrueFalseActivityContent = ({
|
|
|
6551
6500
|
return answer.data[foundIndex].answerMap;
|
|
6552
6501
|
};
|
|
6553
6502
|
const handleTrueFalseAnswerOnChange = (answer2, key, value) => {
|
|
6503
|
+
if (isPreview) return;
|
|
6554
6504
|
const answerMap = retrieveCurrentAnswerMap();
|
|
6555
6505
|
if (key === "TRUE") {
|
|
6556
6506
|
const foundFalseIndex = answerMap.falseList.findIndex(
|
|
@@ -6608,7 +6558,7 @@ var TrueFalseActivityContent = ({
|
|
|
6608
6558
|
};
|
|
6609
6559
|
var TrueFalseActivityContent_default = TrueFalseActivityContent;
|
|
6610
6560
|
|
|
6611
|
-
// src/components/activities/solution-
|
|
6561
|
+
// src/components/activities/solution-contents/ActivitySolutionContent.tsx
|
|
6612
6562
|
import { InlineMath as InlineMath10 } from "react-katex";
|
|
6613
6563
|
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6614
6564
|
var ActivitySolutionContent = ({
|
|
@@ -6656,7 +6606,7 @@ var ActivitySolutionContent = ({
|
|
|
6656
6606
|
"span",
|
|
6657
6607
|
{
|
|
6658
6608
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6659
|
-
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
|
|
6660
6610
|
},
|
|
6661
6611
|
`${key}_part_${partIndex}`
|
|
6662
6612
|
)
|
|
@@ -6666,7 +6616,7 @@ var ActivitySolutionContent = ({
|
|
|
6666
6616
|
};
|
|
6667
6617
|
var ActivitySolutionContent_default = ActivitySolutionContent;
|
|
6668
6618
|
|
|
6669
|
-
// src/components/activities/evaluation-rubric-
|
|
6619
|
+
// src/components/activities/evaluation-rubric-contents/ActivityEvaluationRubricContent.tsx
|
|
6670
6620
|
import { InlineMath as InlineMath11 } from "react-katex";
|
|
6671
6621
|
import { jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6672
6622
|
var ActivityEvaluationRubricContent = ({
|
|
@@ -6711,7 +6661,7 @@ var ActivityEvaluationRubricContent = ({
|
|
|
6711
6661
|
"span",
|
|
6712
6662
|
{
|
|
6713
6663
|
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6714
|
-
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
|
|
6715
6665
|
},
|
|
6716
6666
|
index2
|
|
6717
6667
|
)
|
|
@@ -6907,8 +6857,7 @@ var ActivityPreviewByData = ({
|
|
|
6907
6857
|
},
|
|
6908
6858
|
data,
|
|
6909
6859
|
isPreview: true,
|
|
6910
|
-
showCorrectAnswer: true
|
|
6911
|
-
isFullScreen
|
|
6860
|
+
showCorrectAnswer: true
|
|
6912
6861
|
}
|
|
6913
6862
|
) : selectedType === "GROUPING" && data["groupingBodyMap"] != null && data["groupingMaterialMap"] != null ? /* @__PURE__ */ jsx49(
|
|
6914
6863
|
GroupingActivityContent_default,
|
|
@@ -6921,8 +6870,7 @@ var ActivityPreviewByData = ({
|
|
|
6921
6870
|
},
|
|
6922
6871
|
data,
|
|
6923
6872
|
isPreview: true,
|
|
6924
|
-
showCorrectAnswer: true
|
|
6925
|
-
isFullScreen
|
|
6873
|
+
showCorrectAnswer: true
|
|
6926
6874
|
}
|
|
6927
6875
|
) : selectedType === "FILL_IN_THE_BLANKS" && data["fillInTheBlanksBodyMap"] != null && data["fillInTheBlanksMaterialMap"] != null ? /* @__PURE__ */ jsx49(
|
|
6928
6876
|
FillInTheBlanksActivityContent_default,
|
|
@@ -6947,6 +6895,7 @@ var ActivityPreviewByData = ({
|
|
|
6947
6895
|
},
|
|
6948
6896
|
showMaterialContent: true,
|
|
6949
6897
|
data,
|
|
6898
|
+
isPreview: true,
|
|
6950
6899
|
isFullScreen
|
|
6951
6900
|
}
|
|
6952
6901
|
) : selectedType === "TRUE_FALSE" && data["trueFalseBodyMap"] != null && data["trueFalseMaterialMap"] != null ? /* @__PURE__ */ jsx49(
|