catchup-library-web 1.20.36 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -4691,6 +4691,10 @@ var FillInTheBlanksActivityMaterialContent = ({
4691
4691
  null
4692
4692
  );
4693
4693
  const dragElementRef = useRef4(null);
4694
+ const [mousePosition, setMousePosition] = useState17({
4695
+ x: 0,
4696
+ y: 0
4697
+ });
4694
4698
  const [touchPosition, setTouchPosition] = useState17({
4695
4699
  x: 0,
4696
4700
  y: 0
@@ -4733,6 +4737,19 @@ var FillInTheBlanksActivityMaterialContent = ({
4733
4737
  e.preventDefault();
4734
4738
  setDraggedOption(option);
4735
4739
  setSelectedOption(null);
4740
+ setMousePosition({ x: e.clientX, y: e.clientY });
4741
+ };
4742
+ const handleMouseMove = (e) => {
4743
+ if (!draggedOption) return;
4744
+ setMousePosition({ x: e.clientX, y: e.clientY });
4745
+ const elementUnder = document.elementFromPoint(e.clientX, e.clientY);
4746
+ const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-drop-zone]");
4747
+ if (dropZone) {
4748
+ const dropIndex = dropZone.getAttribute("data-drop-zone");
4749
+ setDropTargetIndex(dropIndex);
4750
+ } else {
4751
+ setDropTargetIndex(null);
4752
+ }
4736
4753
  };
4737
4754
  const handleMouseUp = () => {
4738
4755
  if (dropTargetIndex !== null && draggedOption !== null) {
@@ -4740,6 +4757,7 @@ var FillInTheBlanksActivityMaterialContent = ({
4740
4757
  }
4741
4758
  setDraggedOption(null);
4742
4759
  setDropTargetIndex(null);
4760
+ setMousePosition({ x: 0, y: 0 });
4743
4761
  };
4744
4762
  const handleTouchStart = (e, option, element) => {
4745
4763
  const touch = e.touches[0];
@@ -4771,6 +4789,7 @@ var FillInTheBlanksActivityMaterialContent = ({
4771
4789
  setDraggedOption(null);
4772
4790
  setDropTargetIndex(null);
4773
4791
  setDraggedElement(null);
4792
+ setTouchPosition({ x: 0, y: 0 });
4774
4793
  };
4775
4794
  const handleSelectOption = (option) => {
4776
4795
  setSelectedOption(option);
@@ -4783,178 +4802,212 @@ var FillInTheBlanksActivityMaterialContent = ({
4783
4802
  }
4784
4803
  };
4785
4804
  const answerMap = retrieveAnswerMap();
4786
- return /* @__PURE__ */ jsxs17("div", { className: "flex flex-row flex-wrap items-center", children: [
4787
- /* @__PURE__ */ jsx28("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx28("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_fill_in_the_blanks_text") }) }),
4788
- /* @__PURE__ */ jsx28("div", { className: "hidden md:contents", children: /* @__PURE__ */ jsx28(DividerLine_default, {}) }),
4789
- draggedOption && touchPosition.x > 0 && /* @__PURE__ */ jsx28(
4790
- "div",
4791
- {
4792
- className: "fixed pointer-events-none z-50 opacity-80",
4793
- style: {
4794
- left: `${touchPosition.x}px`,
4795
- top: `${touchPosition.y}px`,
4796
- transform: "translate(-50%, -50%)"
4797
- },
4798
- children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx28("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx28("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx28(
4799
- InputWithSpecialExpression_default,
4805
+ return /* @__PURE__ */ jsxs17(
4806
+ "div",
4807
+ {
4808
+ className: "flex flex-row flex-wrap items-center",
4809
+ onMouseMove: handleMouseMove,
4810
+ onMouseUp: handleMouseUp,
4811
+ children: [
4812
+ /* @__PURE__ */ jsx28("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx28("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_fill_in_the_blanks_text") }) }),
4813
+ /* @__PURE__ */ jsx28("div", { className: "hidden md:contents", children: /* @__PURE__ */ jsx28(DividerLine_default, {}) }),
4814
+ draggedOption && mousePosition.x > 0 && /* @__PURE__ */ jsx28(
4815
+ "div",
4800
4816
  {
4801
- value: draggedOption,
4802
- showSpecialOnly: false
4817
+ className: "fixed pointer-events-none z-50 opacity-80",
4818
+ style: {
4819
+ left: `${mousePosition.x}px`,
4820
+ top: `${mousePosition.y}px`,
4821
+ transform: "translate(-50%, -50%)"
4822
+ },
4823
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx28("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx28("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx28(
4824
+ InputWithSpecialExpression_default,
4825
+ {
4826
+ value: draggedOption,
4827
+ showSpecialOnly: false
4828
+ }
4829
+ ) }) }) : /* @__PURE__ */ jsx28("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx28(
4830
+ ShowMaterialMediaByContentType_default,
4831
+ {
4832
+ contentType: contentMap.type,
4833
+ src: draggedOption,
4834
+ canFullScreen: false
4835
+ },
4836
+ uniqueValue
4837
+ ) })
4803
4838
  }
4804
- ) }) }) : /* @__PURE__ */ jsx28("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx28(
4805
- ShowMaterialMediaByContentType_default,
4839
+ ),
4840
+ draggedOption && touchPosition.x > 0 && /* @__PURE__ */ jsx28(
4841
+ "div",
4806
4842
  {
4807
- contentType: contentMap.type,
4808
- src: draggedOption,
4809
- canFullScreen: false
4810
- },
4811
- uniqueValue
4812
- ) })
4813
- }
4814
- ),
4815
- /* @__PURE__ */ jsx28("div", { className: "w-full flex flex-row flex-wrap gap-x-2 gap-y-2 my-2", children: shuffleOptionList.map(
4816
- (option, index) => checkAnswerProvided(answerMap, option) ? /* @__PURE__ */ jsx28("div", { className: "opacity-30", children: /* @__PURE__ */ jsx28(
4817
- ShowMaterialMediaByContentType_default,
4818
- {
4819
- contentType: contentMap.type,
4820
- src: option,
4821
- canFullScreen: true
4822
- },
4823
- `${uniqueValue}-${index}`
4824
- ) }, index) : /* @__PURE__ */ jsx28(
4825
- "div",
4826
- {
4827
- ref: draggedOption === option ? dragElementRef : null,
4828
- className: `${draggedOption === option ? "opacity-40" : selectedOption === option ? "ring-2 ring-blue-500" : "opacity-100"} transition-all duration-200`,
4829
- onMouseDown: (e) => handleMouseDown(e, option),
4830
- onTouchStart: (e) => handleTouchStart(e, option, e.currentTarget),
4831
- onTouchMove: handleTouchMove,
4832
- onTouchEnd: handleTouchEnd,
4833
- children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx28(
4834
- "div",
4843
+ className: "fixed pointer-events-none z-50 opacity-80",
4844
+ style: {
4845
+ left: `${touchPosition.x}px`,
4846
+ top: `${touchPosition.y}px`,
4847
+ transform: "translate(-50%, -50%)"
4848
+ },
4849
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx28("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx28("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx28(
4850
+ InputWithSpecialExpression_default,
4851
+ {
4852
+ value: draggedOption,
4853
+ showSpecialOnly: false
4854
+ }
4855
+ ) }) }) : /* @__PURE__ */ jsx28("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx28(
4856
+ ShowMaterialMediaByContentType_default,
4857
+ {
4858
+ contentType: contentMap.type,
4859
+ src: draggedOption,
4860
+ canFullScreen: false
4861
+ },
4862
+ uniqueValue
4863
+ ) })
4864
+ }
4865
+ ),
4866
+ /* @__PURE__ */ jsx28("div", { className: "w-full flex flex-row flex-wrap gap-x-2 gap-y-2 my-2", children: shuffleOptionList.map(
4867
+ (option, index) => checkAnswerProvided(answerMap, option) ? /* @__PURE__ */ jsx28("div", { className: "opacity-30", children: /* @__PURE__ */ jsx28(
4868
+ ShowMaterialMediaByContentType_default,
4835
4869
  {
4836
- className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge cursor-pointer select-none",
4837
- onClick: () => handleSelectOption(option),
4838
- children: /* @__PURE__ */ jsx28("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx28(
4839
- InputWithSpecialExpression_default,
4840
- {
4841
- value: option,
4842
- showSpecialOnly: false
4843
- }
4844
- ) })
4845
- }
4846
- ) : /* @__PURE__ */ jsx28(
4870
+ contentType: contentMap.type,
4871
+ src: option,
4872
+ canFullScreen: true
4873
+ },
4874
+ `${uniqueValue}-${index}`
4875
+ ) }, index) : /* @__PURE__ */ jsx28(
4847
4876
  "div",
4848
4877
  {
4849
- className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge cursor-pointer select-none",
4850
- onClick: () => handleSelectOption(option),
4851
- children: /* @__PURE__ */ jsx28(
4852
- ShowMaterialMediaByContentType_default,
4853
- {
4854
- contentType: contentMap.type,
4855
- src: option,
4856
- canFullScreen: true
4857
- },
4858
- `${uniqueValue}-${index}`
4859
- )
4860
- }
4861
- )
4862
- },
4863
- index
4864
- )
4865
- ) }),
4866
- /* @__PURE__ */ jsx28("div", { className: "w-full flex flex-row flex-wrap", onMouseUp: handleMouseUp, children: Object.keys(answerMap).map((materialKey, index) => {
4867
- const learnerAnswerState = checkAnswerState(
4868
- JSON.parse(materialMap[materialKey]),
4869
- answerMap[materialKey]
4870
- );
4871
- return /* @__PURE__ */ jsx28("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ jsx28("div", { className: "mx-2", children: /* @__PURE__ */ jsx28(
4872
- "div",
4873
- {
4874
- "data-drop-zone": materialKey,
4875
- onMouseEnter: () => draggedOption && setDropTargetIndex(materialKey),
4876
- onMouseLeave: () => setDropTargetIndex(null),
4877
- onClick: () => handleDropZoneClick(materialKey),
4878
- className: `${dropTargetIndex === materialKey ? "ring-2 ring-blue-400 bg-blue-50" : ""} transition-all duration-200 rounded-lg`,
4879
- children: /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
4880
- /* @__PURE__ */ jsx28("div", { className: "my-auto", children: /* @__PURE__ */ jsxs17("p", { className: "text-xl", children: [
4881
- parseFloat(materialKey) + 1,
4882
- "."
4883
- ] }) }),
4884
- /* @__PURE__ */ jsx28("div", { className: "flex-1", children: checkCanAnswerQuestion() ? contentMap.type === "TEXT" ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
4885
- /* @__PURE__ */ jsx28("div", { className: "flex-1", children: /* @__PURE__ */ jsx28(
4878
+ ref: draggedOption === option ? dragElementRef : null,
4879
+ className: `${draggedOption === option ? "opacity-40" : selectedOption === option ? "ring-2 ring-blue-500" : "opacity-100"} transition-all duration-200`,
4880
+ onMouseDown: (e) => handleMouseDown(e, option),
4881
+ onTouchStart: (e) => handleTouchStart(e, option, e.currentTarget),
4882
+ onTouchMove: handleTouchMove,
4883
+ onTouchEnd: handleTouchEnd,
4884
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx28(
4886
4885
  "div",
4887
4886
  {
4888
- className: `w-full min-h-[44px] border rounded-lg ${answerMap[materialKey] ? "border-catchup-blue-400 px-2 cursor-pointer" : "bg-catchup-gray-50 border-catchup-gray-200 border-dashed py-2 px-4"}`,
4889
- onClick: (e) => {
4890
- if (answerMap[materialKey]) {
4891
- e.stopPropagation();
4892
- onChange(answer, materialKey, "");
4893
- }
4894
- },
4895
- children: answerMap[materialKey] ? /* @__PURE__ */ jsx28(
4887
+ className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge cursor-pointer select-none",
4888
+ onClick: () => handleSelectOption(option),
4889
+ children: /* @__PURE__ */ jsx28("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx28(
4896
4890
  InputWithSpecialExpression_default,
4897
4891
  {
4898
- value: answerMap[materialKey],
4892
+ value: option,
4899
4893
  showSpecialOnly: false
4900
4894
  }
4901
- ) : null
4895
+ ) })
4902
4896
  }
4903
- ) }),
4904
- learnerAnswerState === "CORRECT" ? /* @__PURE__ */ jsx28("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx28(
4905
- BaseImage_default,
4906
- {
4907
- src: "/icons/checkbox.webp",
4908
- alt: "checkbox",
4909
- size: "small"
4910
- }
4911
- ) }) : learnerAnswerState === "INCORRECT" ? /* @__PURE__ */ jsx28("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx28(
4912
- BaseImage_default,
4897
+ ) : /* @__PURE__ */ jsx28(
4898
+ "div",
4913
4899
  {
4914
- src: "/icons/cross-red.webp",
4915
- alt: "cross-red",
4916
- size: "small"
4900
+ className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge cursor-pointer select-none",
4901
+ onClick: () => handleSelectOption(option),
4902
+ children: /* @__PURE__ */ jsx28(
4903
+ ShowMaterialMediaByContentType_default,
4904
+ {
4905
+ contentType: contentMap.type,
4906
+ src: option,
4907
+ canFullScreen: true
4908
+ },
4909
+ `${uniqueValue}-${index}`
4910
+ )
4917
4911
  }
4918
- ) }) : null
4919
- ] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ jsx28(
4920
- "div",
4921
- {
4922
- 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"}`,
4923
- children: /* @__PURE__ */ jsx28("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ jsx28("span", { className: "italic", children: i18n_default.t("please_drop_here") }) })
4924
- }
4925
- ) : /* @__PURE__ */ jsx28(
4926
- "div",
4927
- {
4928
- className: "flex-1 cursor-pointer",
4929
- onClick: (e) => {
4930
- e.stopPropagation();
4931
- onChange(answer, materialKey, "");
4932
- },
4933
- children: /* @__PURE__ */ jsx28(
4934
- ShowMaterialMediaByContentType_default,
4912
+ )
4913
+ },
4914
+ index
4915
+ )
4916
+ ) }),
4917
+ /* @__PURE__ */ jsx28("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(answerMap).map((materialKey, index) => {
4918
+ const learnerAnswerState = checkAnswerState(
4919
+ JSON.parse(materialMap[materialKey]),
4920
+ answerMap[materialKey]
4921
+ );
4922
+ return /* @__PURE__ */ jsx28("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ jsx28("div", { className: "mx-2", children: /* @__PURE__ */ jsx28(
4923
+ "div",
4924
+ {
4925
+ "data-drop-zone": materialKey,
4926
+ onMouseEnter: () => draggedOption && setDropTargetIndex(materialKey),
4927
+ onMouseLeave: () => setDropTargetIndex(null),
4928
+ onClick: () => handleDropZoneClick(materialKey),
4929
+ className: `${dropTargetIndex === materialKey ? "ring-2 ring-blue-400 bg-blue-50" : ""} transition-all duration-200 rounded-lg`,
4930
+ children: /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
4931
+ /* @__PURE__ */ jsx28("div", { className: "my-auto", children: /* @__PURE__ */ jsxs17("p", { className: "text-xl", children: [
4932
+ parseFloat(materialKey) + 1,
4933
+ "."
4934
+ ] }) }),
4935
+ /* @__PURE__ */ jsx28("div", { className: "flex-1", children: checkCanAnswerQuestion() ? contentMap.type === "TEXT" ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
4936
+ /* @__PURE__ */ jsx28("div", { className: "flex-1", children: /* @__PURE__ */ jsx28(
4937
+ "div",
4938
+ {
4939
+ className: `w-full min-h-[44px] border rounded-lg ${answerMap[materialKey] ? "border-catchup-blue-400 px-2 cursor-pointer" : "bg-catchup-gray-50 border-catchup-gray-200 border-dashed py-2 px-4"}`,
4940
+ onClick: (e) => {
4941
+ if (answerMap[materialKey]) {
4942
+ e.stopPropagation();
4943
+ onChange(answer, materialKey, "");
4944
+ }
4945
+ },
4946
+ children: answerMap[materialKey] ? /* @__PURE__ */ jsx28(
4947
+ InputWithSpecialExpression_default,
4948
+ {
4949
+ value: answerMap[materialKey],
4950
+ showSpecialOnly: false
4951
+ }
4952
+ ) : null
4953
+ }
4954
+ ) }),
4955
+ learnerAnswerState === "CORRECT" ? /* @__PURE__ */ jsx28("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx28(
4956
+ BaseImage_default,
4957
+ {
4958
+ src: "/icons/checkbox.webp",
4959
+ alt: "checkbox",
4960
+ size: "small"
4961
+ }
4962
+ ) }) : learnerAnswerState === "INCORRECT" ? /* @__PURE__ */ jsx28("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx28(
4963
+ BaseImage_default,
4964
+ {
4965
+ src: "/icons/cross-red.webp",
4966
+ alt: "cross-red",
4967
+ size: "small"
4968
+ }
4969
+ ) }) : null
4970
+ ] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ jsx28(
4971
+ "div",
4935
4972
  {
4936
- contentType: contentMap.type,
4937
- src: answerMap[materialKey],
4938
- canFullScreen: true
4973
+ 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"}`,
4974
+ children: /* @__PURE__ */ jsx28("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ jsx28("span", { className: "italic", children: i18n_default.t("please_drop_here") }) })
4975
+ }
4976
+ ) : /* @__PURE__ */ jsx28(
4977
+ "div",
4978
+ {
4979
+ className: "flex-1 cursor-pointer",
4980
+ onClick: (e) => {
4981
+ e.stopPropagation();
4982
+ onChange(answer, materialKey, "");
4983
+ },
4984
+ children: /* @__PURE__ */ jsx28(
4985
+ ShowMaterialMediaByContentType_default,
4986
+ {
4987
+ contentType: contentMap.type,
4988
+ src: answerMap[materialKey],
4989
+ canFullScreen: true
4990
+ },
4991
+ `${uniqueValue}-${index}`
4992
+ )
4993
+ }
4994
+ ) : /* @__PURE__ */ jsx28("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
4995
+ answerMap[materialKey]
4996
+ ).map((inputPart, index2) => /* @__PURE__ */ jsx28(
4997
+ "span",
4998
+ {
4999
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5000
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx28("span", { className: "text-xl", children: /* @__PURE__ */ jsx28(InlineMath4, { math: inputPart.value }) }) : inputPart.value
4939
5001
  },
4940
- `${uniqueValue}-${index}`
4941
- )
4942
- }
4943
- ) : /* @__PURE__ */ jsx28("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
4944
- answerMap[materialKey]
4945
- ).map((inputPart, index2) => /* @__PURE__ */ jsx28(
4946
- "span",
4947
- {
4948
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
4949
- children: inputPart.isEquation ? /* @__PURE__ */ jsx28("span", { className: "text-xl", children: /* @__PURE__ */ jsx28(InlineMath4, { math: inputPart.value }) }) : inputPart.value
4950
- },
4951
- index2
4952
- )) }, materialKey) })
4953
- ] })
4954
- }
4955
- ) }) }, index);
4956
- }) })
4957
- ] });
5002
+ index2
5003
+ )) }, materialKey) })
5004
+ ] })
5005
+ }
5006
+ ) }) }, index);
5007
+ }) })
5008
+ ]
5009
+ }
5010
+ );
4958
5011
  };
4959
5012
  var FillInTheBlanksActivityMaterialContent_default = FillInTheBlanksActivityMaterialContent;
4960
5013
 
@@ -5081,6 +5134,10 @@ var GroupingActivityMaterialContent = ({
5081
5134
  const [isShuffled, setIsShuffled] = useState19(false);
5082
5135
  const [shuffledMaterialList, setShuffledMaterialList] = useState19([]);
5083
5136
  const dragElementRef = useRef5(null);
5137
+ const [mousePosition, setMousePosition] = useState19({
5138
+ x: 0,
5139
+ y: 0
5140
+ });
5084
5141
  const [touchPosition, setTouchPosition] = useState19({
5085
5142
  x: 0,
5086
5143
  y: 0
@@ -5148,6 +5205,19 @@ var GroupingActivityMaterialContent = ({
5148
5205
  e.preventDefault();
5149
5206
  setDraggedValue(materialValue);
5150
5207
  setSelectedValue(null);
5208
+ setMousePosition({ x: e.clientX, y: e.clientY });
5209
+ };
5210
+ const handleMouseMove = (e) => {
5211
+ if (!draggedValue) return;
5212
+ setMousePosition({ x: e.clientX, y: e.clientY });
5213
+ const elementUnder = document.elementFromPoint(e.clientX, e.clientY);
5214
+ const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-grouping-drop-zone]");
5215
+ if (dropZone) {
5216
+ const dropKey = dropZone.getAttribute("data-grouping-drop-zone");
5217
+ setDropTargetKey(dropKey);
5218
+ } else {
5219
+ setDropTargetKey(null);
5220
+ }
5151
5221
  };
5152
5222
  const handleMouseUp = () => {
5153
5223
  if (dropTargetKey !== null && draggedValue !== null) {
@@ -5155,6 +5225,7 @@ var GroupingActivityMaterialContent = ({
5155
5225
  }
5156
5226
  setDraggedValue(null);
5157
5227
  setDropTargetKey(null);
5228
+ setMousePosition({ x: 0, y: 0 });
5158
5229
  };
5159
5230
  const handleTouchStart = (e, materialValue, element) => {
5160
5231
  if (!checkCanAnswerQuestion()) return;
@@ -5187,6 +5258,7 @@ var GroupingActivityMaterialContent = ({
5187
5258
  setDraggedValue(null);
5188
5259
  setDropTargetKey(null);
5189
5260
  setDraggedElement(null);
5261
+ setTouchPosition({ x: 0, y: 0 });
5190
5262
  };
5191
5263
  const handleSelectItem = (materialValue) => {
5192
5264
  if (!checkCanAnswerQuestion()) return;
@@ -5201,7 +5273,36 @@ var GroupingActivityMaterialContent = ({
5201
5273
  };
5202
5274
  const answerMap = retrieveAnswerMap();
5203
5275
  const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
5204
- return /* @__PURE__ */ jsxs19("div", { onMouseUp: handleMouseUp, children: [
5276
+ return /* @__PURE__ */ jsxs19("div", { onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
5277
+ draggedValue && mousePosition.x > 0 && /* @__PURE__ */ jsx30(
5278
+ "div",
5279
+ {
5280
+ className: "fixed pointer-events-none z-50 opacity-80",
5281
+ style: {
5282
+ left: `${mousePosition.x}px`,
5283
+ top: `${mousePosition.y}px`,
5284
+ transform: "translate(-50%, -50%)"
5285
+ },
5286
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx30("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx30("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px]", children: /* @__PURE__ */ jsx30("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
5287
+ (inputPart, index) => /* @__PURE__ */ jsx30(
5288
+ "span",
5289
+ {
5290
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5291
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx30("span", { className: "text-2xl", children: /* @__PURE__ */ jsx30(InlineMath5, { math: inputPart.value }) }) : inputPart.value
5292
+ },
5293
+ index
5294
+ )
5295
+ ) }) }) }) : /* @__PURE__ */ jsx30("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx30(
5296
+ ShowMaterialMediaByContentType_default,
5297
+ {
5298
+ contentType: contentMap.type,
5299
+ src: draggedValue,
5300
+ canFullScreen: false
5301
+ },
5302
+ `${uniqueValue}-drag-mouse`
5303
+ ) })
5304
+ }
5305
+ ),
5205
5306
  draggedValue && touchPosition.x > 0 && /* @__PURE__ */ jsx30(
5206
5307
  "div",
5207
5308
  {
@@ -5227,7 +5328,7 @@ var GroupingActivityMaterialContent = ({
5227
5328
  src: draggedValue,
5228
5329
  canFullScreen: false
5229
5330
  },
5230
- `${uniqueValue}-drag`
5331
+ `${uniqueValue}-drag-touch`
5231
5332
  ) })
5232
5333
  }
5233
5334
  ),
@@ -5436,6 +5537,10 @@ var MatchingActivityMaterialContent = ({
5436
5537
  const [isShuffled, setIsShuffled] = useState20(false);
5437
5538
  const [shuffledMaterialList, setShuffledMaterialList] = useState20([]);
5438
5539
  const dragElementRef = useRef6(null);
5540
+ const [mousePosition, setMousePosition] = useState20({
5541
+ x: 0,
5542
+ y: 0
5543
+ });
5439
5544
  const [touchPosition, setTouchPosition] = useState20({
5440
5545
  x: 0,
5441
5546
  y: 0
@@ -5494,6 +5599,19 @@ var MatchingActivityMaterialContent = ({
5494
5599
  e.preventDefault();
5495
5600
  setDraggedValue(materialValue);
5496
5601
  setSelectedValue(null);
5602
+ setMousePosition({ x: e.clientX, y: e.clientY });
5603
+ };
5604
+ const handleMouseMove = (e) => {
5605
+ if (!draggedValue) return;
5606
+ setMousePosition({ x: e.clientX, y: e.clientY });
5607
+ const elementUnder = document.elementFromPoint(e.clientX, e.clientY);
5608
+ const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-matching-drop-zone]");
5609
+ if (dropZone) {
5610
+ const dropKey = dropZone.getAttribute("data-matching-drop-zone");
5611
+ setDropTargetKey(dropKey);
5612
+ } else {
5613
+ setDropTargetKey(null);
5614
+ }
5497
5615
  };
5498
5616
  const handleMouseUp = () => {
5499
5617
  if (dropTargetKey !== null && draggedValue !== null) {
@@ -5501,6 +5619,7 @@ var MatchingActivityMaterialContent = ({
5501
5619
  }
5502
5620
  setDraggedValue(null);
5503
5621
  setDropTargetKey(null);
5622
+ setMousePosition({ x: 0, y: 0 });
5504
5623
  };
5505
5624
  const handleTouchStart = (e, materialValue, element) => {
5506
5625
  if (!checkCanAnswerQuestion()) return;
@@ -5533,6 +5652,7 @@ var MatchingActivityMaterialContent = ({
5533
5652
  setDraggedValue(null);
5534
5653
  setDropTargetKey(null);
5535
5654
  setDraggedElement(null);
5655
+ setTouchPosition({ x: 0, y: 0 });
5536
5656
  };
5537
5657
  const handleSelectItem = (materialValue) => {
5538
5658
  if (!checkCanAnswerQuestion()) return;
@@ -5547,7 +5667,36 @@ var MatchingActivityMaterialContent = ({
5547
5667
  };
5548
5668
  const answerMap = retrieveAnswerMap();
5549
5669
  const filteredMaterialList = retrieveFilteredMaterialList(answerMap);
5550
- return /* @__PURE__ */ jsxs21("div", { onMouseUp: handleMouseUp, children: [
5670
+ return /* @__PURE__ */ jsxs21("div", { onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, children: [
5671
+ draggedValue && mousePosition.x > 0 && /* @__PURE__ */ jsx32(
5672
+ "div",
5673
+ {
5674
+ className: "fixed pointer-events-none z-50 opacity-80",
5675
+ style: {
5676
+ left: `${mousePosition.x}px`,
5677
+ top: `${mousePosition.y}px`,
5678
+ transform: "translate(-50%, -50%)"
5679
+ },
5680
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx32("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx32("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] px-4", children: /* @__PURE__ */ jsx32("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
5681
+ (inputPart, index) => /* @__PURE__ */ jsx32(
5682
+ "span",
5683
+ {
5684
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
5685
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx32("span", { className: "text-xl", children: /* @__PURE__ */ jsx32(InlineMath6, { math: inputPart.value }) }) : inputPart.value
5686
+ },
5687
+ index
5688
+ )
5689
+ ) }) }) }) : /* @__PURE__ */ jsx32("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx32(
5690
+ ShowMaterialMediaByContentType_default,
5691
+ {
5692
+ contentType: contentMap.type,
5693
+ src: draggedValue,
5694
+ canFullScreen: false
5695
+ },
5696
+ `${uniqueValue}-drag-mouse`
5697
+ ) })
5698
+ }
5699
+ ),
5551
5700
  draggedValue && touchPosition.x > 0 && /* @__PURE__ */ jsx32(
5552
5701
  "div",
5553
5702
  {
@@ -5573,7 +5722,7 @@ var MatchingActivityMaterialContent = ({
5573
5722
  src: draggedValue,
5574
5723
  canFullScreen: false
5575
5724
  },
5576
- `${uniqueValue}-drag`
5725
+ `${uniqueValue}-drag-touch`
5577
5726
  ) })
5578
5727
  }
5579
5728
  ),
@@ -6294,6 +6443,10 @@ var OrderingActivityMaterialContent = ({
6294
6443
  null
6295
6444
  );
6296
6445
  const dragElementRef = useRef7(null);
6446
+ const [mousePosition, setMousePosition] = useState22({
6447
+ x: 0,
6448
+ y: 0
6449
+ });
6297
6450
  const [touchPosition, setTouchPosition] = useState22({
6298
6451
  x: 0,
6299
6452
  y: 0
@@ -6355,6 +6508,19 @@ var OrderingActivityMaterialContent = ({
6355
6508
  e.preventDefault();
6356
6509
  setDraggedKey(materialKey);
6357
6510
  setSelectedKey(null);
6511
+ setMousePosition({ x: e.clientX, y: e.clientY });
6512
+ };
6513
+ const handleMouseMove = (e) => {
6514
+ if (!draggedKey) return;
6515
+ setMousePosition({ x: e.clientX, y: e.clientY });
6516
+ const elementUnder = document.elementFromPoint(e.clientX, e.clientY);
6517
+ const dropZone = elementUnder == null ? void 0 : elementUnder.closest("[data-ordering-drop-zone]");
6518
+ if (dropZone) {
6519
+ const dropKey = dropZone.getAttribute("data-ordering-drop-zone");
6520
+ setDropTargetKey(dropKey);
6521
+ } else {
6522
+ setDropTargetKey(null);
6523
+ }
6358
6524
  };
6359
6525
  const handleMouseUp = () => {
6360
6526
  if (dropTargetKey !== null && draggedKey !== null && dropTargetKey !== draggedKey) {
@@ -6362,6 +6528,7 @@ var OrderingActivityMaterialContent = ({
6362
6528
  }
6363
6529
  setDraggedKey(null);
6364
6530
  setDropTargetKey(null);
6531
+ setMousePosition({ x: 0, y: 0 });
6365
6532
  };
6366
6533
  const handleTouchStart = (e, materialKey, element) => {
6367
6534
  if (!checkCanAnswerQuestion()) return;
@@ -6394,6 +6561,7 @@ var OrderingActivityMaterialContent = ({
6394
6561
  setDraggedKey(null);
6395
6562
  setDropTargetKey(null);
6396
6563
  setDraggedElement(null);
6564
+ setTouchPosition({ x: 0, y: 0 });
6397
6565
  };
6398
6566
  const handleSelectItem = (materialKey) => {
6399
6567
  if (!checkCanAnswerQuestion()) return;
@@ -6408,100 +6576,137 @@ var OrderingActivityMaterialContent = ({
6408
6576
  setDraggedKey(null);
6409
6577
  };
6410
6578
  const answerMap = retrieveAnswerMap();
6411
- return /* @__PURE__ */ jsxs29("div", { className: "flex flex-row flex-wrap", onMouseUp: handleMouseUp, children: [
6412
- draggedKey && touchPosition.x > 0 && /* @__PURE__ */ jsx40(
6413
- "div",
6414
- {
6415
- className: "fixed pointer-events-none z-50 opacity-80",
6416
- style: {
6417
- left: `${touchPosition.x}px`,
6418
- top: `${touchPosition.y}px`,
6419
- transform: "translate(-50%, -50%)"
6420
- },
6421
- children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx40("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx40("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
6422
- materialMap[answerMap[draggedKey]]
6423
- ).map((inputPart, index) => /* @__PURE__ */ jsx40(
6424
- "span",
6579
+ return /* @__PURE__ */ jsxs29(
6580
+ "div",
6581
+ {
6582
+ className: "flex flex-row flex-wrap",
6583
+ onMouseMove: handleMouseMove,
6584
+ onMouseUp: handleMouseUp,
6585
+ children: [
6586
+ draggedKey && mousePosition.x > 0 && /* @__PURE__ */ jsx40(
6587
+ "div",
6425
6588
  {
6426
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6427
- children: inputPart.isEquation ? /* @__PURE__ */ jsx40("span", { className: "text-xl", children: /* @__PURE__ */ jsx40(InlineMath9, { math: inputPart.value }) }) : inputPart.value
6428
- },
6429
- index
6430
- )) }) }) : /* @__PURE__ */ jsx40("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx40(
6431
- ShowMaterialMediaByContentType_default,
6589
+ className: "fixed pointer-events-none z-50 opacity-80",
6590
+ style: {
6591
+ left: `${mousePosition.x}px`,
6592
+ top: `${mousePosition.y}px`,
6593
+ transform: "translate(-50%, -50%)"
6594
+ },
6595
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx40("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx40("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
6596
+ materialMap[answerMap[draggedKey]]
6597
+ ).map((inputPart, index) => /* @__PURE__ */ jsx40(
6598
+ "span",
6599
+ {
6600
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6601
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx40("span", { className: "text-xl", children: /* @__PURE__ */ jsx40(InlineMath9, { math: inputPart.value }) }) : inputPart.value
6602
+ },
6603
+ index
6604
+ )) }) }) : /* @__PURE__ */ jsx40("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx40(
6605
+ ShowMaterialMediaByContentType_default,
6606
+ {
6607
+ contentType: contentMap.type,
6608
+ src: materialMap[answerMap[draggedKey]],
6609
+ canFullScreen: false
6610
+ },
6611
+ `${uniqueValue}-drag-mouse`
6612
+ ) })
6613
+ }
6614
+ ),
6615
+ draggedKey && touchPosition.x > 0 && /* @__PURE__ */ jsx40(
6616
+ "div",
6432
6617
  {
6433
- contentType: contentMap.type,
6434
- src: materialMap[answerMap[draggedKey]],
6435
- canFullScreen: false
6436
- },
6437
- `${uniqueValue}-drag`
6438
- ) })
6439
- }
6440
- ),
6441
- Object.keys(answerMap).map((materialKey, index) => {
6442
- const learnerAnswerState = checkAnswerState(
6443
- answerMap[materialKey] + "",
6444
- index + ""
6445
- );
6446
- return /* @__PURE__ */ jsx40("div", { className: "w-full lg:w-1/2", children: /* @__PURE__ */ jsxs29(
6447
- "div",
6448
- {
6449
- className: `flex flex-row items-center my-4 mx-2`,
6450
- style: {
6451
- marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
6452
- },
6453
- children: [
6454
- /* @__PURE__ */ jsx40("div", { className: "mr-3", children: /* @__PURE__ */ jsx40("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__ */ jsx40(
6455
- "div",
6618
+ className: "fixed pointer-events-none z-50 opacity-80",
6619
+ style: {
6620
+ left: `${touchPosition.x}px`,
6621
+ top: `${touchPosition.y}px`,
6622
+ transform: "translate(-50%, -50%)"
6623
+ },
6624
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx40("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx40("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
6625
+ materialMap[answerMap[draggedKey]]
6626
+ ).map((inputPart, index) => /* @__PURE__ */ jsx40(
6627
+ "span",
6456
6628
  {
6457
- 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]`,
6458
- children: /* @__PURE__ */ jsx40("p", { className: "", children: parseFloat(materialKey) + 1 })
6459
- }
6460
- ) }) }),
6461
- /* @__PURE__ */ jsx40(
6462
- "div",
6629
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6630
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx40("span", { className: "text-xl", children: /* @__PURE__ */ jsx40(InlineMath9, { math: inputPart.value }) }) : inputPart.value
6631
+ },
6632
+ index
6633
+ )) }) }) : /* @__PURE__ */ jsx40("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx40(
6634
+ ShowMaterialMediaByContentType_default,
6463
6635
  {
6464
- ref: draggedKey === materialKey ? dragElementRef : null,
6465
- "data-ordering-drop-zone": materialKey,
6466
- className: `flex-1 ${draggedKey === materialKey ? "opacity-40" : selectedKey === materialKey ? "ring-2 ring-blue-500" : "opacity-100"} ${dropTargetKey === materialKey && draggedKey !== materialKey ? "ring-2 ring-blue-400 bg-blue-50" : ""} transition-all duration-200`,
6467
- onMouseDown: (e) => handleMouseDown(e, materialKey),
6468
- onMouseEnter: () => draggedKey && draggedKey !== materialKey && setDropTargetKey(materialKey),
6469
- onMouseLeave: () => setDropTargetKey(null),
6470
- onTouchStart: (e) => handleTouchStart(e, materialKey, e.currentTarget),
6471
- onTouchMove: handleTouchMove,
6472
- onTouchEnd: handleTouchEnd,
6473
- children: /* @__PURE__ */ jsx40(
6636
+ contentType: contentMap.type,
6637
+ src: materialMap[answerMap[draggedKey]],
6638
+ canFullScreen: false
6639
+ },
6640
+ `${uniqueValue}-drag-touch`
6641
+ ) })
6642
+ }
6643
+ ),
6644
+ Object.keys(answerMap).map((materialKey, index) => {
6645
+ const learnerAnswerState = checkAnswerState(
6646
+ answerMap[materialKey] + "",
6647
+ index + ""
6648
+ );
6649
+ return /* @__PURE__ */ jsx40("div", { className: "w-full lg:w-1/2", children: /* @__PURE__ */ jsxs29(
6650
+ "div",
6651
+ {
6652
+ className: `flex flex-row items-center my-4 mx-2`,
6653
+ style: {
6654
+ marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
6655
+ },
6656
+ children: [
6657
+ /* @__PURE__ */ jsx40("div", { className: "mr-3", children: /* @__PURE__ */ jsx40("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__ */ jsx40(
6474
6658
  "div",
6475
6659
  {
6476
- className: `${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"} flex flex-col items-center justify-center border-2 rounded-catchup-xlarge cursor-pointer p-3 ${learnerAnswerState === "CORRECT" ? "border-catchup-green" : learnerAnswerState === "INCORRECT" ? "border-catchup-red" : "border-catchup-blue"}`,
6477
- onClick: () => handleSelectItem(materialKey),
6478
- children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx40("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
6479
- materialMap[answerMap[materialKey]]
6480
- ).map((inputPart, index2) => /* @__PURE__ */ jsx40(
6481
- "span",
6482
- {
6483
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6484
- children: inputPart.isEquation ? /* @__PURE__ */ jsx40("span", { className: "text-xl", children: /* @__PURE__ */ jsx40(InlineMath9, { math: inputPart.value }) }) : inputPart.value
6485
- },
6486
- index2
6487
- )) }) : /* @__PURE__ */ jsx40(
6488
- ShowMaterialMediaByContentType_default,
6660
+ 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]`,
6661
+ children: /* @__PURE__ */ jsx40("p", { className: "", children: parseFloat(materialKey) + 1 })
6662
+ }
6663
+ ) }) }),
6664
+ /* @__PURE__ */ jsx40(
6665
+ "div",
6666
+ {
6667
+ ref: draggedKey === materialKey ? dragElementRef : null,
6668
+ "data-ordering-drop-zone": materialKey,
6669
+ className: `flex-1 ${draggedKey === materialKey ? "opacity-40" : selectedKey === materialKey ? "ring-2 ring-blue-500" : "opacity-100"} ${dropTargetKey === materialKey && draggedKey !== materialKey ? "ring-2 ring-blue-400 bg-blue-50" : ""} transition-all duration-200`,
6670
+ onMouseDown: (e) => handleMouseDown(e, materialKey),
6671
+ onMouseEnter: () => draggedKey && draggedKey !== materialKey && setDropTargetKey(materialKey),
6672
+ onMouseLeave: () => setDropTargetKey(null),
6673
+ onTouchStart: (e) => handleTouchStart(e, materialKey, e.currentTarget),
6674
+ onTouchMove: handleTouchMove,
6675
+ onTouchEnd: handleTouchEnd,
6676
+ children: /* @__PURE__ */ jsx40(
6677
+ "div",
6489
6678
  {
6490
- contentType: contentMap.type,
6491
- src: materialMap[answerMap[materialKey]],
6492
- canFullScreen: true
6493
- },
6494
- `${uniqueValue}-${index}`
6679
+ className: `${contentMap.type === "TEXT" ? "h-catchup-activity-text-box-item" : "h-catchup-activity-media-box-item"} flex flex-col items-center justify-center border-2 rounded-catchup-xlarge cursor-pointer p-3 ${learnerAnswerState === "CORRECT" ? "border-catchup-green" : learnerAnswerState === "INCORRECT" ? "border-catchup-red" : "border-catchup-blue"}`,
6680
+ onClick: () => handleSelectItem(materialKey),
6681
+ children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx40("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
6682
+ materialMap[answerMap[materialKey]]
6683
+ ).map((inputPart, index2) => /* @__PURE__ */ jsx40(
6684
+ "span",
6685
+ {
6686
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6687
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx40("span", { className: "text-xl", children: /* @__PURE__ */ jsx40(InlineMath9, { math: inputPart.value }) }) : inputPart.value
6688
+ },
6689
+ index2
6690
+ )) }) : /* @__PURE__ */ jsx40(
6691
+ ShowMaterialMediaByContentType_default,
6692
+ {
6693
+ contentType: contentMap.type,
6694
+ src: materialMap[answerMap[materialKey]],
6695
+ canFullScreen: true
6696
+ },
6697
+ `${uniqueValue}-${index}`
6698
+ )
6699
+ }
6495
6700
  )
6496
6701
  }
6497
6702
  )
6498
- }
6499
- )
6500
- ]
6501
- }
6502
- ) }, index);
6503
- })
6504
- ] });
6703
+ ]
6704
+ }
6705
+ ) }, index);
6706
+ })
6707
+ ]
6708
+ }
6709
+ );
6505
6710
  };
6506
6711
  var OrderingActivityMaterialContent_default = OrderingActivityMaterialContent;
6507
6712