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.
Files changed (35) hide show
  1. package/dist/index.d.mts +4 -5
  2. package/dist/index.d.ts +4 -5
  3. package/dist/index.js +280 -331
  4. package/dist/index.mjs +278 -329
  5. package/package.json +1 -1
  6. package/src/components/activities/ActivityPreviewByAnswerData.tsx +3 -3
  7. package/src/components/activities/ActivityPreviewByData.tsx +3 -4
  8. package/src/components/activities/DropdownActivityContent.tsx +3 -9
  9. package/src/components/activities/FillInTheBlanksActivityContent.tsx +4 -10
  10. package/src/components/activities/GroupingActivityContent.tsx +3 -3
  11. package/src/components/activities/MCMAActivityContent.tsx +3 -2
  12. package/src/components/activities/MCSAActivityContent.tsx +3 -2
  13. package/src/components/activities/MatchingActivityContent.tsx +3 -3
  14. package/src/components/activities/OpenEndedActivityContent.tsx +4 -2
  15. package/src/components/activities/OrderingActivityContent.tsx +3 -2
  16. package/src/components/activities/TrueFalseActivityContent.tsx +3 -2
  17. package/src/components/activities/{body-content → body-contents}/ActivityBodyContent.tsx +6 -9
  18. package/src/components/activities/{body-content → body-contents}/ShowBodyMediaByContentType.tsx +1 -1
  19. package/src/components/activities/{evaluation-rubric-content → evaluation-rubric-contents}/ActivityEvaluationRubricContent.tsx +1 -1
  20. package/src/components/activities/{material-content → material-contents}/DropdownActivityMaterialContent.tsx +3 -3
  21. package/src/components/activities/{material-content → material-contents}/FillInTheBlanksActivityMaterialContent.tsx +2 -2
  22. package/src/components/activities/material-contents/GroupingActivityMaterialContent.tsx +354 -0
  23. package/src/components/activities/{material-content → material-contents}/MCMAActivityMaterialContent.tsx +2 -2
  24. package/src/components/activities/{material-content → material-contents}/MCSAActivityMaterialContent.tsx +2 -2
  25. package/src/components/activities/material-contents/MatchingActivityMaterialContent.tsx +342 -0
  26. package/src/components/activities/{material-content → material-contents}/OrderingActivityMaterialContent.tsx +7 -5
  27. package/src/components/activities/{material-content → material-contents}/ShowMaterialMediaByContentType.tsx +4 -4
  28. package/src/components/activities/{material-content → material-contents}/TrueFalseActivityMaterialContent.tsx +1 -1
  29. package/src/components/activities/{solution-content → solution-contents}/ActivitySolutionContent.tsx +1 -1
  30. package/src/index.ts +4 -4
  31. package/src/properties/ActivityProperties.ts +1 -2
  32. package/src/components/activities/material-content/GroupingActivityMaterialContent.tsx +0 -359
  33. package/src/components/activities/material-content/MatchingActivityMaterialContent.tsx +0 -332
  34. /package/src/components/activities/{empty-content → empty-contents}/ActivityEmptyContent.tsx +0 -0
  35. /package/src/components/activities/{material-content → material-contents}/OpenEndedActivityMaterialContent.tsx +0 -0
package/dist/index.js CHANGED
@@ -1273,14 +1273,14 @@ var BasePDF = ({ file }) => {
1273
1273
  };
1274
1274
  var BasePDF_default = BasePDF;
1275
1275
 
1276
- // src/components/activities/empty-content/ActivityEmptyContent.tsx
1276
+ // src/components/activities/empty-contents/ActivityEmptyContent.tsx
1277
1277
  var import_jsx_runtime17 = require("react/jsx-runtime");
1278
1278
  var ActivityEmptyContent = () => {
1279
1279
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("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__ */ (0, import_jsx_runtime17.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-catchup-white text-xl", children: i18n_default.t("you_have_set_this_activity_as_empty") }) }) });
1280
1280
  };
1281
1281
  var ActivityEmptyContent_default = ActivityEmptyContent;
1282
1282
 
1283
- // src/components/activities/body-content/ShowBodyMediaByContentType.tsx
1283
+ // src/components/activities/body-contents/ShowBodyMediaByContentType.tsx
1284
1284
  var import_react11 = require("react");
1285
1285
  var import_react_modal2 = __toESM(require("react-modal"));
1286
1286
 
@@ -3363,7 +3363,7 @@ var retrieveOpticalExamPartTypeOptionList = () => {
3363
3363
  ];
3364
3364
  };
3365
3365
 
3366
- // src/components/activities/body-content/ShowBodyMediaByContentType.tsx
3366
+ // src/components/activities/body-contents/ShowBodyMediaByContentType.tsx
3367
3367
  var import_react_katex = require("react-katex");
3368
3368
  var import_jsx_runtime18 = require("react/jsx-runtime");
3369
3369
  var ShowBodyMediaByContentType = ({
@@ -3391,7 +3391,7 @@ var ShowBodyMediaByContentType = ({
3391
3391
  "span",
3392
3392
  {
3393
3393
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
3394
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_katex.InlineMath, { math: inputPart.value }) }) : inputPart.value
3394
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_katex.InlineMath, { math: inputPart.value }) }) : inputPart.value
3395
3395
  },
3396
3396
  inputPartIndex
3397
3397
  );
@@ -3736,7 +3736,7 @@ var ShowBodyMediaByContentType = ({
3736
3736
  };
3737
3737
  var ShowBodyMediaByContentType_default = ShowBodyMediaByContentType;
3738
3738
 
3739
- // src/components/activities/body-content/ActivityBodyContent.tsx
3739
+ // src/components/activities/body-contents/ActivityBodyContent.tsx
3740
3740
  var import_jsx_runtime19 = require("react/jsx-runtime");
3741
3741
  var ActivityBodyContent = ({
3742
3742
  templateType,
@@ -3754,40 +3754,38 @@ var ActivityBodyContent = ({
3754
3754
  if (isEmpty) {
3755
3755
  processedValue = processedValue.replace(
3756
3756
  "@@",
3757
- `----(${currentQQIndex + 1})----`
3757
+ () => `----(${currentQQIndex + 1})----`
3758
3758
  );
3759
3759
  } else {
3760
3760
  const trimmedAnswer = typeof answer === "string" ? answer.trim() : String(answer);
3761
- console.log("trimmed answer: ", trimmedAnswer);
3762
3761
  switch (contentType) {
3763
3762
  case "TEXT":
3764
3763
  processedValue = processedValue.replace(
3765
3764
  "@@",
3766
- `--TEXT--${trimmedAnswer}--TEXT--`
3765
+ () => `--TEXT--${trimmedAnswer}--TEXT--`
3767
3766
  );
3768
3767
  break;
3769
3768
  case "IMAGE":
3770
3769
  processedValue = processedValue.replace(
3771
3770
  "@@",
3772
- `--IMAGE--${trimmedAnswer}--IMAGE--`
3771
+ () => `--IMAGE--${trimmedAnswer}--IMAGE--`
3773
3772
  );
3774
3773
  break;
3775
3774
  case "VIDEO":
3776
3775
  processedValue = processedValue.replace(
3777
3776
  "@@",
3778
- `--VIDEO--${trimmedAnswer}--VIDEO--`
3777
+ () => `--VIDEO--${trimmedAnswer}--VIDEO--`
3779
3778
  );
3780
3779
  break;
3781
3780
  case "AUDIO":
3782
3781
  processedValue = processedValue.replace(
3783
3782
  "@@",
3784
- `--AUDIO--${trimmedAnswer}--AUDIO--`
3783
+ () => `--AUDIO--${trimmedAnswer}--AUDIO--`
3785
3784
  );
3786
3785
  break;
3787
3786
  default:
3788
- processedValue = processedValue.replace("@@", trimmedAnswer);
3787
+ processedValue = processedValue.replace("@@", () => trimmedAnswer);
3789
3788
  }
3790
- console.log("processed value: ", processedValue);
3791
3789
  }
3792
3790
  currentQQIndex++;
3793
3791
  }
@@ -3847,7 +3845,7 @@ var VerticalDividerLine = () => {
3847
3845
  };
3848
3846
  var VerticalDividerLine_default = VerticalDividerLine;
3849
3847
 
3850
- // src/components/activities/material-content/DropdownActivityMaterialContent.tsx
3848
+ // src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
3851
3849
  var import_react_katex2 = require("react-katex");
3852
3850
 
3853
3851
  // src/components/groups/InputGroup.tsx
@@ -4278,7 +4276,7 @@ var InputGroup = ({
4278
4276
  };
4279
4277
  var InputGroup_default = InputGroup;
4280
4278
 
4281
- // src/components/activities/material-content/DropdownActivityMaterialContent.tsx
4279
+ // src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
4282
4280
  var import_react15 = require("react");
4283
4281
  var import_react16 = require("react");
4284
4282
 
@@ -4427,7 +4425,7 @@ var MediaDropdown = ({ id, answer, optionList }) => {
4427
4425
  };
4428
4426
  var MediaDropdown_default = MediaDropdown;
4429
4427
 
4430
- // src/components/activities/material-content/ShowMaterialMediaByContentType.tsx
4428
+ // src/components/activities/material-contents/ShowMaterialMediaByContentType.tsx
4431
4429
  var import_react14 = require("react");
4432
4430
  var import_react_modal3 = __toESM(require("react-modal"));
4433
4431
  var import_jsx_runtime24 = require("react/jsx-runtime");
@@ -4520,7 +4518,7 @@ var ShowMaterialMediaByContentType = ({
4520
4518
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "my-2", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full flex flex-row flex-wrap items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
4521
4519
  "div",
4522
4520
  {
4523
- className: `${isFullHeight ? "h-catchup-activity-box-item" : "max-w-catchup-activity-box-item"} flex flex-col justify-center items-center relative`,
4521
+ className: `${isFullHeight ? "h-catchup-activity-media-box-item" : "max-w-catchup-activity-media-box-item"} flex flex-col justify-center items-center relative`,
4524
4522
  children: [
4525
4523
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4526
4524
  BaseImage_default,
@@ -4564,7 +4562,7 @@ var ShowMaterialMediaByContentType = ({
4564
4562
  ] }, key) : contentType === "VIDEO" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "my-2", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full flex flex-row flex-wrap items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full flex flex-col justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4565
4563
  "video",
4566
4564
  {
4567
- className: "h-catchup-activity-box-item rounded-catchup-xlarge",
4565
+ className: "h-catchup-activity-media-box-item rounded-catchup-xlarge",
4568
4566
  src,
4569
4567
  controls: true,
4570
4568
  onClick: () => {
@@ -4573,7 +4571,7 @@ var ShowMaterialMediaByContentType = ({
4573
4571
  ) }) }) }) : contentType === "AUDIO" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "my-2", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full flex flex-row flex-wrap items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "h-full flex flex-col justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
4574
4572
  "audio",
4575
4573
  {
4576
- className: "h-catchup-activity-box-item rounded-catchup-xlarge",
4574
+ className: "h-catchup-activity-media-box-item rounded-catchup-xlarge",
4577
4575
  src,
4578
4576
  controls: true,
4579
4577
  onClick: () => {
@@ -4583,7 +4581,7 @@ var ShowMaterialMediaByContentType = ({
4583
4581
  };
4584
4582
  var ShowMaterialMediaByContentType_default = ShowMaterialMediaByContentType;
4585
4583
 
4586
- // src/components/activities/material-content/DropdownActivityMaterialContent.tsx
4584
+ // src/components/activities/material-contents/DropdownActivityMaterialContent.tsx
4587
4585
  var import_jsx_runtime25 = require("react/jsx-runtime");
4588
4586
  var DropdownActivityMaterialContent = ({
4589
4587
  uniqueValue,
@@ -4656,7 +4654,7 @@ var DropdownActivityMaterialContent = ({
4656
4654
  "span",
4657
4655
  {
4658
4656
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
4659
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4657
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4660
4658
  import_react_katex2.InlineMath,
4661
4659
  {
4662
4660
  math: inputPart.value
@@ -4675,7 +4673,7 @@ var DropdownActivityMaterialContent = ({
4675
4673
  MediaDropdown_default,
4676
4674
  {
4677
4675
  id: materialKey,
4678
- answer: answerMap[materialKey] === "DEFAULT_OPTION" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "w-catchup-activity-box-item border h-catchup-activity-box-item rounded-catchup-xlarge border-dashed border-catchup-blue", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "italic", children: i18n_default.t("please_select") }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4676
+ answer: answerMap[materialKey] === "DEFAULT_OPTION" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("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__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "italic", children: i18n_default.t("please_select") }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4679
4677
  ShowMaterialMediaByContentType_default,
4680
4678
  {
4681
4679
  contentType: contentMap.type,
@@ -4712,7 +4710,7 @@ var DropdownActivityMaterialContent = ({
4712
4710
  "span",
4713
4711
  {
4714
4712
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
4715
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_katex2.InlineMath, { math: inputPart.value }) }) : inputPart.value
4713
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react_katex2.InlineMath, { math: inputPart.value }) }) : inputPart.value
4716
4714
  },
4717
4715
  index2
4718
4716
  )) }) }),
@@ -4766,6 +4764,7 @@ var DropdownActivityContent = ({
4766
4764
  setCurrentAnswerMap(retrieveCurrentAnswerMap());
4767
4765
  }, [answer]);
4768
4766
  const handleDropdownAnswerOnChange = (answerObj, key, value) => {
4767
+ if (isPreview) return;
4769
4768
  const newAnswer = __spreadProps(__spreadValues({}, answerObj), {
4770
4769
  data: answerObj.data.map((item) => {
4771
4770
  if (item.type === "DROPDOWN") {
@@ -4811,7 +4810,7 @@ var DropdownActivityContent = ({
4811
4810
  };
4812
4811
  var DropdownActivityContent_default = DropdownActivityContent;
4813
4812
 
4814
- // src/components/activities/material-content/FillInTheBlanksActivityMaterialContent.tsx
4813
+ // src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
4815
4814
  var import_react_katex3 = require("react-katex");
4816
4815
  var import_react19 = require("react");
4817
4816
  var import_react20 = require("react");
@@ -4876,7 +4875,7 @@ var DroppableItem = ({
4876
4875
  };
4877
4876
  var DroppableItem_default = DroppableItem;
4878
4877
 
4879
- // src/components/activities/material-content/FillInTheBlanksActivityMaterialContent.tsx
4878
+ // src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
4880
4879
  var import_jsx_runtime29 = require("react/jsx-runtime");
4881
4880
  var FillInTheBlanksActivityMaterialContent = ({
4882
4881
  uniqueValue,
@@ -5042,7 +5041,7 @@ var FillInTheBlanksActivityMaterialContent = ({
5042
5041
  ] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5043
5042
  "div",
5044
5043
  {
5045
- className: `w-catchup-activity-box-item border h-catchup-activity-box-item rounded-catchup-xlarge border-dashed ${learnerAnswerState === "CORRECT" ? "border-catchup-green" : learnerAnswerState === "INCORRECT" ? "border-catchup-red" : "border-catchup-blue"}`,
5044
+ 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"}`,
5046
5045
  children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "italic", children: i18n_default.t("please_drop_here") }) })
5047
5046
  }
5048
5047
  ) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
@@ -5068,7 +5067,7 @@ var FillInTheBlanksActivityMaterialContent = ({
5068
5067
  "span",
5069
5068
  {
5070
5069
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5071
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_katex3.InlineMath, { math: inputPart.value }) }) : inputPart.value
5070
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_katex3.InlineMath, { math: inputPart.value }) }) : inputPart.value
5072
5071
  },
5073
5072
  index2
5074
5073
  )) }, materialKey) })
@@ -5134,6 +5133,7 @@ var FillInTheBlanksActivityContent = ({
5134
5133
  return optionList;
5135
5134
  };
5136
5135
  const handleFillInTheBlanksAnswerOnChange = (answerObj, key, value) => {
5136
+ if (isPreview) return;
5137
5137
  const newAnswer = __spreadProps(__spreadValues({}, answerObj), {
5138
5138
  data: answerObj.data.map((item) => {
5139
5139
  if (item.type === "FILL_IN_THE_BLANKS") {
@@ -5180,47 +5180,10 @@ var FillInTheBlanksActivityContent = ({
5180
5180
  };
5181
5181
  var FillInTheBlanksActivityContent_default = FillInTheBlanksActivityContent;
5182
5182
 
5183
- // src/components/activities/material-content/GroupingActivityMaterialContent.tsx
5184
- var import_react23 = require("react");
5183
+ // src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
5184
+ var import_react22 = require("react");
5185
5185
  var import_react_dnd4 = require("react-dnd");
5186
5186
  var import_react_katex4 = require("react-katex");
5187
-
5188
- // src/hooks/useScreenSize.ts
5189
- var import_react22 = require("react");
5190
- var useScreenSize = () => {
5191
- const [containerSize, setContainerSize] = (0, import_react22.useState)({
5192
- width: 0,
5193
- height: 0
5194
- });
5195
- const [screenSize, setScreenSize] = (0, import_react22.useState)({
5196
- width: window.innerWidth,
5197
- height: window.innerHeight
5198
- });
5199
- (0, import_react22.useEffect)(() => {
5200
- const handleResize = () => {
5201
- setScreenSize({
5202
- width: window.innerWidth,
5203
- height: window.innerHeight
5204
- });
5205
- const container = document.getElementById("container");
5206
- if (!container) return;
5207
- const boundingClientRect = container.getBoundingClientRect();
5208
- setContainerSize({
5209
- width: boundingClientRect.width,
5210
- height: boundingClientRect.height
5211
- });
5212
- };
5213
- handleResize();
5214
- window.addEventListener("resize", handleResize);
5215
- return () => {
5216
- window.removeEventListener("resize", handleResize);
5217
- };
5218
- }, []);
5219
- return { screenSize, containerSize };
5220
- };
5221
- var useScreenSize_default = useScreenSize;
5222
-
5223
- // src/components/activities/material-content/GroupingActivityMaterialContent.tsx
5224
5187
  var import_jsx_runtime31 = require("react/jsx-runtime");
5225
5188
  var GroupingActivityMaterialContent = ({
5226
5189
  uniqueValue,
@@ -5232,11 +5195,10 @@ var GroupingActivityMaterialContent = ({
5232
5195
  isPreview,
5233
5196
  showCorrectAnswer
5234
5197
  }) => {
5235
- const [selectedValue, setSelectedValue] = (0, import_react23.useState)(null);
5236
- const [selectedTargetKey, setSelectedTargetKey] = (0, import_react23.useState)(null);
5237
- const [isShuffled, setIsShuffled] = (0, import_react23.useState)(false);
5238
- const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react23.useState)([]);
5239
- const { screenSize, containerSize } = useScreenSize_default();
5198
+ const [selectedValue, setSelectedValue] = (0, import_react22.useState)(null);
5199
+ const [selectedTargetKey, setSelectedTargetKey] = (0, import_react22.useState)(null);
5200
+ const [isShuffled, setIsShuffled] = (0, import_react22.useState)(false);
5201
+ const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react22.useState)([]);
5240
5202
  const [{ isOver, canDrop }, drop] = (0, import_react_dnd4.useDrop)({
5241
5203
  accept: "GROUPING",
5242
5204
  drop: () => {
@@ -5246,16 +5208,8 @@ var GroupingActivityMaterialContent = ({
5246
5208
  canDrop: monitor.canDrop()
5247
5209
  })
5248
5210
  });
5249
- const ref = (0, import_react23.useRef)(null);
5250
- const itemsRef = (0, import_react23.useRef)(null);
5251
- const [maxWidth, setMaxWidth] = (0, import_react23.useState)(0);
5252
- (0, import_react23.useEffect)(() => {
5253
- if (!ref) return;
5254
- if (!ref.current) return;
5255
- if (!screenSize) return;
5256
- setMaxWidth(ref.current.offsetWidth - 12);
5257
- }, [ref, screenSize]);
5258
- (0, import_react23.useEffect)(() => {
5211
+ const ref = (0, import_react22.useRef)(null);
5212
+ (0, import_react22.useEffect)(() => {
5259
5213
  const shuffleArray2 = (array) => {
5260
5214
  if (!isShuffled) {
5261
5215
  const copyArray = JSON.parse(JSON.stringify(array));
@@ -5276,7 +5230,7 @@ var GroupingActivityMaterialContent = ({
5276
5230
  });
5277
5231
  setShuffledMaterialList(shuffleArray2(materialList));
5278
5232
  }, []);
5279
- (0, import_react23.useEffect)(() => {
5233
+ (0, import_react22.useEffect)(() => {
5280
5234
  if (!showCorrectAnswer) return;
5281
5235
  answer.data.find(
5282
5236
  (answerData) => answerData.type === "GROUPING"
@@ -5321,82 +5275,71 @@ var GroupingActivityMaterialContent = ({
5321
5275
  const answerMap = retrieveAnswerMap();
5322
5276
  const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
5323
5277
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
5324
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5325
- "div",
5326
- {
5327
- ref: itemsRef,
5328
- className: "flex-1 flex flex-row gap-x-4 gap-y-4 overflow-auto py-2",
5329
- children: filteredMaterialList.map((materialValue, index) => {
5330
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5331
- DraggableItem_default,
5332
- {
5333
- item: { index: materialValue },
5334
- type: "GROUPING",
5335
- component: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5336
- "div",
5337
- {
5338
- className: `${selectedValue === materialValue ? "border-catchup-blue" : "border-catchup-lighter-gray"} h-catchup-activity-covering-box-item flex flex-col items-center justify-center border-2 rounded-catchup-xlarge cursor-pointer transition-all duration-300`,
5339
- onMouseDown: () => {
5340
- if (checkCanAnswerQuestion()) {
5341
- setSelectedValue(materialValue);
5342
- }
5278
+ filteredMaterialList.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
5279
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex-1 flex flex-row gap-x-4 overflow-x-auto py-2", children: filteredMaterialList.map((materialValue, index) => {
5280
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5281
+ DraggableItem_default,
5282
+ {
5283
+ item: { index: materialValue },
5284
+ type: "GROUPING",
5285
+ component: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5286
+ "div",
5287
+ {
5288
+ 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`,
5289
+ onMouseDown: () => {
5290
+ if (checkCanAnswerQuestion()) {
5291
+ setSelectedValue(materialValue);
5292
+ }
5293
+ },
5294
+ onMouseUp: () => {
5295
+ if (checkCanAnswerQuestion()) {
5296
+ setSelectedValue(null);
5297
+ }
5298
+ },
5299
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5300
+ materialValue
5301
+ ).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5302
+ "span",
5303
+ {
5304
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5305
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_katex4.InlineMath, { math: inputPart.value }) }) : inputPart.value
5343
5306
  },
5344
- onMouseUp: () => {
5345
- if (checkCanAnswerQuestion()) {
5346
- setSelectedValue(null);
5347
- }
5307
+ index2
5308
+ )) }) }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5309
+ ShowMaterialMediaByContentType_default,
5310
+ {
5311
+ contentType: contentMap.type,
5312
+ src: materialValue,
5313
+ canFullScreen: true
5348
5314
  },
5349
- children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5350
- "div",
5351
- {
5352
- className: `flex flex-col items-center justify-center m-4 min-h-[64px] min-w-[200px]`,
5353
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5354
- materialValue
5355
- ).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5356
- "span",
5357
- {
5358
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5359
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_katex4.InlineMath, { math: inputPart.value }) }) : inputPart.value
5360
- },
5361
- index2
5362
- )) })
5363
- }
5364
- ) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5365
- ShowMaterialMediaByContentType_default,
5366
- {
5367
- contentType: contentMap.type,
5368
- src: materialValue,
5369
- canFullScreen: true
5370
- },
5371
- `${uniqueValue}-${index}`
5372
- )
5373
- }
5374
- ),
5375
- moveCardHandler: () => {
5376
- if (!selectedTargetKey) return;
5377
- if (!selectedValue) return;
5378
- handleGroupingActivityItemOnChange(
5379
- selectedTargetKey,
5380
- selectedValue
5381
- );
5315
+ `${uniqueValue}-${index}`
5316
+ )
5382
5317
  }
5383
- },
5384
- index
5385
- );
5386
- })
5387
- }
5388
- ),
5389
- filteredMaterialList.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DividerLine_default, {}) : null,
5390
- Object.keys(answerMap).map((answerMapKey, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-row w-full", children: [
5318
+ ),
5319
+ moveCardHandler: () => {
5320
+ if (!selectedTargetKey) return;
5321
+ if (!selectedValue) return;
5322
+ handleGroupingActivityItemOnChange(
5323
+ selectedTargetKey,
5324
+ selectedValue
5325
+ );
5326
+ }
5327
+ },
5328
+ index
5329
+ );
5330
+ }) }),
5331
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DividerLine_default, {})
5332
+ ] }) : null,
5333
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "overflow-y-auto max-h-[600px]", children: Object.keys(answerMap).map((answerMapKey, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-row w-full", children: [
5391
5334
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-1/3", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5392
5335
  "div",
5393
5336
  {
5394
- className: `border-catchup-blue h-catchup-activity-outer-box-item flex flex-col items-center justify-center border-2 rounded-catchup-xlarge transition-all duration-300 my-3`,
5337
+ 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`,
5395
5338
  children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5396
5339
  "div",
5397
5340
  {
5398
5341
  className: `flex flex-col items-center justify-center transition-all duration-300 m-4`,
5399
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-xl p-5 whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(answerMapKey).map(
5342
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(answerMapKey).map(
5400
5343
  (inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5401
5344
  "span",
5402
5345
  {
@@ -5411,7 +5354,7 @@ var GroupingActivityMaterialContent = ({
5411
5354
  }
5412
5355
  ) }),
5413
5356
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "mx-4 w-[2px] bg-catchup-lighter-gray" }),
5414
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex-1", ref, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-full py-3", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5357
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex-1 min-w-0", ref, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-full py-3", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5415
5358
  "div",
5416
5359
  {
5417
5360
  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`,
@@ -5423,20 +5366,17 @@ var GroupingActivityMaterialContent = ({
5423
5366
  target: selectedTargetKey,
5424
5367
  setTarget: setSelectedTargetKey,
5425
5368
  dropRef: drop,
5426
- component: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5427
- "div",
5428
- {
5429
- className: "h-full flex-1 flex flex-row items-center overflow-x-auto",
5430
- style: {
5431
- maxWidth
5432
- },
5433
- children: answerMap[answerMapKey].map(
5434
- (answerMapValue, answerMapIndex) => {
5435
- const learnerAnswerState = checkAnswerState(
5436
- materialMap[answerMapKey],
5437
- answerMapValue
5438
- );
5439
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "p-1", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-catchup-activity-box-item", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5369
+ component: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "h-full w-full overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-row items-center gap-2 w-max h-full", children: answerMap[answerMapKey].map(
5370
+ (answerMapValue, answerMapIndex) => {
5371
+ const learnerAnswerState = checkAnswerState(
5372
+ materialMap[answerMapKey],
5373
+ answerMapValue
5374
+ );
5375
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "p-1", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5376
+ "div",
5377
+ {
5378
+ className: `${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"}`,
5379
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5440
5380
  "div",
5441
5381
  {
5442
5382
  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`,
@@ -5452,47 +5392,41 @@ var GroupingActivityMaterialContent = ({
5452
5392
  setSelectedValue(null);
5453
5393
  }
5454
5394
  },
5455
- children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5456
- "div",
5395
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex flex-col items-center justify-center transition-all duration-300 min-w-[200px] overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "m-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5396
+ answerMapValue
5397
+ ).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5398
+ "span",
5457
5399
  {
5458
- className: `flex flex-col items-center justify-center transition-all duration-300 min-h-[64px] min-w-[200px]`,
5459
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "m-2", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5460
- answerMapValue
5461
- ).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5462
- "span",
5400
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5401
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5402
+ import_react_katex4.InlineMath,
5463
5403
  {
5464
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5465
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5466
- import_react_katex4.InlineMath,
5467
- {
5468
- math: inputPart.value
5469
- }
5470
- ) }) : inputPart.value
5471
- },
5472
- index2
5473
- )) }) })
5474
- }
5475
- ) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5404
+ math: inputPart.value
5405
+ }
5406
+ ) }) : inputPart.value
5407
+ },
5408
+ index2
5409
+ )) }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
5476
5410
  ShowMaterialMediaByContentType_default,
5477
5411
  {
5478
5412
  contentType: contentMap.type,
5479
5413
  src: answerMapValue,
5480
5414
  canFullScreen: false
5481
5415
  },
5482
- `${uniqueValue}-${index}`
5416
+ `${uniqueValue}-${answerMapIndex}`
5483
5417
  )
5484
5418
  }
5485
- ) }) });
5419
+ )
5486
5420
  }
5487
- )
5421
+ ) }, answerMapIndex);
5488
5422
  }
5489
- )
5423
+ ) }) })
5490
5424
  },
5491
5425
  index
5492
5426
  )
5493
5427
  }
5494
5428
  ) }) })
5495
- ] }, index))
5429
+ ] }, index)) })
5496
5430
  ] });
5497
5431
  };
5498
5432
  var GroupingActivityMaterialContent_default = GroupingActivityMaterialContent;
@@ -5505,13 +5439,13 @@ var GroupingActivityContent = ({
5505
5439
  canAnswerQuestion,
5506
5440
  changeAnswer,
5507
5441
  isPreview,
5508
- showCorrectAnswer,
5509
- isFullScreen
5442
+ showCorrectAnswer
5510
5443
  }) => {
5511
5444
  const contentMap = parseContentMapFromData(data);
5512
5445
  const groupingBodyMap = parseBodyMapFromData(data, "GROUPING");
5513
5446
  const groupingMaterialMap = parseMaterialMapFromData(data, "GROUPING");
5514
5447
  const handleGroupingAnswerOnChange = (answer2, key, value, index) => {
5448
+ if (isPreview) return;
5515
5449
  let foundIndex = answer2.data.findIndex(
5516
5450
  (answerData) => answerData.type === "GROUPING"
5517
5451
  );
@@ -5549,8 +5483,8 @@ var GroupingActivityContent = ({
5549
5483
  };
5550
5484
  var GroupingActivityContent_default = GroupingActivityContent;
5551
5485
 
5552
- // src/components/activities/material-content/MatchingActivityMaterialContent.tsx
5553
- var import_react24 = require("react");
5486
+ // src/components/activities/material-contents/MatchingActivityMaterialContent.tsx
5487
+ var import_react23 = require("react");
5554
5488
  var import_react_dnd5 = require("react-dnd");
5555
5489
  var import_react_katex5 = require("react-katex");
5556
5490
  var import_jsx_runtime33 = require("react/jsx-runtime");
@@ -5564,10 +5498,10 @@ var MatchingActivityMaterialContent = ({
5564
5498
  isPreview,
5565
5499
  showCorrectAnswer
5566
5500
  }) => {
5567
- const [selectedValue, setSelectedValue] = (0, import_react24.useState)(null);
5568
- const [selectedTargetKey, setSelectedTargetKey] = (0, import_react24.useState)(null);
5569
- const [isShuffled, setIsShuffled] = (0, import_react24.useState)(false);
5570
- const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react24.useState)([]);
5501
+ const [selectedValue, setSelectedValue] = (0, import_react23.useState)(null);
5502
+ const [selectedTargetKey, setSelectedTargetKey] = (0, import_react23.useState)(null);
5503
+ const [isShuffled, setIsShuffled] = (0, import_react23.useState)(false);
5504
+ const [shuffledMaterialList, setShuffledMaterialList] = (0, import_react23.useState)([]);
5571
5505
  const [{ isOver, canDrop }, drop] = (0, import_react_dnd5.useDrop)({
5572
5506
  accept: "MATCHING",
5573
5507
  drop: () => {
@@ -5577,9 +5511,8 @@ var MatchingActivityMaterialContent = ({
5577
5511
  canDrop: monitor.canDrop()
5578
5512
  })
5579
5513
  });
5580
- const { containerSize } = useScreenSize_default();
5581
- const itemsRef = (0, import_react24.useRef)(null);
5582
- (0, import_react24.useEffect)(() => {
5514
+ const itemsRef = (0, import_react23.useRef)(null);
5515
+ (0, import_react23.useEffect)(() => {
5583
5516
  const shuffleArray2 = (array) => {
5584
5517
  if (!isShuffled) {
5585
5518
  const copyArray = JSON.parse(JSON.stringify(array));
@@ -5598,31 +5531,17 @@ var MatchingActivityMaterialContent = ({
5598
5531
  });
5599
5532
  setShuffledMaterialList(shuffleArray2(materialList));
5600
5533
  }, []);
5601
- (0, import_react24.useEffect)(() => {
5534
+ (0, import_react23.useEffect)(() => {
5602
5535
  if (!showCorrectAnswer) return;
5603
5536
  answer.data.find(
5604
5537
  (answerData) => answerData.type === "MATCHING"
5605
5538
  ).answerMap = materialMap;
5606
5539
  }, [showCorrectAnswer]);
5607
- (0, import_react24.useEffect)(() => {
5608
- if (!itemsRef) return;
5609
- if (!itemsRef.current) return;
5610
- if (!containerSize) return;
5611
- itemsRef.current.style.width = `${containerSize.width - 220}px`;
5612
- }, [itemsRef, containerSize]);
5613
5540
  const retrieveAnswerMap = () => {
5614
5541
  const foundIndex = answer.data.findIndex(
5615
5542
  (answerData) => answerData.type === "MATCHING"
5616
5543
  );
5617
- const answerMap2 = answer.data[foundIndex].answerMap;
5618
- const sortedAnswerMapKeys = Object.keys(answerMap2).sort(
5619
- (a, b) => answerMap2[a] ? answerMap2[b] ? answerMap2[a].localeCompare(answerMap2[b]) : 1 : -1
5620
- );
5621
- const sortedAnswerMap = {};
5622
- for (const answerMapKey of sortedAnswerMapKeys) {
5623
- sortedAnswerMap[answerMapKey] = answerMap2[answerMapKey];
5624
- }
5625
- return sortedAnswerMap;
5544
+ return answer.data[foundIndex].answerMap;
5626
5545
  };
5627
5546
  const retrieveFilteredMaterialList = (answerMap2) => {
5628
5547
  const selectedValueList = [];
@@ -5650,71 +5569,73 @@ var MatchingActivityMaterialContent = ({
5650
5569
  const answerMap = retrieveAnswerMap();
5651
5570
  const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
5652
5571
  return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
5653
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5654
- "div",
5655
- {
5656
- ref: itemsRef,
5657
- className: "flex-1 flex flex-row gap-x-4 gap-y-4 overflow-auto py-2",
5658
- children: filteredMaterialList.map((materialValue, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5659
- DraggableItem_default,
5660
- {
5661
- item: { index: materialValue },
5662
- type: "MATCHING",
5663
- component: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5664
- "div",
5665
- {
5666
- className: `${selectedValue === materialValue ? "border-catchup-blue" : "border-catchup-lighter-gray"} h-catchup-activity-covering-box-item flex flex-col items-center justify-center border-2 rounded-catchup-xlarge cursor-pointer transition-all duration-300`,
5667
- onMouseDown: () => {
5668
- if (checkCanAnswerQuestion()) {
5669
- setSelectedValue(materialValue);
5670
- }
5671
- },
5672
- onMouseUp: () => {
5673
- if (checkCanAnswerQuestion()) {
5674
- setSelectedValue(null);
5675
- }
5676
- },
5677
- children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5678
- "div",
5679
- {
5680
- className: `flex flex-col items-center justify-center m-4 min-h-[64px] min-w-[200px]`,
5681
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xl p-5 whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5682
- materialValue
5683
- ).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5684
- "span",
5685
- {
5686
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5687
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
5688
- },
5689
- index2
5690
- )) })
5691
- }
5692
- ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5693
- ShowMaterialMediaByContentType_default,
5694
- {
5695
- contentType: contentMap.type,
5696
- src: materialValue,
5697
- canFullScreen: true
5572
+ filteredMaterialList.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
5573
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5574
+ "div",
5575
+ {
5576
+ ref: itemsRef,
5577
+ className: "flex-shrink-0 flex flex-row gap-x-4 gap-y-4 overflow-x-auto py-2",
5578
+ children: filteredMaterialList.map((materialValue, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5579
+ DraggableItem_default,
5580
+ {
5581
+ item: { index: materialValue },
5582
+ type: "MATCHING",
5583
+ component: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5584
+ "div",
5585
+ {
5586
+ 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`,
5587
+ onMouseDown: () => {
5588
+ if (checkCanAnswerQuestion()) {
5589
+ setSelectedValue(materialValue);
5590
+ }
5698
5591
  },
5699
- `${uniqueValue}-${index}`
5700
- )
5592
+ onMouseUp: () => {
5593
+ if (checkCanAnswerQuestion()) {
5594
+ setSelectedValue(null);
5595
+ }
5596
+ },
5597
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5598
+ "div",
5599
+ {
5600
+ className: `flex flex-col items-center justify-center m-2 min-w-[200px] overflow-y-auto`,
5601
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5602
+ materialValue
5603
+ ).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5604
+ "span",
5605
+ {
5606
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5607
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
5608
+ },
5609
+ index2
5610
+ )) })
5611
+ }
5612
+ ) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5613
+ ShowMaterialMediaByContentType_default,
5614
+ {
5615
+ contentType: contentMap.type,
5616
+ src: materialValue,
5617
+ canFullScreen: true
5618
+ },
5619
+ `${uniqueValue}-${index}`
5620
+ )
5621
+ }
5622
+ ),
5623
+ moveCardHandler: () => {
5624
+ if (!selectedTargetKey) return;
5625
+ if (!selectedValue) return;
5626
+ handleMatchingActivityItemOnChange(
5627
+ selectedTargetKey,
5628
+ selectedValue
5629
+ );
5701
5630
  }
5702
- ),
5703
- moveCardHandler: () => {
5704
- if (!selectedTargetKey) return;
5705
- if (!selectedValue) return;
5706
- handleMatchingActivityItemOnChange(
5707
- selectedTargetKey,
5708
- selectedValue
5709
- );
5710
- }
5711
- },
5712
- index
5713
- ))
5714
- }
5715
- ),
5716
- filteredMaterialList.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DividerLine_default, {}) : null,
5717
- Object.keys(answerMap).map((answerMapKey, index) => {
5631
+ },
5632
+ index
5633
+ ))
5634
+ }
5635
+ ),
5636
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DividerLine_default, {}) })
5637
+ ] }) : null,
5638
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "overflow-y-auto max-h-[600px]", children: Object.keys(answerMap).map((answerMapKey, index) => {
5718
5639
  const learnerAnswerState = checkAnswerState(
5719
5640
  materialMap[answerMapKey],
5720
5641
  answerMap[answerMapKey]
@@ -5723,30 +5644,24 @@ var MatchingActivityMaterialContent = ({
5723
5644
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-1/3", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5724
5645
  "div",
5725
5646
  {
5726
- className: `h-catchup-activity-outer-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"}`,
5727
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5728
- "div",
5647
+ 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"}`,
5648
+ children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex flex-col items-center justify-center transition-all duration-300 m-4", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5649
+ answerMapKey
5650
+ ).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5651
+ "span",
5729
5652
  {
5730
- className: `flex flex-col items-center justify-center transition-all duration-300 m-4`,
5731
- children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xl p-5 whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(answerMapKey).map(
5732
- (inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5733
- "span",
5734
- {
5735
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5736
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
5737
- },
5738
- index2
5739
- )
5740
- ) })
5741
- }
5742
- )
5653
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5654
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
5655
+ },
5656
+ index2
5657
+ )) }) })
5743
5658
  }
5744
5659
  ) }),
5745
5660
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "mx-4 w-[2px] bg-catchup-lighter-gray" }),
5746
5661
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5747
5662
  "div",
5748
5663
  {
5749
- className: `${canDrop ? selectedTargetKey === answerMapKey ? "bg-catchup-light-blue" : "bg-catchup-light-blue opacity-40" : ""} h-catchup-activity-outer-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"}`,
5664
+ 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"}`,
5750
5665
  onClick: () => {
5751
5666
  if (checkCanAnswerQuestion()) {
5752
5667
  setSelectedValue(null);
@@ -5763,7 +5678,7 @@ var MatchingActivityMaterialContent = ({
5763
5678
  component: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5764
5679
  "div",
5765
5680
  {
5766
- className: `h-full flex-1 flex flex-row items-center justify-center `,
5681
+ className: "h-full flex-1 flex flex-row items-center justify-center",
5767
5682
  onClick: (e) => {
5768
5683
  e.preventDefault();
5769
5684
  if (checkCanAnswerQuestion()) {
@@ -5773,13 +5688,13 @@ var MatchingActivityMaterialContent = ({
5773
5688
  );
5774
5689
  }
5775
5690
  },
5776
- children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-xl p-5 whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5691
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
5777
5692
  answerMap[answerMapKey]
5778
5693
  ).map((inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5779
5694
  "span",
5780
5695
  {
5781
5696
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5782
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
5697
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_katex5.InlineMath, { math: inputPart.value }) }) : inputPart.value
5783
5698
  },
5784
5699
  index2
5785
5700
  )) }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
@@ -5799,7 +5714,7 @@ var MatchingActivityMaterialContent = ({
5799
5714
  }
5800
5715
  ) })
5801
5716
  ] }, index);
5802
- })
5717
+ }) })
5803
5718
  ] });
5804
5719
  };
5805
5720
  var MatchingActivityMaterialContent_default = MatchingActivityMaterialContent;
@@ -5812,13 +5727,13 @@ var MatchingActivityContent = ({
5812
5727
  canAnswerQuestion,
5813
5728
  changeAnswer,
5814
5729
  isPreview,
5815
- showCorrectAnswer,
5816
- isFullScreen
5730
+ showCorrectAnswer
5817
5731
  }) => {
5818
5732
  const contentMap = parseContentMapFromData(data);
5819
5733
  const matchingBodyMap = parseBodyMapFromData(data, "MATCHING");
5820
5734
  const matchingMaterialMap = parseMaterialMapFromData(data, "MATCHING");
5821
5735
  const handleMatchingAnswerOnChange = (answer2, key, value) => {
5736
+ if (isPreview) return;
5822
5737
  let foundIndex = answer2.data.findIndex(
5823
5738
  (answerData) => answerData.type === "MATCHING"
5824
5739
  );
@@ -5852,7 +5767,7 @@ var MatchingActivityContent = ({
5852
5767
  };
5853
5768
  var MatchingActivityContent_default = MatchingActivityContent;
5854
5769
 
5855
- // src/components/activities/material-content/MCMAActivityMaterialContent.tsx
5770
+ // src/components/activities/material-contents/MCMAActivityMaterialContent.tsx
5856
5771
  var import_react_katex6 = require("react-katex");
5857
5772
  var import_jsx_runtime35 = require("react/jsx-runtime");
5858
5773
  var MCMAActivityMaterialContent = ({
@@ -5927,7 +5842,7 @@ var MCMAActivityMaterialContent = ({
5927
5842
  "span",
5928
5843
  {
5929
5844
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5930
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
5845
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
5931
5846
  },
5932
5847
  index3
5933
5848
  )) }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
@@ -5950,7 +5865,7 @@ var MCMAActivityMaterialContent = ({
5950
5865
  "span",
5951
5866
  {
5952
5867
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5953
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
5868
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_katex6.InlineMath, { math: inputPart.value }) }) : inputPart.value
5954
5869
  },
5955
5870
  index2
5956
5871
  )) }, materialKey)
@@ -5973,6 +5888,7 @@ var MCMAActivityContent = ({
5973
5888
  const MCMABodyMap = parseBodyMapFromData(data, "MCMA");
5974
5889
  const MCMAMaterialMap = parseMaterialMapFromData(data, "MCMA");
5975
5890
  const handleMCMAAnswerOnChange = (answer2, key, value) => {
5891
+ if (isPreview) return;
5976
5892
  let foundIndex = answer2.data.findIndex(
5977
5893
  (answerData) => answerData.type === "MCMA"
5978
5894
  );
@@ -6007,7 +5923,7 @@ var MCMAActivityContent = ({
6007
5923
  };
6008
5924
  var MCMAActivityContent_default = MCMAActivityContent;
6009
5925
 
6010
- // src/components/activities/material-content/MCSAActivityMaterialContent.tsx
5926
+ // src/components/activities/material-contents/MCSAActivityMaterialContent.tsx
6011
5927
  var import_react_katex7 = require("react-katex");
6012
5928
  var import_jsx_runtime37 = require("react/jsx-runtime");
6013
5929
  var MCSAActivityMaterialContent = ({
@@ -6077,7 +5993,7 @@ var MCSAActivityMaterialContent = ({
6077
5993
  "span",
6078
5994
  {
6079
5995
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6080
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_katex7.InlineMath, { math: inputPart.value }) }) : inputPart.value
5996
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_katex7.InlineMath, { math: inputPart.value }) }) : inputPart.value
6081
5997
  },
6082
5998
  index3
6083
5999
  )) }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
@@ -6102,7 +6018,7 @@ var MCSAActivityMaterialContent = ({
6102
6018
  "span",
6103
6019
  {
6104
6020
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6105
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_katex7.InlineMath, { math: inputPart.value }) }) : inputPart.value
6021
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_katex7.InlineMath, { math: inputPart.value }) }) : inputPart.value
6106
6022
  },
6107
6023
  index2
6108
6024
  )) })
@@ -6125,6 +6041,7 @@ var MCSAActivityContent = ({
6125
6041
  const MCSABodyMap = parseBodyMapFromData(data, "MCSA");
6126
6042
  const MCSAMaterialMap = parseMaterialMapFromData(data, "MCSA");
6127
6043
  const handleMCSAAnswerOnChange = (answer2, key, value) => {
6044
+ if (isPreview) return;
6128
6045
  let foundIndex = answer2.data.findIndex(
6129
6046
  (answerData) => answerData.type === "MCSA"
6130
6047
  );
@@ -6180,7 +6097,7 @@ var retrieveDocumentTypeFromExtension = (format) => {
6180
6097
  return "";
6181
6098
  };
6182
6099
 
6183
- // src/components/activities/material-content/OpenEndedActivityMaterialContent.tsx
6100
+ // src/components/activities/material-contents/OpenEndedActivityMaterialContent.tsx
6184
6101
  var import_jsx_runtime39 = require("react/jsx-runtime");
6185
6102
  var OpenEndedActivityMaterialContent = ({
6186
6103
  answer,
@@ -6293,11 +6210,13 @@ var OpenEndedActivityContent = ({
6293
6210
  changeAnswer,
6294
6211
  canAnswerQuestion,
6295
6212
  showMaterialContent,
6213
+ isPreview,
6296
6214
  isFullScreen
6297
6215
  }) => {
6298
6216
  const contentMap = parseContentMapFromData(data);
6299
6217
  const openEndedBodyMap = parseBodyMapFromData(data, "OPEN_ENDED");
6300
6218
  const handleOpenEndedAnswerOnChange = (answer2, value) => {
6219
+ if (isPreview) return;
6301
6220
  let foundIndex = answer2.data.findIndex(
6302
6221
  (answerData) => answerData.type === "OPEN_ENDED"
6303
6222
  );
@@ -6342,11 +6261,46 @@ var OpenEndedActivityContent = ({
6342
6261
  };
6343
6262
  var OpenEndedActivityContent_default = OpenEndedActivityContent;
6344
6263
 
6345
- // src/components/activities/material-content/OrderingActivityMaterialContent.tsx
6264
+ // src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
6346
6265
  var import_react26 = require("react");
6347
6266
  var import_react_dnd7 = require("react-dnd");
6348
6267
  var import_react_katex8 = require("react-katex");
6349
6268
 
6269
+ // src/hooks/useScreenSize.ts
6270
+ var import_react24 = require("react");
6271
+ var useScreenSize = () => {
6272
+ const [containerSize, setContainerSize] = (0, import_react24.useState)({
6273
+ width: 0,
6274
+ height: 0
6275
+ });
6276
+ const [screenSize, setScreenSize] = (0, import_react24.useState)({
6277
+ width: window.innerWidth,
6278
+ height: window.innerHeight
6279
+ });
6280
+ (0, import_react24.useEffect)(() => {
6281
+ const handleResize = () => {
6282
+ setScreenSize({
6283
+ width: window.innerWidth,
6284
+ height: window.innerHeight
6285
+ });
6286
+ const container = document.getElementById("container");
6287
+ if (!container) return;
6288
+ const boundingClientRect = container.getBoundingClientRect();
6289
+ setContainerSize({
6290
+ width: boundingClientRect.width,
6291
+ height: boundingClientRect.height
6292
+ });
6293
+ };
6294
+ handleResize();
6295
+ window.addEventListener("resize", handleResize);
6296
+ return () => {
6297
+ window.removeEventListener("resize", handleResize);
6298
+ };
6299
+ }, []);
6300
+ return { screenSize, containerSize };
6301
+ };
6302
+ var useScreenSize_default = useScreenSize;
6303
+
6350
6304
  // src/components/dnds/DraggableDroppableItem.tsx
6351
6305
  var import_react25 = require("react");
6352
6306
  var import_react_dnd6 = require("react-dnd");
@@ -6398,7 +6352,7 @@ var DraggableDroppableItem = ({
6398
6352
  };
6399
6353
  var DraggableDroppableItem_default = DraggableDroppableItem;
6400
6354
 
6401
- // src/components/activities/material-content/OrderingActivityMaterialContent.tsx
6355
+ // src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
6402
6356
  var import_jsx_runtime42 = require("react/jsx-runtime");
6403
6357
  var OrderingActivityMaterialContent = ({
6404
6358
  uniqueValue,
@@ -6489,19 +6443,13 @@ var OrderingActivityMaterialContent = ({
6489
6443
  marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
6490
6444
  },
6491
6445
  children: [
6492
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mr-3", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6446
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "mr-3", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "h-catchup-activity-box-item w-catchup-activity-box-item flex flex-col items-center justify-center cursor-pointer transition-all duration-300 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6493
6447
  "div",
6494
6448
  {
6495
- className: `min-h-catchup-activity-outer-box-item w-catchup-activity-box-item flex flex-col items-center justify-center cursor-pointer transition-all duration-300`,
6496
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6497
- "div",
6498
- {
6499
- 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]`,
6500
- children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "", children: parseFloat(materialKey) + 1 })
6501
- }
6502
- )
6449
+ 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]`,
6450
+ children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: "", children: parseFloat(materialKey) + 1 })
6503
6451
  }
6504
- ) }),
6452
+ ) }) }),
6505
6453
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6506
6454
  DraggableDroppableItem_default,
6507
6455
  {
@@ -6511,7 +6459,7 @@ var OrderingActivityMaterialContent = ({
6511
6459
  component: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6512
6460
  "div",
6513
6461
  {
6514
- className: `${canDrop ? selectedKey !== materialKey ? selectedTargetKey === materialKey ? "bg-catchup-light-blue rounded-catchup-xlarge" : "bg-catchup-light-blue rounded-catchup-xlarge opacity-40" : "" : ""} flex-1 min-h-catchup-activity-outer-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"}`,
6462
+ 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"}`,
6515
6463
  onMouseDown: () => {
6516
6464
  if (checkCanAnswerQuestion()) {
6517
6465
  setSelectedKey(materialKey);
@@ -6523,7 +6471,7 @@ var OrderingActivityMaterialContent = ({
6523
6471
  "span",
6524
6472
  {
6525
6473
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6526
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_katex8.InlineMath, { math: inputPart.value }) }) : inputPart.value
6474
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react_katex8.InlineMath, { math: inputPart.value }) }) : inputPart.value
6527
6475
  },
6528
6476
  index2
6529
6477
  )) }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
@@ -6572,6 +6520,7 @@ var OrderingActivityContent = ({
6572
6520
  const orderingBodyMap = parseBodyMapFromData(data, "ORDERING");
6573
6521
  const orderingMaterialMap = parseMaterialMapFromData(data, "ORDERING");
6574
6522
  const handleOrderingAnswerOnChange = (answer2, primaryKey, secondaryKey) => {
6523
+ if (isPreview) return;
6575
6524
  let foundIndex = answer2.data.findIndex(
6576
6525
  (answerData) => answerData.type === "ORDERING"
6577
6526
  );
@@ -6607,7 +6556,7 @@ var OrderingActivityContent = ({
6607
6556
  };
6608
6557
  var OrderingActivityContent_default = OrderingActivityContent;
6609
6558
 
6610
- // src/components/activities/material-content/TrueFalseActivityMaterialContent.tsx
6559
+ // src/components/activities/material-contents/TrueFalseActivityMaterialContent.tsx
6611
6560
  var import_react27 = require("react");
6612
6561
  var import_react_katex9 = require("react-katex");
6613
6562
  var import_jsx_runtime44 = require("react/jsx-runtime");
@@ -6692,7 +6641,7 @@ var TrueFalseActivityMaterialContent = ({
6692
6641
  "span",
6693
6642
  {
6694
6643
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6695
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_katex9.InlineMath, { math: inputPart.value }) }) : inputPart.value
6644
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_katex9.InlineMath, { math: inputPart.value }) }) : inputPart.value
6696
6645
  },
6697
6646
  index2
6698
6647
  )) }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
@@ -6767,6 +6716,7 @@ var TrueFalseActivityContent = ({
6767
6716
  return answer.data[foundIndex].answerMap;
6768
6717
  };
6769
6718
  const handleTrueFalseAnswerOnChange = (answer2, key, value) => {
6719
+ if (isPreview) return;
6770
6720
  const answerMap = retrieveCurrentAnswerMap();
6771
6721
  if (key === "TRUE") {
6772
6722
  const foundFalseIndex = answerMap.falseList.findIndex(
@@ -6824,7 +6774,7 @@ var TrueFalseActivityContent = ({
6824
6774
  };
6825
6775
  var TrueFalseActivityContent_default = TrueFalseActivityContent;
6826
6776
 
6827
- // src/components/activities/solution-content/ActivitySolutionContent.tsx
6777
+ // src/components/activities/solution-contents/ActivitySolutionContent.tsx
6828
6778
  var import_react_katex10 = require("react-katex");
6829
6779
  var import_jsx_runtime46 = require("react/jsx-runtime");
6830
6780
  var ActivitySolutionContent = ({
@@ -6872,7 +6822,7 @@ var ActivitySolutionContent = ({
6872
6822
  "span",
6873
6823
  {
6874
6824
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6875
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_katex10.InlineMath, { math: inputPart.value }) }) : inputPart.value
6825
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_katex10.InlineMath, { math: inputPart.value }) }) : inputPart.value
6876
6826
  },
6877
6827
  `${key}_part_${partIndex}`
6878
6828
  )
@@ -6882,7 +6832,7 @@ var ActivitySolutionContent = ({
6882
6832
  };
6883
6833
  var ActivitySolutionContent_default = ActivitySolutionContent;
6884
6834
 
6885
- // src/components/activities/evaluation-rubric-content/ActivityEvaluationRubricContent.tsx
6835
+ // src/components/activities/evaluation-rubric-contents/ActivityEvaluationRubricContent.tsx
6886
6836
  var import_react_katex11 = require("react-katex");
6887
6837
  var import_jsx_runtime47 = require("react/jsx-runtime");
6888
6838
  var ActivityEvaluationRubricContent = ({
@@ -6927,7 +6877,7 @@ var ActivityEvaluationRubricContent = ({
6927
6877
  "span",
6928
6878
  {
6929
6879
  className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6930
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_katex11.InlineMath, { math: inputPart.value }) }) : inputPart.value
6880
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_katex11.InlineMath, { math: inputPart.value }) }) : inputPart.value
6931
6881
  },
6932
6882
  index2
6933
6883
  )
@@ -7123,8 +7073,7 @@ var ActivityPreviewByData = ({
7123
7073
  },
7124
7074
  data,
7125
7075
  isPreview: true,
7126
- showCorrectAnswer: true,
7127
- isFullScreen
7076
+ showCorrectAnswer: true
7128
7077
  }
7129
7078
  ) : selectedType === "GROUPING" && data["groupingBodyMap"] != null && data["groupingMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
7130
7079
  GroupingActivityContent_default,
@@ -7137,8 +7086,7 @@ var ActivityPreviewByData = ({
7137
7086
  },
7138
7087
  data,
7139
7088
  isPreview: true,
7140
- showCorrectAnswer: true,
7141
- isFullScreen
7089
+ showCorrectAnswer: true
7142
7090
  }
7143
7091
  ) : selectedType === "FILL_IN_THE_BLANKS" && data["fillInTheBlanksBodyMap"] != null && data["fillInTheBlanksMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
7144
7092
  FillInTheBlanksActivityContent_default,
@@ -7163,6 +7111,7 @@ var ActivityPreviewByData = ({
7163
7111
  },
7164
7112
  showMaterialContent: true,
7165
7113
  data,
7114
+ isPreview: true,
7166
7115
  isFullScreen
7167
7116
  }
7168
7117
  ) : selectedType === "TRUE_FALSE" && data["trueFalseBodyMap"] != null && data["trueFalseMaterialMap"] != null ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(