catchup-library-web 1.20.29 → 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 +308 -304
- package/dist/index.mjs +248 -244
- package/package.json +1 -1
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +193 -180
- 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
|
}, []);
|
|
@@ -4790,181 +4721,193 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4790
4721
|
const checkAnswerProvided = (answerMap2, option) => {
|
|
4791
4722
|
return Object.keys(answerMap2).findIndex((key) => answerMap2[key] === option) !== -1;
|
|
4792
4723
|
};
|
|
4724
|
+
const handleSelectOption = (option) => {
|
|
4725
|
+
setSelectedOption(option);
|
|
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);
|
|
4749
|
+
};
|
|
4793
4750
|
const answerMap = retrieveAnswerMap();
|
|
4794
|
-
return /* @__PURE__ */ jsxs17(
|
|
4795
|
-
"div",
|
|
4796
|
-
{
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
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
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
onTouchEnd: () => {
|
|
4828
|
-
setSelectedOption(option);
|
|
4829
|
-
setPasteOptionIndex(null);
|
|
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
|
+
}
|
|
4830
4842
|
},
|
|
4831
|
-
children:
|
|
4843
|
+
children: answerMap[materialKey] ? /* @__PURE__ */ jsx28(
|
|
4832
4844
|
InputWithSpecialExpression_default,
|
|
4833
4845
|
{
|
|
4834
|
-
value:
|
|
4846
|
+
value: answerMap[materialKey],
|
|
4835
4847
|
showSpecialOnly: false
|
|
4836
4848
|
}
|
|
4837
|
-
) })
|
|
4849
|
+
) : /* @__PURE__ */ jsx28("p", { className: "text-gray-400 italic" })
|
|
4838
4850
|
}
|
|
4839
|
-
)
|
|
4840
|
-
|
|
4851
|
+
) }),
|
|
4852
|
+
learnerAnswerState === "CORRECT" ? /* @__PURE__ */ jsx28("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx28(
|
|
4853
|
+
BaseImage_default,
|
|
4841
4854
|
{
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
setPasteOptionIndex(null);
|
|
4846
|
-
},
|
|
4847
|
-
onTouchEnd: () => {
|
|
4848
|
-
setSelectedOption(option);
|
|
4849
|
-
setPasteOptionIndex(null);
|
|
4850
|
-
},
|
|
4851
|
-
children: /* @__PURE__ */ jsx30(
|
|
4852
|
-
ShowMaterialMediaByContentType_default,
|
|
4853
|
-
{
|
|
4854
|
-
contentType: contentMap.type,
|
|
4855
|
-
src: option,
|
|
4856
|
-
canFullScreen: true
|
|
4857
|
-
},
|
|
4858
|
-
`${uniqueValue}-${index}`
|
|
4859
|
-
)
|
|
4855
|
+
src: "/icons/checkbox.webp",
|
|
4856
|
+
alt: "checkbox",
|
|
4857
|
+
size: "small"
|
|
4860
4858
|
}
|
|
4861
|
-
),
|
|
4862
|
-
|
|
4863
|
-
|
|
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") }) })
|
|
4864
4872
|
}
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
return /* @__PURE__ */ jsx30("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ jsx30("div", { className: "mx-2", children: /* @__PURE__ */ jsx30(
|
|
4875
|
-
DroppableItem_default,
|
|
4876
|
-
{
|
|
4877
|
-
item: { index },
|
|
4878
|
-
type: "FILL_IN_THE_BLANKS",
|
|
4879
|
-
target: pasteOptionIndex,
|
|
4880
|
-
setTarget: setPasteOptionIndex,
|
|
4881
|
-
dropRef: drop,
|
|
4882
|
-
component: /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
|
|
4883
|
-
/* @__PURE__ */ jsx30("div", { className: "my-auto", children: /* @__PURE__ */ jsxs17("p", { className: "text-xl", children: [
|
|
4884
|
-
parseFloat(materialKey) + 1,
|
|
4885
|
-
"."
|
|
4886
|
-
] }) }),
|
|
4887
|
-
/* @__PURE__ */ jsx30("div", { className: "flex-1", children: checkCanAnswerQuestion() ? contentMap.type === "TEXT" ? /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
|
|
4888
|
-
/* @__PURE__ */ jsx30("div", { className: "flex-1", children: /* @__PURE__ */ jsx30(
|
|
4889
|
-
"div",
|
|
4890
|
-
{
|
|
4891
|
-
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"}`,
|
|
4892
|
-
onClick: () => {
|
|
4893
|
-
if (answerMap[materialKey]) {
|
|
4894
|
-
onChange(answer, materialKey, "");
|
|
4895
|
-
}
|
|
4896
|
-
},
|
|
4897
|
-
children: answerMap[materialKey] ? /* @__PURE__ */ jsx30(
|
|
4898
|
-
InputWithSpecialExpression_default,
|
|
4899
|
-
{
|
|
4900
|
-
value: answerMap[materialKey],
|
|
4901
|
-
showSpecialOnly: false
|
|
4902
|
-
}
|
|
4903
|
-
) : /* @__PURE__ */ jsx30("p", { className: "text-gray-400 italic" })
|
|
4904
|
-
}
|
|
4905
|
-
) }),
|
|
4906
|
-
learnerAnswerState === "CORRECT" ? /* @__PURE__ */ jsx30("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx30(
|
|
4907
|
-
BaseImage_default,
|
|
4908
|
-
{
|
|
4909
|
-
src: "/icons/checkbox.webp",
|
|
4910
|
-
alt: "checkbox",
|
|
4911
|
-
size: "small"
|
|
4912
|
-
}
|
|
4913
|
-
) }) : learnerAnswerState === "INCORRECT" ? /* @__PURE__ */ jsx30("div", { className: "absolute -top-[10px] right-4 bg-catchup-white", children: /* @__PURE__ */ jsx30(
|
|
4914
|
-
BaseImage_default,
|
|
4915
|
-
{
|
|
4916
|
-
src: "/icons/cross-red.webp",
|
|
4917
|
-
alt: "cross-red",
|
|
4918
|
-
size: "small"
|
|
4919
|
-
}
|
|
4920
|
-
) }) : null
|
|
4921
|
-
] }) : answerMap[materialKey] === "" ? /* @__PURE__ */ jsx30(
|
|
4922
|
-
"div",
|
|
4923
|
-
{
|
|
4924
|
-
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"}`,
|
|
4925
|
-
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") }) })
|
|
4926
|
-
}
|
|
4927
|
-
) : /* @__PURE__ */ jsx30(
|
|
4928
|
-
"div",
|
|
4929
|
-
{
|
|
4930
|
-
className: "flex-1 cursor-pointer",
|
|
4931
|
-
onClick: () => {
|
|
4932
|
-
onChange(answer, materialKey, "");
|
|
4933
|
-
},
|
|
4934
|
-
children: /* @__PURE__ */ jsx30(
|
|
4935
|
-
ShowMaterialMediaByContentType_default,
|
|
4936
|
-
{
|
|
4937
|
-
contentType: contentMap.type,
|
|
4938
|
-
src: answerMap[materialKey],
|
|
4939
|
-
canFullScreen: true
|
|
4940
|
-
},
|
|
4941
|
-
`${uniqueValue}-${index}`
|
|
4942
|
-
)
|
|
4943
|
-
}
|
|
4944
|
-
) : /* @__PURE__ */ jsx30("p", { className: "text-xl", children: constructInputWithSpecialExpressionList(
|
|
4945
|
-
answerMap[materialKey]
|
|
4946
|
-
).map((inputPart, index2) => /* @__PURE__ */ jsx30(
|
|
4947
|
-
"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,
|
|
4948
4882
|
{
|
|
4949
|
-
|
|
4950
|
-
|
|
4883
|
+
contentType: contentMap.type,
|
|
4884
|
+
src: answerMap[materialKey],
|
|
4885
|
+
canFullScreen: true
|
|
4951
4886
|
},
|
|
4952
|
-
|
|
4953
|
-
)
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
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
|
+
] });
|
|
4962
4905
|
};
|
|
4963
4906
|
var FillInTheBlanksActivityMaterialContent_default = FillInTheBlanksActivityMaterialContent;
|
|
4964
4907
|
|
|
4965
4908
|
// src/components/activities/FillInTheBlanksActivityContent.tsx
|
|
4966
4909
|
import { useState as useState18, useEffect as useEffect9 } from "react";
|
|
4967
|
-
import { jsx as
|
|
4910
|
+
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4968
4911
|
var FillInTheBlanksActivityContent = ({
|
|
4969
4912
|
answer,
|
|
4970
4913
|
data,
|
|
@@ -5033,7 +4976,7 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5033
4976
|
changeAnswer(newAnswer);
|
|
5034
4977
|
};
|
|
5035
4978
|
return /* @__PURE__ */ jsxs18("div", { className: "flex flex-row flex-wrap", children: [
|
|
5036
|
-
/* @__PURE__ */
|
|
4979
|
+
/* @__PURE__ */ jsx29("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[60%]"}`, children: /* @__PURE__ */ jsx29(
|
|
5037
4980
|
ActivityBodyContent_default,
|
|
5038
4981
|
{
|
|
5039
4982
|
bodyMap: fillInTheBlanksBodyMap,
|
|
@@ -5042,9 +4985,9 @@ var FillInTheBlanksActivityContent = ({
|
|
|
5042
4985
|
templateType: "FILL_IN_THE_BLANKS"
|
|
5043
4986
|
}
|
|
5044
4987
|
) }),
|
|
5045
|
-
/* @__PURE__ */
|
|
5046
|
-
/* @__PURE__ */
|
|
5047
|
-
/* @__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(
|
|
5048
4991
|
FillInTheBlanksActivityMaterialContent_default,
|
|
5049
4992
|
{
|
|
5050
4993
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -5064,8 +5007,69 @@ var FillInTheBlanksActivityContent_default = FillInTheBlanksActivityContent;
|
|
|
5064
5007
|
|
|
5065
5008
|
// src/components/activities/material-contents/GroupingActivityMaterialContent.tsx
|
|
5066
5009
|
import { useEffect as useEffect10, useRef as useRef5, useState as useState19 } from "react";
|
|
5067
|
-
import { useDrop as
|
|
5010
|
+
import { useDrop as useDrop2 } from "react-dnd";
|
|
5068
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
|
|
5069
5073
|
import { Fragment as Fragment3, jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5070
5074
|
var GroupingActivityMaterialContent = ({
|
|
5071
5075
|
uniqueValue,
|
|
@@ -5081,7 +5085,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5081
5085
|
const [selectedTargetKey, setSelectedTargetKey] = useState19(null);
|
|
5082
5086
|
const [isShuffled, setIsShuffled] = useState19(false);
|
|
5083
5087
|
const [shuffledMaterialList, setShuffledMaterialList] = useState19([]);
|
|
5084
|
-
const [{ isOver, canDrop }, drop] =
|
|
5088
|
+
const [{ isOver, canDrop }, drop] = useDrop2({
|
|
5085
5089
|
accept: "GROUPING",
|
|
5086
5090
|
drop: () => {
|
|
5087
5091
|
},
|
|
@@ -5371,7 +5375,7 @@ var GroupingActivityContent_default = GroupingActivityContent;
|
|
|
5371
5375
|
|
|
5372
5376
|
// src/components/activities/material-contents/MatchingActivityMaterialContent.tsx
|
|
5373
5377
|
import { useEffect as useEffect11, useRef as useRef6, useState as useState20 } from "react";
|
|
5374
|
-
import { useDrop as
|
|
5378
|
+
import { useDrop as useDrop3 } from "react-dnd";
|
|
5375
5379
|
import { InlineMath as InlineMath6 } from "react-katex";
|
|
5376
5380
|
import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5377
5381
|
var MatchingActivityMaterialContent = ({
|
|
@@ -5388,7 +5392,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5388
5392
|
const [selectedTargetKey, setSelectedTargetKey] = useState20(null);
|
|
5389
5393
|
const [isShuffled, setIsShuffled] = useState20(false);
|
|
5390
5394
|
const [shuffledMaterialList, setShuffledMaterialList] = useState20([]);
|
|
5391
|
-
const [{ isOver, canDrop }, drop] =
|
|
5395
|
+
const [{ isOver, canDrop }, drop] = useDrop3({
|
|
5392
5396
|
accept: "MATCHING",
|
|
5393
5397
|
drop: () => {
|
|
5394
5398
|
},
|
|
@@ -6153,7 +6157,7 @@ var OpenEndedActivityContent_default = OpenEndedActivityContent;
|
|
|
6153
6157
|
|
|
6154
6158
|
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6155
6159
|
import { useEffect as useEffect13, useState as useState22 } from "react";
|
|
6156
|
-
import { useDrop as
|
|
6160
|
+
import { useDrop as useDrop5 } from "react-dnd";
|
|
6157
6161
|
import { InlineMath as InlineMath9 } from "react-katex";
|
|
6158
6162
|
|
|
6159
6163
|
// src/hooks/useScreenSize.ts
|
|
@@ -6193,7 +6197,7 @@ var useScreenSize_default = useScreenSize;
|
|
|
6193
6197
|
|
|
6194
6198
|
// src/components/dnds/DraggableDroppableItem.tsx
|
|
6195
6199
|
import { useRef as useRef7 } from "react";
|
|
6196
|
-
import { useDrag as useDrag2, useDrop as
|
|
6200
|
+
import { useDrag as useDrag2, useDrop as useDrop4 } from "react-dnd";
|
|
6197
6201
|
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
6198
6202
|
var DraggableDroppableItem = ({
|
|
6199
6203
|
item,
|
|
@@ -6205,7 +6209,7 @@ var DraggableDroppableItem = ({
|
|
|
6205
6209
|
setTarget
|
|
6206
6210
|
}) => {
|
|
6207
6211
|
const ref = useRef7(null);
|
|
6208
|
-
const [, drop] =
|
|
6212
|
+
const [, drop] = useDrop4({
|
|
6209
6213
|
accept: type,
|
|
6210
6214
|
hover() {
|
|
6211
6215
|
if (!ref.current) {
|
|
@@ -6258,7 +6262,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6258
6262
|
const [selectedKey, setSelectedKey] = useState22(null);
|
|
6259
6263
|
const { screenSize } = useScreenSize_default();
|
|
6260
6264
|
const [view, setView] = useState22("PC");
|
|
6261
|
-
const [{ isOver, canDrop }, drop] =
|
|
6265
|
+
const [{ isOver, canDrop }, drop] = useDrop5({
|
|
6262
6266
|
accept: "ORDERING",
|
|
6263
6267
|
drop: () => {
|
|
6264
6268
|
},
|