catchup-library-web 1.20.30 → 1.20.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +306 -288
- package/dist/index.mjs +246 -228
- package/package.json +1 -1
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +189 -183
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent2.tsx +306 -0
package/dist/index.mjs
CHANGED
|
@@ -4644,95 +4644,34 @@ var DropdownActivityContent_default = DropdownActivityContent;
|
|
|
4644
4644
|
|
|
4645
4645
|
// src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
|
|
4646
4646
|
import { InlineMath as InlineMath4 } from "react-katex";
|
|
4647
|
-
import { useState as useState17 } from "react";
|
|
4648
|
-
import { useEffect as useEffect8 } from "react";
|
|
4649
|
-
import { useDrop as useDrop2 } from "react-dnd";
|
|
4650
|
-
|
|
4651
|
-
// src/components/dnds/DraggableItem.tsx
|
|
4652
|
-
import { useDrag } from "react-dnd";
|
|
4653
|
-
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
4654
|
-
var DraggableItem = ({
|
|
4655
|
-
item,
|
|
4656
|
-
type,
|
|
4657
|
-
component,
|
|
4658
|
-
moveCardHandler
|
|
4659
|
-
}) => {
|
|
4660
|
-
const [{ isDragging }, drag] = useDrag({
|
|
4661
|
-
type,
|
|
4662
|
-
item,
|
|
4663
|
-
end: (item2, monitor) => {
|
|
4664
|
-
const dropResult = monitor.getDropResult();
|
|
4665
|
-
if (dropResult) {
|
|
4666
|
-
moveCardHandler();
|
|
4667
|
-
}
|
|
4668
|
-
},
|
|
4669
|
-
collect: (monitor) => ({
|
|
4670
|
-
isDragging: monitor.isDragging()
|
|
4671
|
-
})
|
|
4672
|
-
});
|
|
4673
|
-
const opacity = isDragging ? 0.4 : 1;
|
|
4674
|
-
return /* @__PURE__ */ jsx27(
|
|
4675
|
-
"div",
|
|
4676
|
-
{
|
|
4677
|
-
className: `${isDragging ? "w-[0px] opacity-0" : "opacity-100"} transition-all duration-500`,
|
|
4678
|
-
children: /* @__PURE__ */ jsx27("div", { ref: drag, className: "", style: { opacity }, children: component })
|
|
4679
|
-
}
|
|
4680
|
-
);
|
|
4681
|
-
};
|
|
4682
|
-
var DraggableItem_default = DraggableItem;
|
|
4683
|
-
|
|
4684
|
-
// src/components/dnds/DroppableItem.tsx
|
|
4685
|
-
import { useRef as useRef4 } from "react";
|
|
4686
|
-
import { useDrop } from "react-dnd";
|
|
4687
|
-
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
4688
|
-
var DroppableItem = ({
|
|
4689
|
-
item,
|
|
4690
|
-
type,
|
|
4691
|
-
component,
|
|
4692
|
-
dropRef,
|
|
4693
|
-
target,
|
|
4694
|
-
setTarget
|
|
4695
|
-
}) => {
|
|
4696
|
-
const ref = useRef4(null);
|
|
4697
|
-
const [, drop] = useDrop({
|
|
4698
|
-
accept: type,
|
|
4699
|
-
hover() {
|
|
4700
|
-
if (item.index !== null && target !== item.index) {
|
|
4701
|
-
setTarget(item.index);
|
|
4702
|
-
}
|
|
4703
|
-
}
|
|
4704
|
-
});
|
|
4705
|
-
dropRef(drop(ref));
|
|
4706
|
-
return /* @__PURE__ */ jsx28("div", { className: `w-full transition-all duration-500 h-full`, ref, children: component });
|
|
4707
|
-
};
|
|
4708
|
-
var DroppableItem_default = DroppableItem;
|
|
4647
|
+
import { useState as useState17, useEffect as useEffect8 } from "react";
|
|
4709
4648
|
|
|
4710
4649
|
// src/components/texts/InputWithSpecialExpression.tsx
|
|
4711
4650
|
import { InlineMath as InlineMath3 } from "react-katex";
|
|
4712
|
-
import { jsx as
|
|
4651
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
4713
4652
|
var InputWithSpecialExpression = ({
|
|
4714
4653
|
value,
|
|
4715
4654
|
showSpecialOnly
|
|
4716
4655
|
}) => {
|
|
4717
4656
|
const inputWithSpecialExpressionList = constructInputWithSpecialExpressionList(value);
|
|
4718
|
-
return showSpecialOnly ? inputWithSpecialExpressionList.length > 1 ? /* @__PURE__ */
|
|
4657
|
+
return showSpecialOnly ? inputWithSpecialExpressionList.length > 1 ? /* @__PURE__ */ jsx27("div", { className: "m-2", children: /* @__PURE__ */ jsx27("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ jsx27(
|
|
4719
4658
|
"span",
|
|
4720
4659
|
{
|
|
4721
4660
|
className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4722
|
-
children: inputPart.isEquation ? /* @__PURE__ */
|
|
4661
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx27("span", { className: "text-lg", children: /* @__PURE__ */ jsx27(InlineMath3, { math: inputPart.value }, index) }) : inputPart.value
|
|
4723
4662
|
}
|
|
4724
|
-
)) }) }) : null : /* @__PURE__ */
|
|
4663
|
+
)) }) }) : null : /* @__PURE__ */ jsx27("div", { className: "m-2", children: /* @__PURE__ */ jsx27("span", { className: "whitespace-pre-wrap", children: inputWithSpecialExpressionList.map((inputPart, index) => /* @__PURE__ */ jsx27(
|
|
4725
4664
|
"span",
|
|
4726
4665
|
{
|
|
4727
4666
|
className: `${inputPart.isBold ? "font-semibold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4728
|
-
children: inputPart.isEquation ? /* @__PURE__ */
|
|
4667
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx27("span", { className: "text-lg", children: /* @__PURE__ */ jsx27(InlineMath3, { math: inputPart.value }, index) }) : inputPart.value
|
|
4729
4668
|
}
|
|
4730
4669
|
)) }) });
|
|
4731
4670
|
};
|
|
4732
4671
|
var InputWithSpecialExpression_default = InputWithSpecialExpression;
|
|
4733
4672
|
|
|
4734
4673
|
// src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx
|
|
4735
|
-
import { jsx as
|
|
4674
|
+
import { jsx as jsx28, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4736
4675
|
var FillInTheBlanksActivityMaterialContent = ({
|
|
4737
4676
|
uniqueValue,
|
|
4738
4677
|
answer,
|
|
@@ -4746,16 +4685,8 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4746
4685
|
}) => {
|
|
4747
4686
|
const [shuffleOptionList, setShuffleOptionList] = useState17([]);
|
|
4748
4687
|
const [selectedOption, setSelectedOption] = useState17(null);
|
|
4749
|
-
const [
|
|
4750
|
-
const [
|
|
4751
|
-
accept: "FILL_IN_THE_BLANKS",
|
|
4752
|
-
drop: () => {
|
|
4753
|
-
},
|
|
4754
|
-
collect: (monitor) => ({
|
|
4755
|
-
isOver: monitor.isOver(),
|
|
4756
|
-
canDrop: monitor.canDrop()
|
|
4757
|
-
})
|
|
4758
|
-
});
|
|
4688
|
+
const [draggedOption, setDraggedOption] = useState17(null);
|
|
4689
|
+
const [dropTargetIndex, setDropTargetIndex] = useState17(null);
|
|
4759
4690
|
useEffect8(() => {
|
|
4760
4691
|
setShuffleOptionList(shuffleArray(optionList));
|
|
4761
4692
|
}, []);
|
|
@@ -4792,165 +4723,191 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4792
4723
|
};
|
|
4793
4724
|
const handleSelectOption = (option) => {
|
|
4794
4725
|
setSelectedOption(option);
|
|
4795
|
-
|
|
4726
|
+
};
|
|
4727
|
+
const handleDragStart = (option) => {
|
|
4728
|
+
setDraggedOption(option);
|
|
4729
|
+
};
|
|
4730
|
+
const handleDragEnd = () => {
|
|
4731
|
+
if (dropTargetIndex !== null && draggedOption !== null) {
|
|
4732
|
+
onChange(answer, dropTargetIndex, draggedOption);
|
|
4733
|
+
}
|
|
4734
|
+
setDraggedOption(null);
|
|
4735
|
+
setDropTargetIndex(null);
|
|
4736
|
+
};
|
|
4737
|
+
const handleDropZoneEnter = (index) => {
|
|
4738
|
+
setDropTargetIndex(index);
|
|
4739
|
+
};
|
|
4740
|
+
const handleDropZoneDrop = (index) => {
|
|
4741
|
+
if (selectedOption !== null) {
|
|
4742
|
+
onChange(answer, index, selectedOption);
|
|
4743
|
+
setSelectedOption(null);
|
|
4744
|
+
} else if (draggedOption !== null) {
|
|
4745
|
+
onChange(answer, index, draggedOption);
|
|
4746
|
+
setDraggedOption(null);
|
|
4747
|
+
}
|
|
4748
|
+
setDropTargetIndex(null);
|
|
4796
4749
|
};
|
|
4797
4750
|
const answerMap = retrieveAnswerMap();
|
|
4798
|
-
return /* @__PURE__ */ jsxs17(
|
|
4799
|
-
"div",
|
|
4800
|
-
{
|
|
4801
|
-
|
|
4802
|
-
children:
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4751
|
+
return /* @__PURE__ */ jsxs17("div", { className: "flex flex-row flex-wrap items-center", children: [
|
|
4752
|
+
/* @__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") }) }),
|
|
4753
|
+
/* @__PURE__ */ jsx28("div", { className: "hidden md:contents", children: /* @__PURE__ */ jsx28(DividerLine_default, {}) }),
|
|
4754
|
+
/* @__PURE__ */ jsx28("div", { className: "w-full flex flex-row flex-wrap gap-x-2 gap-y-2 my-2", children: shuffleOptionList.map(
|
|
4755
|
+
(option, index) => checkAnswerProvided(answerMap, option) ? /* @__PURE__ */ jsx28("div", { className: "opacity-30", children: /* @__PURE__ */ jsx28(
|
|
4756
|
+
ShowMaterialMediaByContentType_default,
|
|
4757
|
+
{
|
|
4758
|
+
contentType: contentMap.type,
|
|
4759
|
+
src: option,
|
|
4760
|
+
canFullScreen: true
|
|
4761
|
+
},
|
|
4762
|
+
`${uniqueValue}-${index}`
|
|
4763
|
+
) }, index) : /* @__PURE__ */ jsx28(
|
|
4764
|
+
"div",
|
|
4765
|
+
{
|
|
4766
|
+
draggable: true,
|
|
4767
|
+
onDragStart: () => handleDragStart(option),
|
|
4768
|
+
onDragEnd: handleDragEnd,
|
|
4769
|
+
className: `${draggedOption === option ? "opacity-40" : "opacity-100"} transition-opacity duration-200`,
|
|
4770
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx28(
|
|
4771
|
+
"div",
|
|
4808
4772
|
{
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4773
|
+
className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge cursor-pointer select-none touch-none",
|
|
4774
|
+
onClick: () => handleSelectOption(option),
|
|
4775
|
+
onTouchEnd: () => handleSelectOption(option),
|
|
4776
|
+
children: /* @__PURE__ */ jsx28("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx28(
|
|
4777
|
+
InputWithSpecialExpression_default,
|
|
4778
|
+
{
|
|
4779
|
+
value: option,
|
|
4780
|
+
showSpecialOnly: false
|
|
4781
|
+
}
|
|
4782
|
+
) })
|
|
4783
|
+
}
|
|
4784
|
+
) : /* @__PURE__ */ jsx28(
|
|
4785
|
+
"div",
|
|
4816
4786
|
{
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4787
|
+
className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge cursor-pointer select-none touch-none",
|
|
4788
|
+
onClick: () => handleSelectOption(option),
|
|
4789
|
+
onTouchEnd: () => handleSelectOption(option),
|
|
4790
|
+
children: /* @__PURE__ */ jsx28(
|
|
4791
|
+
ShowMaterialMediaByContentType_default,
|
|
4792
|
+
{
|
|
4793
|
+
contentType: contentMap.type,
|
|
4794
|
+
src: option,
|
|
4795
|
+
canFullScreen: true
|
|
4796
|
+
},
|
|
4797
|
+
`${uniqueValue}-${index}`
|
|
4798
|
+
)
|
|
4799
|
+
}
|
|
4800
|
+
)
|
|
4801
|
+
},
|
|
4802
|
+
index
|
|
4803
|
+
)
|
|
4804
|
+
) }),
|
|
4805
|
+
/* @__PURE__ */ jsx28("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(answerMap).map((materialKey, index) => {
|
|
4806
|
+
const learnerAnswerState = checkAnswerState(
|
|
4807
|
+
JSON.parse(materialMap[materialKey]),
|
|
4808
|
+
answerMap[materialKey]
|
|
4809
|
+
);
|
|
4810
|
+
return /* @__PURE__ */ jsx28("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ jsx28("div", { className: "mx-2", children: /* @__PURE__ */ jsx28(
|
|
4811
|
+
"div",
|
|
4812
|
+
{
|
|
4813
|
+
onDragOver: (e) => {
|
|
4814
|
+
e.preventDefault();
|
|
4815
|
+
handleDropZoneEnter(materialKey);
|
|
4816
|
+
},
|
|
4817
|
+
onDragLeave: () => setDropTargetIndex(null),
|
|
4818
|
+
onDrop: (e) => {
|
|
4819
|
+
e.preventDefault();
|
|
4820
|
+
handleDropZoneDrop(materialKey);
|
|
4821
|
+
},
|
|
4822
|
+
onClick: () => {
|
|
4823
|
+
if (selectedOption !== null) {
|
|
4824
|
+
handleDropZoneDrop(materialKey);
|
|
4825
|
+
}
|
|
4826
|
+
},
|
|
4827
|
+
className: `${dropTargetIndex === materialKey ? "ring-2 ring-blue-400" : ""}`,
|
|
4828
|
+
children: /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
|
|
4829
|
+
/* @__PURE__ */ jsx28("div", { className: "my-auto", children: /* @__PURE__ */ jsxs17("p", { className: "text-xl", children: [
|
|
4830
|
+
parseFloat(materialKey) + 1,
|
|
4831
|
+
"."
|
|
4832
|
+
] }) }),
|
|
4833
|
+
/* @__PURE__ */ jsx28("div", { className: "flex-1", children: checkCanAnswerQuestion() ? contentMap.type === "TEXT" ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
|
|
4834
|
+
/* @__PURE__ */ jsx28("div", { className: "flex-1", children: /* @__PURE__ */ jsx28(
|
|
4820
4835
|
"div",
|
|
4821
4836
|
{
|
|
4822
|
-
className: "border-catchup-blue
|
|
4823
|
-
onClick: () =>
|
|
4824
|
-
|
|
4837
|
+
className: `w-full min-h-[44px] border rounded-lg ${answerMap[materialKey] ? "border-catchup-blue-400 px-2" : "bg-catchup-gray-50 border-catchup-gray-200 border-dashed py-2 px-4"}`,
|
|
4838
|
+
onClick: () => {
|
|
4839
|
+
if (answerMap[materialKey]) {
|
|
4840
|
+
onChange(answer, materialKey, "");
|
|
4841
|
+
}
|
|
4842
|
+
},
|
|
4843
|
+
children: answerMap[materialKey] ? /* @__PURE__ */ jsx28(
|
|
4825
4844
|
InputWithSpecialExpression_default,
|
|
4826
4845
|
{
|
|
4827
|
-
value:
|
|
4846
|
+
value: answerMap[materialKey],
|
|
4828
4847
|
showSpecialOnly: false
|
|
4829
4848
|
}
|
|
4830
|
-
) })
|
|
4849
|
+
) : /* @__PURE__ */ jsx28("p", { className: "text-gray-400 italic" })
|
|
4831
4850
|
}
|
|
4832
|
-
)
|
|
4833
|
-
|
|
4851
|
+
) }),
|
|
4852
|
+
learnerAnswerState === "CORRECT" ? /* @__PURE__ */ jsx28("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx28(
|
|
4853
|
+
BaseImage_default,
|
|
4834
4854
|
{
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
ShowMaterialMediaByContentType_default,
|
|
4839
|
-
{
|
|
4840
|
-
contentType: contentMap.type,
|
|
4841
|
-
src: option,
|
|
4842
|
-
canFullScreen: true
|
|
4843
|
-
},
|
|
4844
|
-
`${uniqueValue}-${index}`
|
|
4845
|
-
)
|
|
4855
|
+
src: "/icons/checkbox.webp",
|
|
4856
|
+
alt: "checkbox",
|
|
4857
|
+
size: "small"
|
|
4846
4858
|
}
|
|
4847
|
-
),
|
|
4848
|
-
|
|
4849
|
-
|
|
4859
|
+
) }) : learnerAnswerState === "INCORRECT" ? /* @__PURE__ */ jsx28("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx28(
|
|
4860
|
+
BaseImage_default,
|
|
4861
|
+
{
|
|
4862
|
+
src: "/icons/cross-red.webp",
|
|
4863
|
+
alt: "cross-red",
|
|
4864
|
+
size: "small"
|
|
4865
|
+
}
|
|
4866
|
+
) }) : null
|
|
4867
|
+
] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ jsx28(
|
|
4868
|
+
"div",
|
|
4869
|
+
{
|
|
4870
|
+
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"}`,
|
|
4871
|
+
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") }) })
|
|
4850
4872
|
}
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
return /* @__PURE__ */ jsx30("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ jsx30("div", { className: "mx-2", children: /* @__PURE__ */ jsx30(
|
|
4861
|
-
DroppableItem_default,
|
|
4862
|
-
{
|
|
4863
|
-
item: { index },
|
|
4864
|
-
type: "FILL_IN_THE_BLANKS",
|
|
4865
|
-
target: pasteOptionIndex,
|
|
4866
|
-
setTarget: setPasteOptionIndex,
|
|
4867
|
-
dropRef: drop,
|
|
4868
|
-
component: /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
|
|
4869
|
-
/* @__PURE__ */ jsx30("div", { className: "my-auto", children: /* @__PURE__ */ jsxs17("p", { className: "text-xl", children: [
|
|
4870
|
-
parseFloat(materialKey) + 1,
|
|
4871
|
-
"."
|
|
4872
|
-
] }) }),
|
|
4873
|
-
/* @__PURE__ */ jsx30("div", { className: "flex-1", children: checkCanAnswerQuestion() ? contentMap.type === "TEXT" ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
|
|
4874
|
-
/* @__PURE__ */ jsx30("div", { className: "flex-1", children: /* @__PURE__ */ jsx30(
|
|
4875
|
-
"div",
|
|
4876
|
-
{
|
|
4877
|
-
className: `w-full min-h-[44px] border rounded-lg ${answerMap[materialKey] ? "border-catchup-blue-400 px-2" : "bg-catchup-gray-50 border-catchup-gray-200 border-dashed py-2 px-4"}`,
|
|
4878
|
-
onClick: () => {
|
|
4879
|
-
if (answerMap[materialKey]) {
|
|
4880
|
-
onChange(answer, materialKey, "");
|
|
4881
|
-
}
|
|
4882
|
-
},
|
|
4883
|
-
children: answerMap[materialKey] ? /* @__PURE__ */ jsx30(
|
|
4884
|
-
InputWithSpecialExpression_default,
|
|
4885
|
-
{
|
|
4886
|
-
value: answerMap[materialKey],
|
|
4887
|
-
showSpecialOnly: false
|
|
4888
|
-
}
|
|
4889
|
-
) : /* @__PURE__ */ jsx30("p", { className: "text-gray-400 italic" })
|
|
4890
|
-
}
|
|
4891
|
-
) }),
|
|
4892
|
-
learnerAnswerState === "CORRECT" ? /* @__PURE__ */ jsx30("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx30(
|
|
4893
|
-
BaseImage_default,
|
|
4894
|
-
{
|
|
4895
|
-
src: "/icons/checkbox.webp",
|
|
4896
|
-
alt: "checkbox",
|
|
4897
|
-
size: "small"
|
|
4898
|
-
}
|
|
4899
|
-
) }) : learnerAnswerState === "INCORRECT" ? /* @__PURE__ */ jsx30("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx30(
|
|
4900
|
-
BaseImage_default,
|
|
4901
|
-
{
|
|
4902
|
-
src: "/icons/cross-red.webp",
|
|
4903
|
-
alt: "cross-red",
|
|
4904
|
-
size: "small"
|
|
4905
|
-
}
|
|
4906
|
-
) }) : null
|
|
4907
|
-
] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ jsx30(
|
|
4908
|
-
"div",
|
|
4909
|
-
{
|
|
4910
|
-
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"}`,
|
|
4911
|
-
children: /* @__PURE__ */ jsx30("div", { className: "h-full flex flex-col items-center justify-center px-4 py-2", children: /* @__PURE__ */ jsx30("span", { className: "italic", children: i18n_default.t("please_drop_here") }) })
|
|
4912
|
-
}
|
|
4913
|
-
) : /* @__PURE__ */ jsx30(
|
|
4914
|
-
"div",
|
|
4915
|
-
{
|
|
4916
|
-
className: "flex-1 cursor-pointer",
|
|
4917
|
-
onClick: () => {
|
|
4918
|
-
onChange(answer, materialKey, "");
|
|
4919
|
-
},
|
|
4920
|
-
children: /* @__PURE__ */ jsx30(
|
|
4921
|
-
ShowMaterialMediaByContentType_default,
|
|
4922
|
-
{
|
|
4923
|
-
contentType: contentMap.type,
|
|
4924
|
-
src: answerMap[materialKey],
|
|
4925
|
-
canFullScreen: true
|
|
4926
|
-
},
|
|
4927
|
-
`${uniqueValue}-${index}`
|
|
4928
|
-
)
|
|
4929
|
-
}
|
|
4930
|
-
) : /* @__PURE__ */ jsx30("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
|
|
4931
|
-
answerMap[materialKey]
|
|
4932
|
-
).map((inputPart, index2) => /* @__PURE__ */ jsx30(
|
|
4933
|
-
"span",
|
|
4873
|
+
) : /* @__PURE__ */ jsx28(
|
|
4874
|
+
"div",
|
|
4875
|
+
{
|
|
4876
|
+
className: "flex-1 cursor-pointer",
|
|
4877
|
+
onClick: () => {
|
|
4878
|
+
onChange(answer, materialKey, "");
|
|
4879
|
+
},
|
|
4880
|
+
children: /* @__PURE__ */ jsx28(
|
|
4881
|
+
ShowMaterialMediaByContentType_default,
|
|
4934
4882
|
{
|
|
4935
|
-
|
|
4936
|
-
|
|
4883
|
+
contentType: contentMap.type,
|
|
4884
|
+
src: answerMap[materialKey],
|
|
4885
|
+
canFullScreen: true
|
|
4937
4886
|
},
|
|
4938
|
-
|
|
4939
|
-
)
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4887
|
+
`${uniqueValue}-${index}`
|
|
4888
|
+
)
|
|
4889
|
+
}
|
|
4890
|
+
) : /* @__PURE__ */ jsx28("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
|
|
4891
|
+
answerMap[materialKey]
|
|
4892
|
+
).map((inputPart, index2) => /* @__PURE__ */ jsx28(
|
|
4893
|
+
"span",
|
|
4894
|
+
{
|
|
4895
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
4896
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx28("span", { className: "text-xl", children: /* @__PURE__ */ jsx28(InlineMath4, { math: inputPart.value }) }) : inputPart.value
|
|
4897
|
+
},
|
|
4898
|
+
index2
|
|
4899
|
+
)) }, materialKey) })
|
|
4900
|
+
] })
|
|
4901
|
+
}
|
|
4902
|
+
) }) }, index);
|
|
4903
|
+
}) })
|
|
4904
|
+
] });
|
|
4948
4905
|
};
|
|
4949
4906
|
var FillInTheBlanksActivityMaterialContent_default = FillInTheBlanksActivityMaterialContent;
|
|
4950
4907
|
|
|
4951
4908
|
// src/components/activities/FillInTheBlanksActivityContent.tsx
|
|
4952
4909
|
import { useState as useState18, useEffect as useEffect9 } from "react";
|
|
4953
|
-
import { jsx as
|
|
4910
|
+
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4954
4911
|
var FillInTheBlanksActivityContent = ({
|
|
4955
4912
|
answer,
|
|
4956
4913
|
data,
|
|
@@ -5019,7 +4976,7 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5019
4976
|
changeAnswer(newAnswer);
|
|
5020
4977
|
};
|
|
5021
4978
|
return /* @__PURE__ */ jsxs18("div", { className: "flex flex-row flex-wrap", children: [
|
|
5022
|
-
/* @__PURE__ */
|
|
4979
|
+
/* @__PURE__ */ jsx29("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[60%]"}`, children: /* @__PURE__ */ jsx29(
|
|
5023
4980
|
ActivityBodyContent_default,
|
|
5024
4981
|
{
|
|
5025
4982
|
bodyMap: fillInTheBlanksBodyMap,
|
|
@@ -5028,9 +4985,9 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5028
4985
|
templateType: "FILL_IN_THE_BLANKS"
|
|
5029
4986
|
}
|
|
5030
4987
|
) }),
|
|
5031
|
-
/* @__PURE__ */
|
|
5032
|
-
/* @__PURE__ */
|
|
5033
|
-
/* @__PURE__ */
|
|
4988
|
+
/* @__PURE__ */ jsx29("div", { className: `${isFullScreen ? "contents" : "contents md:hidden"}`, children: /* @__PURE__ */ jsx29(DividerLine_default, {}) }),
|
|
4989
|
+
/* @__PURE__ */ jsx29("div", { className: `${isFullScreen ? "hidden" : "hidden md:block"}`, children: /* @__PURE__ */ jsx29(VerticalDividerLine_default, {}) }),
|
|
4990
|
+
/* @__PURE__ */ jsx29("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ jsx29(
|
|
5034
4991
|
FillInTheBlanksActivityMaterialContent_default,
|
|
5035
4992
|
{
|
|
5036
4993
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -5050,8 +5007,69 @@ var FillInTheBlanksActivityContent_default = FillInTheBlanksActivityContent;
|
|
|
5050
5007
|
|
|
5051
5008
|
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
5052
5009
|
import { useEffect as useEffect10, useRef as useRef5, useState as useState19 } from "react";
|
|
5053
|
-
import { useDrop as
|
|
5010
|
+
import { useDrop as useDrop2 } from "react-dnd";
|
|
5054
5011
|
import { InlineMath as InlineMath5 } from "react-katex";
|
|
5012
|
+
|
|
5013
|
+
// src/components/dnds/DraggableItem.tsx
|
|
5014
|
+
import { useDrag } from "react-dnd";
|
|
5015
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
5016
|
+
var DraggableItem = ({
|
|
5017
|
+
item,
|
|
5018
|
+
type,
|
|
5019
|
+
component,
|
|
5020
|
+
moveCardHandler
|
|
5021
|
+
}) => {
|
|
5022
|
+
const [{ isDragging }, drag] = useDrag({
|
|
5023
|
+
type,
|
|
5024
|
+
item,
|
|
5025
|
+
end: (item2, monitor) => {
|
|
5026
|
+
const dropResult = monitor.getDropResult();
|
|
5027
|
+
if (dropResult) {
|
|
5028
|
+
moveCardHandler();
|
|
5029
|
+
}
|
|
5030
|
+
},
|
|
5031
|
+
collect: (monitor) => ({
|
|
5032
|
+
isDragging: monitor.isDragging()
|
|
5033
|
+
})
|
|
5034
|
+
});
|
|
5035
|
+
const opacity = isDragging ? 0.4 : 1;
|
|
5036
|
+
return /* @__PURE__ */ jsx30(
|
|
5037
|
+
"div",
|
|
5038
|
+
{
|
|
5039
|
+
className: `${isDragging ? "w-[0px] opacity-0" : "opacity-100"} transition-all duration-500`,
|
|
5040
|
+
children: /* @__PURE__ */ jsx30("div", { ref: drag, className: "", style: { opacity }, children: component })
|
|
5041
|
+
}
|
|
5042
|
+
);
|
|
5043
|
+
};
|
|
5044
|
+
var DraggableItem_default = DraggableItem;
|
|
5045
|
+
|
|
5046
|
+
// src/components/dnds/DroppableItem.tsx
|
|
5047
|
+
import { useRef as useRef4 } from "react";
|
|
5048
|
+
import { useDrop } from "react-dnd";
|
|
5049
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
5050
|
+
var DroppableItem = ({
|
|
5051
|
+
item,
|
|
5052
|
+
type,
|
|
5053
|
+
component,
|
|
5054
|
+
dropRef,
|
|
5055
|
+
target,
|
|
5056
|
+
setTarget
|
|
5057
|
+
}) => {
|
|
5058
|
+
const ref = useRef4(null);
|
|
5059
|
+
const [, drop] = useDrop({
|
|
5060
|
+
accept: type,
|
|
5061
|
+
hover() {
|
|
5062
|
+
if (item.index !== null && target !== item.index) {
|
|
5063
|
+
setTarget(item.index);
|
|
5064
|
+
}
|
|
5065
|
+
}
|
|
5066
|
+
});
|
|
5067
|
+
dropRef(drop(ref));
|
|
5068
|
+
return /* @__PURE__ */ jsx31("div", { className: `w-full transition-all duration-500 h-full`, ref, children: component });
|
|
5069
|
+
};
|
|
5070
|
+
var DroppableItem_default = DroppableItem;
|
|
5071
|
+
|
|
5072
|
+
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
5055
5073
|
import { Fragment as Fragment3, jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5056
5074
|
var GroupingActivityMaterialContent = ({
|
|
5057
5075
|
uniqueValue,
|
|
@@ -5067,7 +5085,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5067
5085
|
const [selectedTargetKey, setSelectedTargetKey] = useState19(null);
|
|
5068
5086
|
const [isShuffled, setIsShuffled] = useState19(false);
|
|
5069
5087
|
const [shuffledMaterialList, setShuffledMaterialList] = useState19([]);
|
|
5070
|
-
const [{ isOver, canDrop }, drop] =
|
|
5088
|
+
const [{ isOver, canDrop }, drop] = useDrop2({
|
|
5071
5089
|
accept: "GROUPING",
|
|
5072
5090
|
drop: () => {
|
|
5073
5091
|
},
|
|
@@ -5357,7 +5375,7 @@ var GroupingActivityContent_default = GroupingActivityContent;
|
|
|
5357
5375
|
|
|
5358
5376
|
// src/components/activities/material-contents/MatchingActivityMaterialContent.tsx
|
|
5359
5377
|
import { useEffect as useEffect11, useRef as useRef6, useState as useState20 } from "react";
|
|
5360
|
-
import { useDrop as
|
|
5378
|
+
import { useDrop as useDrop3 } from "react-dnd";
|
|
5361
5379
|
import { InlineMath as InlineMath6 } from "react-katex";
|
|
5362
5380
|
import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5363
5381
|
var MatchingActivityMaterialContent = ({
|
|
@@ -5374,7 +5392,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5374
5392
|
const [selectedTargetKey, setSelectedTargetKey] = useState20(null);
|
|
5375
5393
|
const [isShuffled, setIsShuffled] = useState20(false);
|
|
5376
5394
|
const [shuffledMaterialList, setShuffledMaterialList] = useState20([]);
|
|
5377
|
-
const [{ isOver, canDrop }, drop] =
|
|
5395
|
+
const [{ isOver, canDrop }, drop] = useDrop3({
|
|
5378
5396
|
accept: "MATCHING",
|
|
5379
5397
|
drop: () => {
|
|
5380
5398
|
},
|
|
@@ -6139,7 +6157,7 @@ var OpenEndedActivityContent_default = OpenEndedActivityContent;
|
|
|
6139
6157
|
|
|
6140
6158
|
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6141
6159
|
import { useEffect as useEffect13, useState as useState22 } from "react";
|
|
6142
|
-
import { useDrop as
|
|
6160
|
+
import { useDrop as useDrop5 } from "react-dnd";
|
|
6143
6161
|
import { InlineMath as InlineMath9 } from "react-katex";
|
|
6144
6162
|
|
|
6145
6163
|
// src/hooks/useScreenSize.ts
|
|
@@ -6179,7 +6197,7 @@ var useScreenSize_default = useScreenSize;
|
|
|
6179
6197
|
|
|
6180
6198
|
// src/components/dnds/DraggableDroppableItem.tsx
|
|
6181
6199
|
import { useRef as useRef7 } from "react";
|
|
6182
|
-
import { useDrag as useDrag2, useDrop as
|
|
6200
|
+
import { useDrag as useDrag2, useDrop as useDrop4 } from "react-dnd";
|
|
6183
6201
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
6184
6202
|
var DraggableDroppableItem = ({
|
|
6185
6203
|
item,
|
|
@@ -6191,7 +6209,7 @@ var DraggableDroppableItem = ({
|
|
|
6191
6209
|
setTarget
|
|
6192
6210
|
}) => {
|
|
6193
6211
|
const ref = useRef7(null);
|
|
6194
|
-
const [, drop] =
|
|
6212
|
+
const [, drop] = useDrop4({
|
|
6195
6213
|
accept: type,
|
|
6196
6214
|
hover() {
|
|
6197
6215
|
if (!ref.current) {
|
|
@@ -6244,7 +6262,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6244
6262
|
const [selectedKey, setSelectedKey] = useState22(null);
|
|
6245
6263
|
const { screenSize } = useScreenSize_default();
|
|
6246
6264
|
const [view, setView] = useState22("PC");
|
|
6247
|
-
const [{ isOver, canDrop }, drop] =
|
|
6265
|
+
const [{ isOver, canDrop }, drop] = useDrop5({
|
|
6248
6266
|
accept: "ORDERING",
|
|
6249
6267
|
drop: () => {
|
|
6250
6268
|
},
|