catchup-library-web 2.5.8 → 2.5.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +158 -218
- package/dist/index.mjs +177 -237
- package/package.json +1 -1
- package/src/components/activities/MatchingActivityContent.tsx +28 -17
- package/src/components/activities/OrderingActivityContent.tsx +28 -17
- package/src/components/activities/body-contents/ActivityBodyContent.tsx +1 -1
- package/src/components/activities/body-contents/ShowBodyMediaByContentType.tsx +2 -6
- package/src/components/activities/material-contents/FillInTheBlanksActivityMaterialContent.tsx +19 -19
- package/src/components/activities/material-contents/GroupingActivityMaterialContent.tsx +24 -24
- package/src/components/activities/material-contents/MatchingActivityMaterialContent.tsx +25 -25
- package/src/components/activities/material-contents/OrderingActivityMaterialContent.tsx +16 -55
- package/src/components/activities/material-contents/ShowMaterialMediaByContentType.tsx +1 -1
- package/src/components/groups/InputGroup.tsx +2 -2
- package/src/components/groups/PageTravelGroup.tsx +46 -86
- package/src/properties/ActivityProperties.ts +2 -0
package/dist/index.mjs
CHANGED
|
@@ -3454,41 +3454,33 @@ var ShowBodyMediaByContentType = ({
|
|
|
3454
3454
|
case "TEXT":
|
|
3455
3455
|
return /* @__PURE__ */ jsx20("div", { className: "mb-1 flex flex-row flex-wrap items-center mx-auto w-full", children: /* @__PURE__ */ jsx20("p", { className: "whitespace-pre-wrap", children: retrieveValueParts(value) }) });
|
|
3456
3456
|
case "IMAGE":
|
|
3457
|
-
return /* @__PURE__ */ jsx20("div", { className: "mb-1 flex flex-col items-center relative", children: /* @__PURE__ */ jsxs13(
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3457
|
+
return /* @__PURE__ */ jsx20("div", { className: "mb-1 flex flex-col items-center relative", children: /* @__PURE__ */ jsxs13("div", { className: "relative", children: [
|
|
3458
|
+
/* @__PURE__ */ jsx20(
|
|
3459
|
+
BaseImage_default,
|
|
3460
|
+
{
|
|
3461
|
+
src: value,
|
|
3462
|
+
alt: "body-image",
|
|
3463
|
+
size: "custom",
|
|
3464
|
+
className: "max-h-[50vh] max-w-full object-contain rounded-catchup-xlarge"
|
|
3465
|
+
}
|
|
3466
|
+
),
|
|
3467
|
+
/* @__PURE__ */ jsx20(
|
|
3468
|
+
"div",
|
|
3469
|
+
{
|
|
3470
|
+
className: "absolute flex items-center justify-center top-2 right-2 h-6 w-6 cursor-pointer border rounded-catchup-xlarge border-catchup-blue p-1",
|
|
3471
|
+
onClick: () => handleOpenFullScreen(value),
|
|
3472
|
+
children: /* @__PURE__ */ jsx20(
|
|
3465
3473
|
BaseImage_default,
|
|
3466
3474
|
{
|
|
3467
|
-
src:
|
|
3468
|
-
alt: "
|
|
3475
|
+
src: "/icons/arrow-up.webp",
|
|
3476
|
+
alt: "expand",
|
|
3469
3477
|
size: "custom",
|
|
3470
|
-
className: "w-full
|
|
3471
|
-
}
|
|
3472
|
-
),
|
|
3473
|
-
/* @__PURE__ */ jsx20(
|
|
3474
|
-
"div",
|
|
3475
|
-
{
|
|
3476
|
-
className: "absolute flex items-center justify-center top-2 right-2 h-6 w-6 cursor-pointer border rounded-catchup-xlarge border-catchup-blue p-1",
|
|
3477
|
-
onClick: () => handleOpenFullScreen(value),
|
|
3478
|
-
children: /* @__PURE__ */ jsx20(
|
|
3479
|
-
BaseImage_default,
|
|
3480
|
-
{
|
|
3481
|
-
src: "/icons/arrow-up.webp",
|
|
3482
|
-
alt: "expand",
|
|
3483
|
-
size: "custom",
|
|
3484
|
-
className: "w-full"
|
|
3485
|
-
}
|
|
3486
|
-
)
|
|
3478
|
+
className: "w-full"
|
|
3487
3479
|
}
|
|
3488
3480
|
)
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
) });
|
|
3481
|
+
}
|
|
3482
|
+
)
|
|
3483
|
+
] }) });
|
|
3492
3484
|
case "VIDEO":
|
|
3493
3485
|
return /* @__PURE__ */ jsx20("div", { className: "mb-1 flex flex-col items-center", children: /* @__PURE__ */ jsx20(
|
|
3494
3486
|
"video",
|
|
@@ -3593,7 +3585,7 @@ var ActivityBodyContent = ({
|
|
|
3593
3585
|
key
|
|
3594
3586
|
});
|
|
3595
3587
|
}).filter(Boolean);
|
|
3596
|
-
return /* @__PURE__ */ jsx21("div", { className: "flex flex-col justify-center items-center", children: processedBodies.map((body, index) => /* @__PURE__ */ jsx21(
|
|
3588
|
+
return /* @__PURE__ */ jsx21("div", { className: "flex flex-col justify-center items-center max-h-[40vh] overflow-y-auto", children: processedBodies.map((body, index) => /* @__PURE__ */ jsx21(
|
|
3597
3589
|
ShowBodyMediaByContentType_default,
|
|
3598
3590
|
{
|
|
3599
3591
|
index,
|
|
@@ -3743,7 +3735,7 @@ var InputGroup = ({
|
|
|
3743
3735
|
onRequestClose: () => {
|
|
3744
3736
|
setShowMathConstructor(false);
|
|
3745
3737
|
},
|
|
3746
|
-
children: /* @__PURE__ */ jsx23("div", { className: "bg-white rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs14("div", { className: "p-6 space-y-6", children: [
|
|
3738
|
+
children: /* @__PURE__ */ jsx23("div", { className: "bg-catchup-white rounded-lg overflow-hidden", children: /* @__PURE__ */ jsxs14("div", { className: "p-6 space-y-6", children: [
|
|
3747
3739
|
/* @__PURE__ */ jsx23("div", { children: /* @__PURE__ */ jsx23("div", { className: "border border-catchup-gray-100 rounded-catchup-large focus-within:border-catchup-blue-400 focus-within:shadow-input", children: /* @__PURE__ */ jsx23(
|
|
3748
3740
|
"math-field",
|
|
3749
3741
|
{
|
|
@@ -3990,7 +3982,7 @@ var InputGroup = ({
|
|
|
3990
3982
|
/* @__PURE__ */ jsx23(
|
|
3991
3983
|
"div",
|
|
3992
3984
|
{
|
|
3993
|
-
className: `w-full border ${errorText ? "border-catchup-red shadow-error" : "border-catchup-gray-100"} rounded-catchup-large focus-within:border-catchup-blue-400 focus-within:shadow-input ${disabled ? "bg-catchup-lighter-gray" : "bg-white"}`,
|
|
3985
|
+
className: `w-full border ${errorText ? "border-catchup-red shadow-error" : "border-catchup-gray-100"} rounded-catchup-large focus-within:border-catchup-blue-400 focus-within:shadow-input ${disabled ? "bg-catchup-lighter-gray" : "bg-catchup-white"}`,
|
|
3994
3986
|
children: /* @__PURE__ */ jsx23(
|
|
3995
3987
|
"input",
|
|
3996
3988
|
{
|
|
@@ -4355,7 +4347,7 @@ var ShowMaterialMediaByContentType = ({
|
|
|
4355
4347
|
src !== null && src !== "" && src !== "DEFAULT_OPTION" && canFullScreen ? /* @__PURE__ */ jsx25(
|
|
4356
4348
|
"div",
|
|
4357
4349
|
{
|
|
4358
|
-
className: "absolute flex items-center justify-center top-2 right-2 h-6 w-6 cursor-pointer border rounded-catchup-xlarge border-catchup-blue p-1 bg-white bg-opacity-80",
|
|
4350
|
+
className: "absolute flex items-center justify-center top-2 right-2 h-6 w-6 cursor-pointer border rounded-catchup-xlarge border-catchup-blue p-1 bg-catchup-white bg-opacity-80",
|
|
4359
4351
|
onMouseEnter: (e) => {
|
|
4360
4352
|
e.preventDefault();
|
|
4361
4353
|
},
|
|
@@ -4776,13 +4768,13 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4776
4768
|
top: `${mousePosition.y}px`,
|
|
4777
4769
|
transform: "translate(-50%, -50%)"
|
|
4778
4770
|
},
|
|
4779
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx29("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx29("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx29(
|
|
4771
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx29("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx29("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx29(
|
|
4780
4772
|
InputWithSpecialExpression_default,
|
|
4781
4773
|
{
|
|
4782
4774
|
value: draggedOption,
|
|
4783
4775
|
showSpecialOnly: false
|
|
4784
4776
|
}
|
|
4785
|
-
) }) }) : /* @__PURE__ */ jsx29("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx29(
|
|
4777
|
+
) }) }) : /* @__PURE__ */ jsx29("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx29(
|
|
4786
4778
|
ShowMaterialMediaByContentType_default,
|
|
4787
4779
|
{
|
|
4788
4780
|
contentType: contentMap.type,
|
|
@@ -4802,13 +4794,13 @@ var FillInTheBlanksActivityMaterialContent = ({
|
|
|
4802
4794
|
top: `${touchPosition.y}px`,
|
|
4803
4795
|
transform: "translate(-50%, -50%)"
|
|
4804
4796
|
},
|
|
4805
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx29("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx29("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx29(
|
|
4797
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx29("div", { className: "border-catchup-blue border-2 px-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx29("p", { className: "italic whitespace-pre-wrap", children: /* @__PURE__ */ jsx29(
|
|
4806
4798
|
InputWithSpecialExpression_default,
|
|
4807
4799
|
{
|
|
4808
4800
|
value: draggedOption,
|
|
4809
4801
|
showSpecialOnly: false
|
|
4810
4802
|
}
|
|
4811
|
-
) }) }) : /* @__PURE__ */ jsx29("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx29(
|
|
4803
|
+
) }) }) : /* @__PURE__ */ jsx29("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx29(
|
|
4812
4804
|
ShowMaterialMediaByContentType_default,
|
|
4813
4805
|
{
|
|
4814
4806
|
contentType: contentMap.type,
|
|
@@ -5256,7 +5248,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5256
5248
|
top: `${mousePosition.y}px`,
|
|
5257
5249
|
transform: "translate(-50%, -50%)"
|
|
5258
5250
|
},
|
|
5259
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx31("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx31("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px]", children: /* @__PURE__ */ jsx31("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5251
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx31("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx31("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px]", children: /* @__PURE__ */ jsx31("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5260
5252
|
(inputPart, index) => /* @__PURE__ */ jsx31(
|
|
5261
5253
|
"span",
|
|
5262
5254
|
{
|
|
@@ -5265,7 +5257,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5265
5257
|
},
|
|
5266
5258
|
index
|
|
5267
5259
|
)
|
|
5268
|
-
) }) }) }) : /* @__PURE__ */ jsx31("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx31(
|
|
5260
|
+
) }) }) }) : /* @__PURE__ */ jsx31("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx31(
|
|
5269
5261
|
ShowMaterialMediaByContentType_default,
|
|
5270
5262
|
{
|
|
5271
5263
|
contentType: contentMap.type,
|
|
@@ -5285,7 +5277,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5285
5277
|
top: `${touchPosition.y}px`,
|
|
5286
5278
|
transform: "translate(-50%, -50%)"
|
|
5287
5279
|
},
|
|
5288
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx31("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx31("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px]", children: /* @__PURE__ */ jsx31("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5280
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx31("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx31("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px]", children: /* @__PURE__ */ jsx31("p", { className: "text-xl text-center whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5289
5281
|
(inputPart, index) => /* @__PURE__ */ jsx31(
|
|
5290
5282
|
"span",
|
|
5291
5283
|
{
|
|
@@ -5294,7 +5286,7 @@ var GroupingActivityMaterialContent = ({
|
|
|
5294
5286
|
},
|
|
5295
5287
|
index
|
|
5296
5288
|
)
|
|
5297
|
-
) }) }) }) : /* @__PURE__ */ jsx31("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx31(
|
|
5289
|
+
) }) }) }) : /* @__PURE__ */ jsx31("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx31(
|
|
5298
5290
|
ShowMaterialMediaByContentType_default,
|
|
5299
5291
|
{
|
|
5300
5292
|
contentType: contentMap.type,
|
|
@@ -5685,7 +5677,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5685
5677
|
top: `${mousePosition.y}px`,
|
|
5686
5678
|
transform: "translate(-50%, -50%)"
|
|
5687
5679
|
},
|
|
5688
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx33("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] px-4", children: /* @__PURE__ */ jsx33("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5680
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx33("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] px-4", children: /* @__PURE__ */ jsx33("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5689
5681
|
(inputPart, index) => /* @__PURE__ */ jsx33(
|
|
5690
5682
|
"span",
|
|
5691
5683
|
{
|
|
@@ -5694,7 +5686,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5694
5686
|
},
|
|
5695
5687
|
index
|
|
5696
5688
|
)
|
|
5697
|
-
) }) }) }) : /* @__PURE__ */ jsx33("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx33(
|
|
5689
|
+
) }) }) }) : /* @__PURE__ */ jsx33("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx33(
|
|
5698
5690
|
ShowMaterialMediaByContentType_default,
|
|
5699
5691
|
{
|
|
5700
5692
|
contentType: contentMap.type,
|
|
@@ -5714,7 +5706,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5714
5706
|
top: `${touchPosition.y}px`,
|
|
5715
5707
|
transform: "translate(-50%, -50%)"
|
|
5716
5708
|
},
|
|
5717
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx33("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] px-4", children: /* @__PURE__ */ jsx33("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5709
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx33("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx33("div", { className: "flex flex-col items-center justify-center m-2 min-w-[200px] px-4", children: /* @__PURE__ */ jsx33("p", { className: "text-lg whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(draggedValue).map(
|
|
5718
5710
|
(inputPart, index) => /* @__PURE__ */ jsx33(
|
|
5719
5711
|
"span",
|
|
5720
5712
|
{
|
|
@@ -5723,7 +5715,7 @@ var MatchingActivityMaterialContent = ({
|
|
|
5723
5715
|
},
|
|
5724
5716
|
index
|
|
5725
5717
|
)
|
|
5726
|
-
) }) }) }) : /* @__PURE__ */ jsx33("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx33(
|
|
5718
|
+
) }) }) }) : /* @__PURE__ */ jsx33("div", { className: "border-catchup-blue border-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx33(
|
|
5727
5719
|
ShowMaterialMediaByContentType_default,
|
|
5728
5720
|
{
|
|
5729
5721
|
contentType: contentMap.type,
|
|
@@ -5853,14 +5845,15 @@ var MatchingActivityMaterialContent = ({
|
|
|
5853
5845
|
var MatchingActivityMaterialContent_default = MatchingActivityMaterialContent;
|
|
5854
5846
|
|
|
5855
5847
|
// src/components/activities/MatchingActivityContent.tsx
|
|
5856
|
-
import {
|
|
5848
|
+
import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5857
5849
|
var MatchingActivityContent = ({
|
|
5858
5850
|
answerMap,
|
|
5859
5851
|
data,
|
|
5860
5852
|
canAnswerQuestion,
|
|
5861
5853
|
changeAnswer,
|
|
5862
5854
|
isPreview,
|
|
5863
|
-
showCorrectAnswer
|
|
5855
|
+
showCorrectAnswer,
|
|
5856
|
+
isFullScreen
|
|
5864
5857
|
}) => {
|
|
5865
5858
|
const contentMap = parseContentMapFromData(data);
|
|
5866
5859
|
const matchingBodyMap = parseBodyMapFromData(data, "MATCHING");
|
|
@@ -5870,16 +5863,17 @@ var MatchingActivityContent = ({
|
|
|
5870
5863
|
answerMap2[key] = value;
|
|
5871
5864
|
changeAnswer(answerMap2);
|
|
5872
5865
|
};
|
|
5873
|
-
return /* @__PURE__ */ jsxs24(
|
|
5874
|
-
/* @__PURE__ */ jsx34(
|
|
5866
|
+
return /* @__PURE__ */ jsxs24("div", { className: "flex flex-row flex-wrap", children: [
|
|
5867
|
+
/* @__PURE__ */ jsx34("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[40%]"}`, children: /* @__PURE__ */ jsx34(
|
|
5875
5868
|
ActivityBodyContent_default,
|
|
5876
5869
|
{
|
|
5877
5870
|
bodyMap: matchingBodyMap,
|
|
5878
5871
|
templateType: "MATCHING"
|
|
5879
5872
|
}
|
|
5880
|
-
),
|
|
5881
|
-
/* @__PURE__ */ jsx34(DividerLine_default, {}),
|
|
5882
|
-
/* @__PURE__ */ jsx34(
|
|
5873
|
+
) }),
|
|
5874
|
+
/* @__PURE__ */ jsx34("div", { className: `${isFullScreen ? "contents" : "contents md:hidden"}`, children: /* @__PURE__ */ jsx34(DividerLine_default, {}) }),
|
|
5875
|
+
/* @__PURE__ */ jsx34("div", { className: `${isFullScreen ? "hidden" : "hidden md:block"}`, children: /* @__PURE__ */ jsx34(VerticalDividerLine_default, {}) }),
|
|
5876
|
+
/* @__PURE__ */ jsx34("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ jsx34(
|
|
5883
5877
|
MatchingActivityMaterialContent_default,
|
|
5884
5878
|
{
|
|
5885
5879
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -5891,7 +5885,7 @@ var MatchingActivityContent = ({
|
|
|
5891
5885
|
isPreview,
|
|
5892
5886
|
showCorrectAnswer
|
|
5893
5887
|
}
|
|
5894
|
-
)
|
|
5888
|
+
) })
|
|
5895
5889
|
] });
|
|
5896
5890
|
};
|
|
5897
5891
|
var MatchingActivityContent_default = MatchingActivityContent;
|
|
@@ -6295,7 +6289,7 @@ var retrieveAcceptedFormats = (fileType) => {
|
|
|
6295
6289
|
};
|
|
6296
6290
|
|
|
6297
6291
|
// src/components/activities/material-contents/OpenEndedActivityMaterialContent.tsx
|
|
6298
|
-
import { Fragment as
|
|
6292
|
+
import { Fragment as Fragment6, jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
6299
6293
|
var OpenEndedActivityMaterialContent = ({
|
|
6300
6294
|
answerMap,
|
|
6301
6295
|
contentMap,
|
|
@@ -6352,7 +6346,7 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6352
6346
|
const answerMapAnswer = answerMap2["ANSWER"];
|
|
6353
6347
|
const extension = answerMapAnswer.split(".").pop();
|
|
6354
6348
|
const fileType = retrieveFileTypeFromExtension(extension);
|
|
6355
|
-
return /* @__PURE__ */ jsx39(
|
|
6349
|
+
return /* @__PURE__ */ jsx39(Fragment6, { children: fileType === "IMAGE" ? /* @__PURE__ */ jsx39("div", { className: "flex flex-col justify-center items-center my-5", children: /* @__PURE__ */ jsx39(
|
|
6356
6350
|
BaseImage_default,
|
|
6357
6351
|
{
|
|
6358
6352
|
src: answerMapAnswer,
|
|
@@ -6375,7 +6369,7 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6375
6369
|
}
|
|
6376
6370
|
) });
|
|
6377
6371
|
};
|
|
6378
|
-
return /* @__PURE__ */ jsx39(
|
|
6372
|
+
return /* @__PURE__ */ jsx39(Fragment6, { children: /* @__PURE__ */ jsxs29("div", { className: "", children: [
|
|
6379
6373
|
/* @__PURE__ */ jsx39("div", { className: "hidden md:block", children: /* @__PURE__ */ jsx39("span", { className: "font-semibold text-xl opacity-60", children: i18n_default.t("please_select_open_ended_text") }) }),
|
|
6380
6374
|
/* @__PURE__ */ jsx39("div", { className: "hidden md:contents", children: /* @__PURE__ */ jsx39(DividerLine_default, {}) }),
|
|
6381
6375
|
contentMap.type === "TEXT" ? RenderTextContent(answerMap) : contentMap.type === "IMAGE" ? RenderImageContent(answerMap) : contentMap.type === "AUDIO" ? RenderAudioContent(answerMap) : null
|
|
@@ -6384,7 +6378,7 @@ var OpenEndedActivityMaterialContent = ({
|
|
|
6384
6378
|
var OpenEndedActivityMaterialContent_default = OpenEndedActivityMaterialContent;
|
|
6385
6379
|
|
|
6386
6380
|
// src/components/activities/OpenEndedActivityContent.tsx
|
|
6387
|
-
import { Fragment as
|
|
6381
|
+
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
6388
6382
|
var OpenEndedActivityContent = ({
|
|
6389
6383
|
answerMap,
|
|
6390
6384
|
data,
|
|
@@ -6415,7 +6409,7 @@ var OpenEndedActivityContent = ({
|
|
|
6415
6409
|
)
|
|
6416
6410
|
}
|
|
6417
6411
|
),
|
|
6418
|
-
showMaterialContent ? /* @__PURE__ */ jsxs30(
|
|
6412
|
+
showMaterialContent ? /* @__PURE__ */ jsxs30(Fragment7, { children: [
|
|
6419
6413
|
/* @__PURE__ */ jsx40(
|
|
6420
6414
|
"div",
|
|
6421
6415
|
{
|
|
@@ -6439,45 +6433,8 @@ var OpenEndedActivityContent = ({
|
|
|
6439
6433
|
var OpenEndedActivityContent_default = OpenEndedActivityContent;
|
|
6440
6434
|
|
|
6441
6435
|
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6442
|
-
import { useEffect as
|
|
6436
|
+
import { useEffect as useEffect14, useState as useState23, useRef as useRef7 } from "react";
|
|
6443
6437
|
import { InlineMath as InlineMath9 } from "react-katex";
|
|
6444
|
-
|
|
6445
|
-
// src/hooks/useScreenSize.ts
|
|
6446
|
-
import { useState as useState23, useEffect as useEffect14 } from "react";
|
|
6447
|
-
var useScreenSize = () => {
|
|
6448
|
-
const [containerSize, setContainerSize] = useState23({
|
|
6449
|
-
width: 0,
|
|
6450
|
-
height: 0
|
|
6451
|
-
});
|
|
6452
|
-
const [screenSize, setScreenSize] = useState23({
|
|
6453
|
-
width: window.innerWidth,
|
|
6454
|
-
height: window.innerHeight
|
|
6455
|
-
});
|
|
6456
|
-
useEffect14(() => {
|
|
6457
|
-
const handleResize = () => {
|
|
6458
|
-
setScreenSize({
|
|
6459
|
-
width: window.innerWidth,
|
|
6460
|
-
height: window.innerHeight
|
|
6461
|
-
});
|
|
6462
|
-
const container = document.getElementById("container");
|
|
6463
|
-
if (!container) return;
|
|
6464
|
-
const boundingClientRect = container.getBoundingClientRect();
|
|
6465
|
-
setContainerSize({
|
|
6466
|
-
width: boundingClientRect.width,
|
|
6467
|
-
height: boundingClientRect.height
|
|
6468
|
-
});
|
|
6469
|
-
};
|
|
6470
|
-
handleResize();
|
|
6471
|
-
window.addEventListener("resize", handleResize);
|
|
6472
|
-
return () => {
|
|
6473
|
-
window.removeEventListener("resize", handleResize);
|
|
6474
|
-
};
|
|
6475
|
-
}, []);
|
|
6476
|
-
return { screenSize, containerSize };
|
|
6477
|
-
};
|
|
6478
|
-
var useScreenSize_default = useScreenSize;
|
|
6479
|
-
|
|
6480
|
-
// src/components/activities/material-contents/OrderingActivityMaterialContent.tsx
|
|
6481
6438
|
import { jsx as jsx41, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
6482
6439
|
var OrderingActivityMaterialContent = ({
|
|
6483
6440
|
uniqueValue,
|
|
@@ -6489,33 +6446,23 @@ var OrderingActivityMaterialContent = ({
|
|
|
6489
6446
|
isPreview,
|
|
6490
6447
|
showCorrectAnswer
|
|
6491
6448
|
}) => {
|
|
6492
|
-
const [selectedKey, setSelectedKey] =
|
|
6493
|
-
const [draggedKey, setDraggedKey] =
|
|
6494
|
-
const [dropTargetKey, setDropTargetKey] =
|
|
6495
|
-
const [draggedElement, setDraggedElement] =
|
|
6449
|
+
const [selectedKey, setSelectedKey] = useState23(null);
|
|
6450
|
+
const [draggedKey, setDraggedKey] = useState23(null);
|
|
6451
|
+
const [dropTargetKey, setDropTargetKey] = useState23(null);
|
|
6452
|
+
const [draggedElement, setDraggedElement] = useState23(
|
|
6496
6453
|
null
|
|
6497
6454
|
);
|
|
6498
6455
|
const dragElementRef = useRef7(null);
|
|
6499
|
-
const [mousePosition, setMousePosition] =
|
|
6456
|
+
const [mousePosition, setMousePosition] = useState23({
|
|
6500
6457
|
x: 0,
|
|
6501
6458
|
y: 0
|
|
6502
6459
|
});
|
|
6503
|
-
const [touchPosition, setTouchPosition] =
|
|
6460
|
+
const [touchPosition, setTouchPosition] = useState23({
|
|
6504
6461
|
x: 0,
|
|
6505
6462
|
y: 0
|
|
6506
6463
|
});
|
|
6507
|
-
const
|
|
6508
|
-
|
|
6509
|
-
const [displayAnswerMap, setDisplayAnswerMap] = useState24(answerMap);
|
|
6510
|
-
useEffect15(() => {
|
|
6511
|
-
if (!screenSize) return;
|
|
6512
|
-
if (screenSize.width <= 1024) {
|
|
6513
|
-
setView("TABLET");
|
|
6514
|
-
} else {
|
|
6515
|
-
setView("PC");
|
|
6516
|
-
}
|
|
6517
|
-
}, [screenSize]);
|
|
6518
|
-
useEffect15(() => {
|
|
6464
|
+
const [displayAnswerMap, setDisplayAnswerMap] = useState23(answerMap);
|
|
6465
|
+
useEffect14(() => {
|
|
6519
6466
|
if (showCorrectAnswer) {
|
|
6520
6467
|
const correctAnswerMap = {};
|
|
6521
6468
|
Object.keys(answerMap).forEach((answerKey, index) => {
|
|
@@ -6533,26 +6480,6 @@ var OrderingActivityMaterialContent = ({
|
|
|
6533
6480
|
}
|
|
6534
6481
|
return "INCORRECT";
|
|
6535
6482
|
};
|
|
6536
|
-
const calculateMarginTop = (index) => {
|
|
6537
|
-
if (index === 0) {
|
|
6538
|
-
return 0;
|
|
6539
|
-
} else if (index === 1) {
|
|
6540
|
-
if (contentMap.type === "TEXT") {
|
|
6541
|
-
return 65;
|
|
6542
|
-
} else {
|
|
6543
|
-
return 130;
|
|
6544
|
-
}
|
|
6545
|
-
} else if (index % 2 === 0) {
|
|
6546
|
-
if (contentMap.type === "TEXT") {
|
|
6547
|
-
return -65;
|
|
6548
|
-
} else {
|
|
6549
|
-
return -130;
|
|
6550
|
-
}
|
|
6551
|
-
} else if (index % 2 === 1) {
|
|
6552
|
-
return 0;
|
|
6553
|
-
}
|
|
6554
|
-
return 0;
|
|
6555
|
-
};
|
|
6556
6483
|
const handleMouseDown = (e, materialKey) => {
|
|
6557
6484
|
if (!checkCanAnswerQuestion()) return;
|
|
6558
6485
|
e.preventDefault();
|
|
@@ -6641,7 +6568,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6641
6568
|
top: `${mousePosition.y}px`,
|
|
6642
6569
|
transform: "translate(-50%, -50%)"
|
|
6643
6570
|
},
|
|
6644
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx41("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx41("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6571
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx41("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx41("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6645
6572
|
materialMap[displayAnswerMap[draggedKey]]
|
|
6646
6573
|
).map((inputPart, index) => /* @__PURE__ */ jsx41(
|
|
6647
6574
|
"span",
|
|
@@ -6650,7 +6577,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6650
6577
|
children: inputPart.isEquation ? /* @__PURE__ */ jsx41("span", { className: "text-xl", children: /* @__PURE__ */ jsx41(InlineMath9, { math: inputPart.value }) }) : inputPart.value
|
|
6651
6578
|
},
|
|
6652
6579
|
index
|
|
6653
|
-
)) }) }) : /* @__PURE__ */ jsx41("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx41(
|
|
6580
|
+
)) }) }) : /* @__PURE__ */ jsx41("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx41(
|
|
6654
6581
|
ShowMaterialMediaByContentType_default,
|
|
6655
6582
|
{
|
|
6656
6583
|
contentType: contentMap.type,
|
|
@@ -6670,7 +6597,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6670
6597
|
top: `${touchPosition.y}px`,
|
|
6671
6598
|
transform: "translate(-50%, -50%)"
|
|
6672
6599
|
},
|
|
6673
|
-
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx41("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx41("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6600
|
+
children: contentMap.type === "TEXT" ? /* @__PURE__ */ jsx41("div", { className: "border-catchup-blue border-2 px-3 py-2 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx41("p", { className: "text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(
|
|
6674
6601
|
materialMap[displayAnswerMap[draggedKey]]
|
|
6675
6602
|
).map((inputPart, index) => /* @__PURE__ */ jsx41(
|
|
6676
6603
|
"span",
|
|
@@ -6679,7 +6606,7 @@ var OrderingActivityMaterialContent = ({
|
|
|
6679
6606
|
children: inputPart.isEquation ? /* @__PURE__ */ jsx41("span", { className: "text-xl", children: /* @__PURE__ */ jsx41(InlineMath9, { math: inputPart.value }) }) : inputPart.value
|
|
6680
6607
|
},
|
|
6681
6608
|
index
|
|
6682
|
-
)) }) }) : /* @__PURE__ */ jsx41("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-white shadow-lg", children: /* @__PURE__ */ jsx41(
|
|
6609
|
+
)) }) }) : /* @__PURE__ */ jsx41("div", { className: "border-catchup-blue border-2 px-2 py-1 rounded-catchup-xlarge bg-catchup-white shadow-lg", children: /* @__PURE__ */ jsx41(
|
|
6683
6610
|
ShowMaterialMediaByContentType_default,
|
|
6684
6611
|
{
|
|
6685
6612
|
contentType: contentMap.type,
|
|
@@ -6695,13 +6622,10 @@ var OrderingActivityMaterialContent = ({
|
|
|
6695
6622
|
displayAnswerMap[materialKey] + "",
|
|
6696
6623
|
index + ""
|
|
6697
6624
|
);
|
|
6698
|
-
return /* @__PURE__ */ jsx41("div", { className: "w-full
|
|
6625
|
+
return /* @__PURE__ */ jsx41("div", { className: "w-full", children: /* @__PURE__ */ jsxs31(
|
|
6699
6626
|
"div",
|
|
6700
6627
|
{
|
|
6701
6628
|
className: `flex flex-row items-center my-4 mx-2`,
|
|
6702
|
-
style: {
|
|
6703
|
-
marginTop: view === "PC" ? calculateMarginTop(parseFloat(materialKey)) : 0
|
|
6704
|
-
},
|
|
6705
6629
|
children: [
|
|
6706
6630
|
/* @__PURE__ */ jsx41("div", { className: "mr-3", children: /* @__PURE__ */ jsx41("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__ */ jsx41(
|
|
6707
6631
|
"div",
|
|
@@ -6760,14 +6684,15 @@ var OrderingActivityMaterialContent = ({
|
|
|
6760
6684
|
var OrderingActivityMaterialContent_default = OrderingActivityMaterialContent;
|
|
6761
6685
|
|
|
6762
6686
|
// src/components/activities/OrderingActivityContent.tsx
|
|
6763
|
-
import {
|
|
6687
|
+
import { jsx as jsx42, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6764
6688
|
var OrderingActivityContent = ({
|
|
6765
6689
|
answerMap,
|
|
6766
6690
|
data,
|
|
6767
6691
|
canAnswerQuestion,
|
|
6768
6692
|
changeAnswer,
|
|
6769
6693
|
isPreview,
|
|
6770
|
-
showCorrectAnswer
|
|
6694
|
+
showCorrectAnswer,
|
|
6695
|
+
isFullScreen
|
|
6771
6696
|
}) => {
|
|
6772
6697
|
const contentMap = parseContentMapFromData(data);
|
|
6773
6698
|
const orderingBodyMap = parseBodyMapFromData(data, "ORDERING");
|
|
@@ -6779,16 +6704,17 @@ var OrderingActivityContent = ({
|
|
|
6779
6704
|
answerMap2[secondaryKey] = prevValue;
|
|
6780
6705
|
changeAnswer(answerMap2);
|
|
6781
6706
|
};
|
|
6782
|
-
return /* @__PURE__ */ jsxs32(
|
|
6783
|
-
/* @__PURE__ */ jsx42(
|
|
6707
|
+
return /* @__PURE__ */ jsxs32("div", { className: "flex flex-row flex-wrap", children: [
|
|
6708
|
+
/* @__PURE__ */ jsx42("div", { className: `${isFullScreen ? "w-full" : "w-full md:w-[40%]"}`, children: /* @__PURE__ */ jsx42(
|
|
6784
6709
|
ActivityBodyContent_default,
|
|
6785
6710
|
{
|
|
6786
6711
|
bodyMap: orderingBodyMap,
|
|
6787
6712
|
templateType: "ORDERING"
|
|
6788
6713
|
}
|
|
6789
|
-
),
|
|
6790
|
-
/* @__PURE__ */ jsx42(DividerLine_default, {}),
|
|
6791
|
-
/* @__PURE__ */ jsx42(
|
|
6714
|
+
) }),
|
|
6715
|
+
/* @__PURE__ */ jsx42("div", { className: `${isFullScreen ? "contents" : "contents md:hidden"}`, children: /* @__PURE__ */ jsx42(DividerLine_default, {}) }),
|
|
6716
|
+
/* @__PURE__ */ jsx42("div", { className: `${isFullScreen ? "hidden" : "hidden md:block"}`, children: /* @__PURE__ */ jsx42(VerticalDividerLine_default, {}) }),
|
|
6717
|
+
/* @__PURE__ */ jsx42("div", { className: `${isFullScreen ? "w-full" : "w-full md:flex-1"}`, children: /* @__PURE__ */ jsx42(
|
|
6792
6718
|
OrderingActivityMaterialContent_default,
|
|
6793
6719
|
{
|
|
6794
6720
|
uniqueValue: JSON.stringify(data.contentMap),
|
|
@@ -6800,15 +6726,15 @@ var OrderingActivityContent = ({
|
|
|
6800
6726
|
isPreview,
|
|
6801
6727
|
showCorrectAnswer
|
|
6802
6728
|
}
|
|
6803
|
-
)
|
|
6729
|
+
) })
|
|
6804
6730
|
] });
|
|
6805
6731
|
};
|
|
6806
6732
|
var OrderingActivityContent_default = OrderingActivityContent;
|
|
6807
6733
|
|
|
6808
6734
|
// src/components/activities/material-contents/TrueFalseActivityMaterialContent.tsx
|
|
6809
|
-
import { useEffect as
|
|
6735
|
+
import { useEffect as useEffect15, useState as useState24 } from "react";
|
|
6810
6736
|
import { InlineMath as InlineMath10 } from "react-katex";
|
|
6811
|
-
import { Fragment as
|
|
6737
|
+
import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6812
6738
|
var TrueFalseActivityMaterialContent = ({
|
|
6813
6739
|
uniqueValue,
|
|
6814
6740
|
answerMap,
|
|
@@ -6819,9 +6745,9 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6819
6745
|
isPreview,
|
|
6820
6746
|
showCorrectAnswer
|
|
6821
6747
|
}) => {
|
|
6822
|
-
const [shuffleOptionList, setShuffleOptionList] =
|
|
6823
|
-
const [displayAnswerMap, setDisplayAnswerMap] =
|
|
6824
|
-
|
|
6748
|
+
const [shuffleOptionList, setShuffleOptionList] = useState24([]);
|
|
6749
|
+
const [displayAnswerMap, setDisplayAnswerMap] = useState24(answerMap);
|
|
6750
|
+
useEffect15(() => {
|
|
6825
6751
|
const optionList = [];
|
|
6826
6752
|
optionList.push(...materialMap.trueList);
|
|
6827
6753
|
optionList.push(...materialMap.falseList);
|
|
@@ -6831,7 +6757,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6831
6757
|
setShuffleOptionList(shuffleArray(optionList));
|
|
6832
6758
|
}
|
|
6833
6759
|
}, []);
|
|
6834
|
-
|
|
6760
|
+
useEffect15(() => {
|
|
6835
6761
|
if (showCorrectAnswer) {
|
|
6836
6762
|
setDisplayAnswerMap(materialMap);
|
|
6837
6763
|
} else {
|
|
@@ -6914,7 +6840,7 @@ var TrueFalseActivityMaterialContent = ({
|
|
|
6914
6840
|
},
|
|
6915
6841
|
index
|
|
6916
6842
|
);
|
|
6917
|
-
}) }) : /* @__PURE__ */ jsxs33(
|
|
6843
|
+
}) }) : /* @__PURE__ */ jsxs33(Fragment8, { children: [
|
|
6918
6844
|
displayAnswerMap.trueList.map((item) => /* @__PURE__ */ jsxs33("div", { className: "flex flex-row items-center gap-x-2", children: [
|
|
6919
6845
|
/* @__PURE__ */ jsx43("div", { className: "flex-1", children: /* @__PURE__ */ jsx43("p", { children: item }) }),
|
|
6920
6846
|
/* @__PURE__ */ jsx43("div", { className: "w-[50px]", children: /* @__PURE__ */ jsx43("p", { className: "underline", children: i18n_default.t("true") }) })
|
|
@@ -7127,7 +7053,7 @@ var ActivityEvaluationRubricContent = ({
|
|
|
7127
7053
|
var ActivityEvaluationRubricContent_default = ActivityEvaluationRubricContent;
|
|
7128
7054
|
|
|
7129
7055
|
// src/components/activities/ActivityPreviewByData.tsx
|
|
7130
|
-
import { useEffect as
|
|
7056
|
+
import { useEffect as useEffect16, useState as useState25 } from "react";
|
|
7131
7057
|
|
|
7132
7058
|
// src/components/boxes/SelectionBox.tsx
|
|
7133
7059
|
import { jsx as jsx47, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
@@ -7167,7 +7093,7 @@ var SelectionBox = ({
|
|
|
7167
7093
|
var SelectionBox_default = SelectionBox;
|
|
7168
7094
|
|
|
7169
7095
|
// src/components/activities/ActivityPreviewByData.tsx
|
|
7170
|
-
import { Fragment as
|
|
7096
|
+
import { Fragment as Fragment9, jsx as jsx48, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
7171
7097
|
var ACTIVITY_TEMPLATE_LIST = [
|
|
7172
7098
|
{ type: "ORDERING", materialMap: "orderingMaterialMap" },
|
|
7173
7099
|
{ type: "DROPDOWN", materialMap: "dropdownMaterialMap" },
|
|
@@ -7198,11 +7124,11 @@ var ActivityPreviewByData = ({
|
|
|
7198
7124
|
showMaterialContent = true,
|
|
7199
7125
|
isPreview = true
|
|
7200
7126
|
}) => {
|
|
7201
|
-
const [selectedType, setSelectedType] =
|
|
7202
|
-
const [optionList, setOptionList] =
|
|
7203
|
-
const [answerMapMap, setAnswerMapMap] =
|
|
7204
|
-
const [activityTemplateTypeList, setActivityTemplateTypeList] =
|
|
7205
|
-
|
|
7127
|
+
const [selectedType, setSelectedType] = useState25(null);
|
|
7128
|
+
const [optionList, setOptionList] = useState25([]);
|
|
7129
|
+
const [answerMapMap, setAnswerMapMap] = useState25({});
|
|
7130
|
+
const [activityTemplateTypeList, setActivityTemplateTypeList] = useState25([]);
|
|
7131
|
+
useEffect16(() => {
|
|
7206
7132
|
if (!data) return;
|
|
7207
7133
|
let currentActivityTemplateMapList = JSON.parse(
|
|
7208
7134
|
JSON.stringify(ACTIVITY_TEMPLATE_LIST)
|
|
@@ -7220,7 +7146,7 @@ var ActivityPreviewByData = ({
|
|
|
7220
7146
|
}
|
|
7221
7147
|
setActivityTemplateTypeList(currentActivityTemplateMapList);
|
|
7222
7148
|
}, [data, answerType, typeList]);
|
|
7223
|
-
|
|
7149
|
+
useEffect16(() => {
|
|
7224
7150
|
if (activityTemplateTypeList.length === 0) return;
|
|
7225
7151
|
const currentOptionList = [];
|
|
7226
7152
|
for (const activityTemplateType of activityTemplateTypeList) {
|
|
@@ -7240,11 +7166,11 @@ var ActivityPreviewByData = ({
|
|
|
7240
7166
|
}
|
|
7241
7167
|
setOptionList(currentOptionList);
|
|
7242
7168
|
}, [activityTemplateTypeList, showDifficulty]);
|
|
7243
|
-
|
|
7169
|
+
useEffect16(() => {
|
|
7244
7170
|
if (optionList.length === 0) return;
|
|
7245
7171
|
setSelectedType(optionList[0].id);
|
|
7246
7172
|
}, [optionList]);
|
|
7247
|
-
|
|
7173
|
+
useEffect16(() => {
|
|
7248
7174
|
if (activityTemplateTypeList.length === 0) return;
|
|
7249
7175
|
const currentAnswerMapMap = {};
|
|
7250
7176
|
for (const activityTemplateMap of activityTemplateTypeList) {
|
|
@@ -7276,42 +7202,42 @@ var ActivityPreviewByData = ({
|
|
|
7276
7202
|
}
|
|
7277
7203
|
switch (selectedType) {
|
|
7278
7204
|
case "ORDERING":
|
|
7279
|
-
return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ jsxs38(
|
|
7205
|
+
return data.orderingBodyMap && data.orderingMaterialMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7280
7206
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7281
7207
|
/* @__PURE__ */ jsx48(OrderingActivityContent_default, __spreadValues({}, commonProps))
|
|
7282
7208
|
] }) : null;
|
|
7283
7209
|
case "DROPDOWN":
|
|
7284
|
-
return data.dropdownBodyMap && data.dropdownMaterialMap ? /* @__PURE__ */ jsxs38(
|
|
7210
|
+
return data.dropdownBodyMap && data.dropdownMaterialMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7285
7211
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7286
7212
|
/* @__PURE__ */ jsx48(DropdownActivityContent_default, __spreadValues({}, commonProps))
|
|
7287
7213
|
] }) : null;
|
|
7288
7214
|
case "MCSA":
|
|
7289
|
-
return data.MCSABodyMap && data.MCSAMaterialMap ? /* @__PURE__ */ jsxs38(
|
|
7215
|
+
return data.MCSABodyMap && data.MCSAMaterialMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7290
7216
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7291
7217
|
/* @__PURE__ */ jsx48(MCSAActivityContent_default, __spreadValues({}, commonProps))
|
|
7292
7218
|
] }) : null;
|
|
7293
7219
|
case "MCMA":
|
|
7294
|
-
return data.MCMABodyMap && data.MCMAMaterialMap ? /* @__PURE__ */ jsxs38(
|
|
7220
|
+
return data.MCMABodyMap && data.MCMAMaterialMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7295
7221
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7296
7222
|
/* @__PURE__ */ jsx48(MCMAActivityContent_default, __spreadValues({}, commonProps))
|
|
7297
7223
|
] }) : null;
|
|
7298
7224
|
case "MATCHING":
|
|
7299
|
-
return data.matchingBodyMap && data.matchingMaterialMap ? /* @__PURE__ */ jsxs38(
|
|
7225
|
+
return data.matchingBodyMap && data.matchingMaterialMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7300
7226
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7301
7227
|
/* @__PURE__ */ jsx48(MatchingActivityContent_default, __spreadValues({}, commonProps))
|
|
7302
7228
|
] }) : null;
|
|
7303
7229
|
case "GROUPING":
|
|
7304
|
-
return data.groupingBodyMap && data.groupingMaterialMap ? /* @__PURE__ */ jsxs38(
|
|
7230
|
+
return data.groupingBodyMap && data.groupingMaterialMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7305
7231
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7306
7232
|
/* @__PURE__ */ jsx48(GroupingActivityContent_default, __spreadValues({}, commonProps))
|
|
7307
7233
|
] }) : null;
|
|
7308
7234
|
case "FILL_IN_THE_BLANKS":
|
|
7309
|
-
return data.fillInTheBlanksBodyMap && data.fillInTheBlanksMaterialMap ? /* @__PURE__ */ jsxs38(
|
|
7235
|
+
return data.fillInTheBlanksBodyMap && data.fillInTheBlanksMaterialMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7310
7236
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7311
7237
|
/* @__PURE__ */ jsx48(FillInTheBlanksActivityContent_default, __spreadValues({}, commonProps))
|
|
7312
7238
|
] }) : null;
|
|
7313
7239
|
case "OPEN_ENDED":
|
|
7314
|
-
return data.openEndedBodyMap ? /* @__PURE__ */ jsxs38(
|
|
7240
|
+
return data.openEndedBodyMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7315
7241
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7316
7242
|
/* @__PURE__ */ jsx48(
|
|
7317
7243
|
OpenEndedActivityContent_default,
|
|
@@ -7321,7 +7247,7 @@ var ActivityPreviewByData = ({
|
|
|
7321
7247
|
)
|
|
7322
7248
|
] }) : null;
|
|
7323
7249
|
case "TRUE_FALSE":
|
|
7324
|
-
return data.trueFalseBodyMap && data.trueFalseMaterialMap ? /* @__PURE__ */ jsxs38(
|
|
7250
|
+
return data.trueFalseBodyMap && data.trueFalseMaterialMap ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7325
7251
|
isEmpty && /* @__PURE__ */ jsx48(ActivityEmptyContent_default, {}),
|
|
7326
7252
|
/* @__PURE__ */ jsx48(TrueFalseActivityContent_default, __spreadValues({}, commonProps))
|
|
7327
7253
|
] }) : null;
|
|
@@ -7331,7 +7257,7 @@ var ActivityPreviewByData = ({
|
|
|
7331
7257
|
};
|
|
7332
7258
|
if (!data) return null;
|
|
7333
7259
|
return /* @__PURE__ */ jsxs38("div", { children: [
|
|
7334
|
-
showType && optionList.length > 0 ? /* @__PURE__ */ jsxs38(
|
|
7260
|
+
showType && optionList.length > 0 ? /* @__PURE__ */ jsxs38(Fragment9, { children: [
|
|
7335
7261
|
/* @__PURE__ */ jsxs38("div", { className: "mb-2", children: [
|
|
7336
7262
|
showDescription ? /* @__PURE__ */ jsx48("div", { className: "my-2", children: /* @__PURE__ */ jsx48("p", { className: "font-semibold text-lg", children: i18n_default.t("activity_template") }) }) : null,
|
|
7337
7263
|
/* @__PURE__ */ jsx48(
|
|
@@ -7429,7 +7355,7 @@ var LeftTextRightInputGroup = ({
|
|
|
7429
7355
|
var LeftTextRightInputGroup_default = LeftTextRightInputGroup;
|
|
7430
7356
|
|
|
7431
7357
|
// src/components/groups/PageTravelGroup.tsx
|
|
7432
|
-
import { useEffect as
|
|
7358
|
+
import { useEffect as useEffect17, useState as useState26 } from "react";
|
|
7433
7359
|
import { jsx as jsx52, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
7434
7360
|
var PageTravelGroup = ({
|
|
7435
7361
|
isImageProcessing,
|
|
@@ -7439,90 +7365,104 @@ var PageTravelGroup = ({
|
|
|
7439
7365
|
setPageNumber,
|
|
7440
7366
|
setImageReady
|
|
7441
7367
|
}) => {
|
|
7442
|
-
const [totalPageNumber, setTotalPageNumber] =
|
|
7443
|
-
const [newPageNumber, setNewPageNumber] =
|
|
7444
|
-
|
|
7368
|
+
const [totalPageNumber, setTotalPageNumber] = useState26(0);
|
|
7369
|
+
const [newPageNumber, setNewPageNumber] = useState26(0);
|
|
7370
|
+
useEffect17(() => {
|
|
7445
7371
|
if (!initialTotalPageNumber) return;
|
|
7446
7372
|
setTotalPageNumber(initialTotalPageNumber);
|
|
7447
7373
|
}, [initialTotalPageNumber]);
|
|
7448
|
-
|
|
7374
|
+
useEffect17(() => {
|
|
7449
7375
|
setNewPageNumber(pageNumber + 1);
|
|
7450
7376
|
}, [pageNumber]);
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7377
|
+
const handlePageChange = (newPage) => {
|
|
7378
|
+
if (isImageProcessing) {
|
|
7379
|
+
handleImageProcessing();
|
|
7380
|
+
} else {
|
|
7381
|
+
setPageNumber(newPage);
|
|
7382
|
+
setImageReady(false);
|
|
7383
|
+
}
|
|
7384
|
+
};
|
|
7385
|
+
return /* @__PURE__ */ jsxs41("div", { className: "flex-1 flex flex-row justify-center items-center flex-wrap gap-x-2", children: [
|
|
7386
|
+
/* @__PURE__ */ jsx52(
|
|
7387
|
+
"button",
|
|
7454
7388
|
{
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
if (isImageProcessing) {
|
|
7460
|
-
handleImageProcessing();
|
|
7461
|
-
} else {
|
|
7462
|
-
if (pageNumber - 1 >= 0) {
|
|
7463
|
-
setPageNumber(pageNumber - 1);
|
|
7464
|
-
}
|
|
7465
|
-
setImageReady(false);
|
|
7466
|
-
}
|
|
7467
|
-
}
|
|
7389
|
+
className: "px-2 py-1 bg-catchup-blue-100 rounded-catchup-small",
|
|
7390
|
+
disabled: pageNumber <= 0,
|
|
7391
|
+
onClick: () => handlePageChange(pageNumber - 1),
|
|
7392
|
+
children: "\u2190"
|
|
7468
7393
|
}
|
|
7469
|
-
)
|
|
7470
|
-
|
|
7471
|
-
|
|
7394
|
+
),
|
|
7395
|
+
/* @__PURE__ */ jsxs41("p", { className: "text-md", children: [
|
|
7396
|
+
pageNumber + 1,
|
|
7397
|
+
" / ",
|
|
7398
|
+
totalPageNumber
|
|
7399
|
+
] }),
|
|
7400
|
+
/* @__PURE__ */ jsx52(
|
|
7401
|
+
"button",
|
|
7472
7402
|
{
|
|
7473
|
-
className:
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
} else {
|
|
7478
|
-
setPageNumber(index);
|
|
7479
|
-
setImageReady(false);
|
|
7480
|
-
}
|
|
7481
|
-
},
|
|
7482
|
-
children: index + 1
|
|
7403
|
+
className: "px-2 py-1 bg-catchup-blue-100 rounded-catchup-small",
|
|
7404
|
+
disabled: pageNumber >= totalPageNumber - 1,
|
|
7405
|
+
onClick: () => handlePageChange(pageNumber + 1),
|
|
7406
|
+
children: "\u2192"
|
|
7483
7407
|
}
|
|
7484
|
-
)
|
|
7485
|
-
|
|
7486
|
-
BaseImage_default,
|
|
7487
|
-
{
|
|
7488
|
-
size: "small",
|
|
7489
|
-
alt: "arrow-right",
|
|
7490
|
-
src: "/icons/arrow-right.webp",
|
|
7491
|
-
onClick: () => {
|
|
7492
|
-
if (isImageProcessing) {
|
|
7493
|
-
handleImageProcessing();
|
|
7494
|
-
} else {
|
|
7495
|
-
if (pageNumber + 1 <= totalPageNumber) {
|
|
7496
|
-
setPageNumber(pageNumber + 1);
|
|
7497
|
-
}
|
|
7498
|
-
setImageReady(false);
|
|
7499
|
-
}
|
|
7500
|
-
}
|
|
7501
|
-
}
|
|
7502
|
-
) }),
|
|
7503
|
-
/* @__PURE__ */ jsx52("div", { children: /* @__PURE__ */ jsx52(
|
|
7408
|
+
),
|
|
7409
|
+
/* @__PURE__ */ jsx52(
|
|
7504
7410
|
"input",
|
|
7505
7411
|
{
|
|
7506
|
-
className:
|
|
7412
|
+
className: "w-[90px] py-2 px-4 border border-catchup-gray-100 rounded-catchup-xlarge focus:outline-none placeholder-catchup-gray-200 focus:border-catchup-blue-400 focus:shadow-input",
|
|
7507
7413
|
type: "number",
|
|
7508
7414
|
value: newPageNumber,
|
|
7509
7415
|
onChange: (e) => {
|
|
7510
|
-
|
|
7511
|
-
setNewPageNumber(inputPageNumber);
|
|
7416
|
+
setNewPageNumber(parseInt(e.target.value));
|
|
7512
7417
|
},
|
|
7513
7418
|
onKeyDown: (e) => {
|
|
7514
7419
|
if (isNaN(newPageNumber) || newPageNumber <= 0 || newPageNumber > totalPageNumber)
|
|
7515
7420
|
return;
|
|
7516
7421
|
if (e.key === "Enter") {
|
|
7517
|
-
|
|
7422
|
+
handlePageChange(newPageNumber - 1);
|
|
7518
7423
|
}
|
|
7519
7424
|
}
|
|
7520
7425
|
}
|
|
7521
|
-
)
|
|
7426
|
+
)
|
|
7522
7427
|
] });
|
|
7523
7428
|
};
|
|
7524
7429
|
var PageTravelGroup_default = PageTravelGroup;
|
|
7525
7430
|
|
|
7431
|
+
// src/hooks/useScreenSize.ts
|
|
7432
|
+
import { useState as useState27, useEffect as useEffect18 } from "react";
|
|
7433
|
+
var useScreenSize = () => {
|
|
7434
|
+
const [containerSize, setContainerSize] = useState27({
|
|
7435
|
+
width: 0,
|
|
7436
|
+
height: 0
|
|
7437
|
+
});
|
|
7438
|
+
const [screenSize, setScreenSize] = useState27({
|
|
7439
|
+
width: window.innerWidth,
|
|
7440
|
+
height: window.innerHeight
|
|
7441
|
+
});
|
|
7442
|
+
useEffect18(() => {
|
|
7443
|
+
const handleResize = () => {
|
|
7444
|
+
setScreenSize({
|
|
7445
|
+
width: window.innerWidth,
|
|
7446
|
+
height: window.innerHeight
|
|
7447
|
+
});
|
|
7448
|
+
const container = document.getElementById("container");
|
|
7449
|
+
if (!container) return;
|
|
7450
|
+
const boundingClientRect = container.getBoundingClientRect();
|
|
7451
|
+
setContainerSize({
|
|
7452
|
+
width: boundingClientRect.width,
|
|
7453
|
+
height: boundingClientRect.height
|
|
7454
|
+
});
|
|
7455
|
+
};
|
|
7456
|
+
handleResize();
|
|
7457
|
+
window.addEventListener("resize", handleResize);
|
|
7458
|
+
return () => {
|
|
7459
|
+
window.removeEventListener("resize", handleResize);
|
|
7460
|
+
};
|
|
7461
|
+
}, []);
|
|
7462
|
+
return { screenSize, containerSize };
|
|
7463
|
+
};
|
|
7464
|
+
var useScreenSize_default = useScreenSize;
|
|
7465
|
+
|
|
7526
7466
|
// src/components/boxes/SelectionCheckbox.tsx
|
|
7527
7467
|
import { jsx as jsx53, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
7528
7468
|
var SelectionCheckbox = ({
|