catchup-library-web 1.5.1 → 1.5.3
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
CHANGED
|
@@ -190,7 +190,7 @@ declare const OrderingActivityContent: ({ answer, data, canAnswerQuestion, chang
|
|
|
190
190
|
|
|
191
191
|
declare const TrueFalseActivityContent: ({ answer, data, canAnswerQuestion, changeAnswer, isPreview, showCorrectAnswer, isFullScreen, }: ITrueFalseActivityProps) => react_jsx_runtime.JSX.Element;
|
|
192
192
|
|
|
193
|
-
declare const ActivitySolutionContent: ({ activityTemplateType, data, }: IActivitySolutionProps) => react_jsx_runtime.JSX.Element |
|
|
193
|
+
declare const ActivitySolutionContent: ({ activityTemplateType, data, }: IActivitySolutionProps) => react_jsx_runtime.JSX.Element | null;
|
|
194
194
|
|
|
195
195
|
declare const ActivityPreviewByData: ({ data, showType, showDescription, lockedType, typeOptionList, showSolution, showEvaluationRubric, showTaxonomy, isFullScreen, }: IActivityPreviewByDataProps) => react_jsx_runtime.JSX.Element | undefined;
|
|
196
196
|
|
package/dist/index.d.ts
CHANGED
|
@@ -190,7 +190,7 @@ declare const OrderingActivityContent: ({ answer, data, canAnswerQuestion, chang
|
|
|
190
190
|
|
|
191
191
|
declare const TrueFalseActivityContent: ({ answer, data, canAnswerQuestion, changeAnswer, isPreview, showCorrectAnswer, isFullScreen, }: ITrueFalseActivityProps) => react_jsx_runtime.JSX.Element;
|
|
192
192
|
|
|
193
|
-
declare const ActivitySolutionContent: ({ activityTemplateType, data, }: IActivitySolutionProps) => react_jsx_runtime.JSX.Element |
|
|
193
|
+
declare const ActivitySolutionContent: ({ activityTemplateType, data, }: IActivitySolutionProps) => react_jsx_runtime.JSX.Element | null;
|
|
194
194
|
|
|
195
195
|
declare const ActivityPreviewByData: ({ data, showType, showDescription, lockedType, typeOptionList, showSolution, showEvaluationRubric, showTaxonomy, isFullScreen, }: IActivityPreviewByDataProps) => react_jsx_runtime.JSX.Element | undefined;
|
|
196
196
|
|
package/dist/index.js
CHANGED
|
@@ -6239,60 +6239,52 @@ var ActivitySolutionContent = ({
|
|
|
6239
6239
|
activityTemplateType,
|
|
6240
6240
|
data
|
|
6241
6241
|
}) => {
|
|
6242
|
-
if (!activityTemplateType) return;
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
|
|
6258
|
-
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
|
|
6265
|
-
solutionMapString = data["openEndedSolutionMap"];
|
|
6266
|
-
} else if (activityTemplateType === "TRUE_FALSE") {
|
|
6267
|
-
if (data["trueFalseSolutionMap"])
|
|
6268
|
-
solutionMapString = data["trueFalseSolutionMap"];
|
|
6242
|
+
if (!activityTemplateType) return null;
|
|
6243
|
+
const solutionMapKeys = {
|
|
6244
|
+
ORDERING: "orderingSolutionMap",
|
|
6245
|
+
DROPDOWN: "dropdownSolutionMap",
|
|
6246
|
+
MCSA: "MCSASolutionMap",
|
|
6247
|
+
MCMA: "MCMASolutionMap",
|
|
6248
|
+
MATCHING: "matchingSolutionMap",
|
|
6249
|
+
GROUPING: "groupingSolutionMap",
|
|
6250
|
+
FILL_IN_THE_BLANKS: "fillInTheBlanksSolutionMap",
|
|
6251
|
+
OPEN_ENDED: "openEndedSolutionMap",
|
|
6252
|
+
TRUE_FALSE: "trueFalseSolutionMap"
|
|
6253
|
+
};
|
|
6254
|
+
const solutionMapKey = solutionMapKeys[activityTemplateType];
|
|
6255
|
+
if (!solutionMapKey) return null;
|
|
6256
|
+
const solutionMapString = data[solutionMapKey];
|
|
6257
|
+
if (!solutionMapString || !solutionMapString.includes("[ONAYLI CEVAP]"))
|
|
6258
|
+
return null;
|
|
6259
|
+
let solutionMap;
|
|
6260
|
+
try {
|
|
6261
|
+
solutionMap = JSON.parse(solutionMapString);
|
|
6262
|
+
} catch (error) {
|
|
6263
|
+
console.error("Error parsing solution map:", error);
|
|
6264
|
+
return null;
|
|
6269
6265
|
}
|
|
6270
|
-
if (!
|
|
6271
|
-
const solutionMap = JSON.parse(solutionMapString);
|
|
6272
|
-
if (!solutionMap) return;
|
|
6273
|
-
if (Object.keys(solutionMap).length === 0) return;
|
|
6266
|
+
if (!solutionMap || Object.keys(solutionMap).length === 0) return null;
|
|
6274
6267
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "p-4 border-catchup-blue border-2 rounded-catchup-xlarge", children: [
|
|
6275
6268
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-xl font-bold text-center mb-3", children: i18n_default.t("solution") }),
|
|
6276
|
-
Object.keys(solutionMap).map((key
|
|
6277
|
-
|
|
6269
|
+
Object.keys(solutionMap).map((key) => {
|
|
6270
|
+
let currentItem;
|
|
6271
|
+
try {
|
|
6272
|
+
currentItem = JSON.parse(solutionMap[key]);
|
|
6273
|
+
} catch (error) {
|
|
6274
|
+
console.error(`Error parsing solution item at key ${key}:`, error);
|
|
6275
|
+
return null;
|
|
6276
|
+
}
|
|
6278
6277
|
const { value } = currentItem;
|
|
6279
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("
|
|
6280
|
-
|
|
6281
|
-
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
(
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
},
|
|
6290
|
-
index2
|
|
6291
|
-
)
|
|
6292
|
-
)
|
|
6293
|
-
},
|
|
6294
|
-
`${key}_${index}`
|
|
6295
|
-
) });
|
|
6278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "my-3", children: constructInputWithSpecialExpressionList(value).map(
|
|
6279
|
+
(inputPart, partIndex) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
6280
|
+
"span",
|
|
6281
|
+
{
|
|
6282
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6283
|
+
children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "text-2xl", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_react_katex10.InlineMath, { math: inputPart.value }) }) : inputPart.value
|
|
6284
|
+
},
|
|
6285
|
+
`${key}_part_${partIndex}`
|
|
6286
|
+
)
|
|
6287
|
+
) }, key);
|
|
6296
6288
|
})
|
|
6297
6289
|
] }) });
|
|
6298
6290
|
};
|
|
@@ -7366,7 +7358,7 @@ var filterUserRoleOptionList = (accountType, userProfileRole) => {
|
|
|
7366
7358
|
} else {
|
|
7367
7359
|
if (userProfileRole === "STAFF") {
|
|
7368
7360
|
return retrieveUserRoleOptionList().filter(
|
|
7369
|
-
(userRoleOption) => userRoleOption.value === "STAFF" || userRoleOption.value === "LEARNER"
|
|
7361
|
+
(userRoleOption) => userRoleOption.value === "STAFF" || userRoleOption.value === "LEARNER" || userRoleOption.value === "CONTENT_CREATOR"
|
|
7370
7362
|
);
|
|
7371
7363
|
} else if (userProfileRole === "INDIVIDUAL") {
|
|
7372
7364
|
return retrieveUserRoleOptionList().filter(
|
package/dist/index.mjs
CHANGED
|
@@ -6047,60 +6047,52 @@ var ActivitySolutionContent = ({
|
|
|
6047
6047
|
activityTemplateType,
|
|
6048
6048
|
data
|
|
6049
6049
|
}) => {
|
|
6050
|
-
if (!activityTemplateType) return;
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
solutionMapString = data["openEndedSolutionMap"];
|
|
6074
|
-
} else if (activityTemplateType === "TRUE_FALSE") {
|
|
6075
|
-
if (data["trueFalseSolutionMap"])
|
|
6076
|
-
solutionMapString = data["trueFalseSolutionMap"];
|
|
6050
|
+
if (!activityTemplateType) return null;
|
|
6051
|
+
const solutionMapKeys = {
|
|
6052
|
+
ORDERING: "orderingSolutionMap",
|
|
6053
|
+
DROPDOWN: "dropdownSolutionMap",
|
|
6054
|
+
MCSA: "MCSASolutionMap",
|
|
6055
|
+
MCMA: "MCMASolutionMap",
|
|
6056
|
+
MATCHING: "matchingSolutionMap",
|
|
6057
|
+
GROUPING: "groupingSolutionMap",
|
|
6058
|
+
FILL_IN_THE_BLANKS: "fillInTheBlanksSolutionMap",
|
|
6059
|
+
OPEN_ENDED: "openEndedSolutionMap",
|
|
6060
|
+
TRUE_FALSE: "trueFalseSolutionMap"
|
|
6061
|
+
};
|
|
6062
|
+
const solutionMapKey = solutionMapKeys[activityTemplateType];
|
|
6063
|
+
if (!solutionMapKey) return null;
|
|
6064
|
+
const solutionMapString = data[solutionMapKey];
|
|
6065
|
+
if (!solutionMapString || !solutionMapString.includes("[ONAYLI CEVAP]"))
|
|
6066
|
+
return null;
|
|
6067
|
+
let solutionMap;
|
|
6068
|
+
try {
|
|
6069
|
+
solutionMap = JSON.parse(solutionMapString);
|
|
6070
|
+
} catch (error) {
|
|
6071
|
+
console.error("Error parsing solution map:", error);
|
|
6072
|
+
return null;
|
|
6077
6073
|
}
|
|
6078
|
-
if (!
|
|
6079
|
-
const solutionMap = JSON.parse(solutionMapString);
|
|
6080
|
-
if (!solutionMap) return;
|
|
6081
|
-
if (Object.keys(solutionMap).length === 0) return;
|
|
6074
|
+
if (!solutionMap || Object.keys(solutionMap).length === 0) return null;
|
|
6082
6075
|
return /* @__PURE__ */ jsx40("div", { className: "mx-2", children: /* @__PURE__ */ jsxs30("div", { className: "p-4 border-catchup-blue border-2 rounded-catchup-xlarge", children: [
|
|
6083
6076
|
/* @__PURE__ */ jsx40("p", { className: "text-xl font-bold text-center mb-3", children: i18n_default.t("solution") }),
|
|
6084
|
-
Object.keys(solutionMap).map((key
|
|
6085
|
-
|
|
6077
|
+
Object.keys(solutionMap).map((key) => {
|
|
6078
|
+
let currentItem;
|
|
6079
|
+
try {
|
|
6080
|
+
currentItem = JSON.parse(solutionMap[key]);
|
|
6081
|
+
} catch (error) {
|
|
6082
|
+
console.error(`Error parsing solution item at key ${key}:`, error);
|
|
6083
|
+
return null;
|
|
6084
|
+
}
|
|
6086
6085
|
const { value } = currentItem;
|
|
6087
|
-
return /* @__PURE__ */ jsx40("
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
(
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
},
|
|
6098
|
-
index2
|
|
6099
|
-
)
|
|
6100
|
-
)
|
|
6101
|
-
},
|
|
6102
|
-
`${key}_${index}`
|
|
6103
|
-
) });
|
|
6086
|
+
return /* @__PURE__ */ jsx40("div", { className: "my-3", children: constructInputWithSpecialExpressionList(value).map(
|
|
6087
|
+
(inputPart, partIndex) => /* @__PURE__ */ jsx40(
|
|
6088
|
+
"span",
|
|
6089
|
+
{
|
|
6090
|
+
className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
|
|
6091
|
+
children: inputPart.isEquation ? /* @__PURE__ */ jsx40("span", { className: "text-2xl", children: /* @__PURE__ */ jsx40(InlineMath10, { math: inputPart.value }) }) : inputPart.value
|
|
6092
|
+
},
|
|
6093
|
+
`${key}_part_${partIndex}`
|
|
6094
|
+
)
|
|
6095
|
+
) }, key);
|
|
6104
6096
|
})
|
|
6105
6097
|
] }) });
|
|
6106
6098
|
};
|
|
@@ -7174,7 +7166,7 @@ var filterUserRoleOptionList = (accountType, userProfileRole) => {
|
|
|
7174
7166
|
} else {
|
|
7175
7167
|
if (userProfileRole === "STAFF") {
|
|
7176
7168
|
return retrieveUserRoleOptionList().filter(
|
|
7177
|
-
(userRoleOption) => userRoleOption.value === "STAFF" || userRoleOption.value === "LEARNER"
|
|
7169
|
+
(userRoleOption) => userRoleOption.value === "STAFF" || userRoleOption.value === "LEARNER" || userRoleOption.value === "CONTENT_CREATOR"
|
|
7178
7170
|
);
|
|
7179
7171
|
} else if (userProfileRole === "INDIVIDUAL") {
|
|
7180
7172
|
return retrieveUserRoleOptionList().filter(
|
package/package.json
CHANGED
|
@@ -7,75 +7,78 @@ const ActivitySolutionContent = ({
|
|
|
7
7
|
activityTemplateType,
|
|
8
8
|
data,
|
|
9
9
|
}: IActivitySolutionProps) => {
|
|
10
|
-
if (!activityTemplateType) return;
|
|
10
|
+
if (!activityTemplateType) return null;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
12
|
+
// Map activity types to their corresponding solution map keys
|
|
13
|
+
const solutionMapKeys: any = {
|
|
14
|
+
ORDERING: "orderingSolutionMap",
|
|
15
|
+
DROPDOWN: "dropdownSolutionMap",
|
|
16
|
+
MCSA: "MCSASolutionMap",
|
|
17
|
+
MCMA: "MCMASolutionMap",
|
|
18
|
+
MATCHING: "matchingSolutionMap",
|
|
19
|
+
GROUPING: "groupingSolutionMap",
|
|
20
|
+
FILL_IN_THE_BLANKS: "fillInTheBlanksSolutionMap",
|
|
21
|
+
OPEN_ENDED: "openEndedSolutionMap",
|
|
22
|
+
TRUE_FALSE: "trueFalseSolutionMap",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const solutionMapKey = solutionMapKeys[activityTemplateType];
|
|
26
|
+
|
|
27
|
+
if (!solutionMapKey) return null;
|
|
28
|
+
|
|
29
|
+
const solutionMapString = data[solutionMapKey];
|
|
30
|
+
|
|
31
|
+
if (!solutionMapString || !solutionMapString.includes("[ONAYLI CEVAP]"))
|
|
32
|
+
return null;
|
|
33
|
+
|
|
34
|
+
let solutionMap;
|
|
35
|
+
try {
|
|
36
|
+
solutionMap = JSON.parse(solutionMapString);
|
|
37
|
+
} catch (error) {
|
|
38
|
+
console.error("Error parsing solution map:", error);
|
|
39
|
+
return null;
|
|
38
40
|
}
|
|
39
|
-
if (!solutionMapString.includes("[ONAYLI CEVAP]")) return;
|
|
40
|
-
const solutionMap = JSON.parse(solutionMapString);
|
|
41
|
-
if (!solutionMap) return;
|
|
42
41
|
|
|
43
|
-
if (Object.keys(solutionMap).length === 0) return;
|
|
42
|
+
if (!solutionMap || Object.keys(solutionMap).length === 0) return null;
|
|
43
|
+
|
|
44
44
|
return (
|
|
45
45
|
<div className="mx-2">
|
|
46
46
|
<div className="p-4 border-catchup-blue border-2 rounded-catchup-xlarge">
|
|
47
47
|
<p className="text-xl font-bold text-center mb-3">
|
|
48
48
|
{i18n.t("solution")}
|
|
49
49
|
</p>
|
|
50
|
-
{Object.keys(solutionMap).map((key
|
|
51
|
-
|
|
50
|
+
{Object.keys(solutionMap).map((key) => {
|
|
51
|
+
let currentItem;
|
|
52
|
+
try {
|
|
53
|
+
currentItem = JSON.parse(solutionMap[key]);
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error(`Error parsing solution item at key ${key}:`, error);
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
const { value } = currentItem;
|
|
60
|
+
|
|
53
61
|
return (
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
</span>
|
|
75
|
-
)
|
|
76
|
-
)}
|
|
77
|
-
</span>
|
|
78
|
-
</p>
|
|
62
|
+
<div key={key} className="my-3">
|
|
63
|
+
{constructInputWithSpecialExpressionList(value).map(
|
|
64
|
+
(inputPart, partIndex) => (
|
|
65
|
+
<span
|
|
66
|
+
key={`${key}_part_${partIndex}`}
|
|
67
|
+
className={`${inputPart.isBold ? "font-bold" : ""} ${
|
|
68
|
+
inputPart.isUnderline ? "underline" : ""
|
|
69
|
+
}`}
|
|
70
|
+
>
|
|
71
|
+
{inputPart.isEquation ? (
|
|
72
|
+
<span className="text-2xl">
|
|
73
|
+
<InlineMath math={inputPart.value} />
|
|
74
|
+
</span>
|
|
75
|
+
) : (
|
|
76
|
+
inputPart.value
|
|
77
|
+
)}
|
|
78
|
+
</span>
|
|
79
|
+
)
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
79
82
|
);
|
|
80
83
|
})}
|
|
81
84
|
</div>
|
|
@@ -541,7 +541,9 @@ export const filterUserRoleOptionList = (
|
|
|
541
541
|
if (userProfileRole === "STAFF") {
|
|
542
542
|
return retrieveUserRoleOptionList().filter(
|
|
543
543
|
(userRoleOption) =>
|
|
544
|
-
userRoleOption.value === "STAFF" ||
|
|
544
|
+
userRoleOption.value === "STAFF" ||
|
|
545
|
+
userRoleOption.value === "LEARNER" ||
|
|
546
|
+
userRoleOption.value === "CONTENT_CREATOR"
|
|
545
547
|
);
|
|
546
548
|
} else if (userProfileRole === "INDIVIDUAL") {
|
|
547
549
|
return retrieveUserRoleOptionList().filter(
|