catchup-library-web 2.1.2 → 2.1.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
|
@@ -596,7 +596,7 @@ declare const convertToBodyMapString: (type: string, bodyMap: any) => any;
|
|
|
596
596
|
declare const convertToSolutionMapString: (type: string, solutionMap: any) => any;
|
|
597
597
|
declare const convertToEvaluationRubricMapString: (type: string, evaluationRubricMap: any) => any;
|
|
598
598
|
declare const constructActivityData: (activityTemplateType: string, contentMap: any, bodyMap: any, materialMap: any, solutionMap: any, difficulty: string, evaluationRubricMap: any) => any;
|
|
599
|
-
declare const constructAnswerBasedOnData: (data: any) => any;
|
|
599
|
+
declare const constructAnswerBasedOnData: (type: string, data: any) => any;
|
|
600
600
|
declare const constructActivityItemListBodyOnly: (bodyMap: any) => any;
|
|
601
601
|
declare const constructActivityItemListMaterialOnly: (materialMap: any, type: string) => {
|
|
602
602
|
type: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -596,7 +596,7 @@ declare const convertToBodyMapString: (type: string, bodyMap: any) => any;
|
|
|
596
596
|
declare const convertToSolutionMapString: (type: string, solutionMap: any) => any;
|
|
597
597
|
declare const convertToEvaluationRubricMapString: (type: string, evaluationRubricMap: any) => any;
|
|
598
598
|
declare const constructActivityData: (activityTemplateType: string, contentMap: any, bodyMap: any, materialMap: any, solutionMap: any, difficulty: string, evaluationRubricMap: any) => any;
|
|
599
|
-
declare const constructAnswerBasedOnData: (data: any) => any;
|
|
599
|
+
declare const constructAnswerBasedOnData: (type: string, data: any) => any;
|
|
600
600
|
declare const constructActivityItemListBodyOnly: (bodyMap: any) => any;
|
|
601
601
|
declare const constructActivityItemListMaterialOnly: (materialMap: any, type: string) => {
|
|
602
602
|
type: string;
|
package/dist/index.js
CHANGED
|
@@ -2979,56 +2979,35 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2979
2979
|
}
|
|
2980
2980
|
return constructedData;
|
|
2981
2981
|
};
|
|
2982
|
-
var constructAnswerBasedOnData = (data) => {
|
|
2983
|
-
if (Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2984
|
-
return constructActivityAnswerMap(
|
|
2985
|
-
"ORDERING",
|
|
2986
|
-
JSON.parse(JSON.stringify(data))
|
|
2987
|
-
);
|
|
2982
|
+
var constructAnswerBasedOnData = (type, data) => {
|
|
2983
|
+
if (type === "ORDERING" && Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2984
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2988
2985
|
}
|
|
2989
|
-
if (Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2990
|
-
return constructActivityAnswerMap(
|
|
2991
|
-
"DROPDOWN",
|
|
2992
|
-
JSON.parse(JSON.stringify(data))
|
|
2993
|
-
);
|
|
2986
|
+
if (type === "DROPDOWN" && Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2987
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2994
2988
|
}
|
|
2995
|
-
if (Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2996
|
-
return constructActivityAnswerMap(
|
|
2989
|
+
if (type === "MCSA" && Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2990
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2997
2991
|
}
|
|
2998
|
-
if (Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2999
|
-
return constructActivityAnswerMap(
|
|
2992
|
+
if (type === "MCMA" && Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2993
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3000
2994
|
}
|
|
3001
|
-
if (Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
3002
|
-
return constructActivityAnswerMap(
|
|
3003
|
-
"MATCHING",
|
|
3004
|
-
JSON.parse(JSON.stringify(data))
|
|
3005
|
-
);
|
|
2995
|
+
if (type === "MATCHING" && Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
2996
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3006
2997
|
}
|
|
3007
|
-
if (Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
3008
|
-
return constructActivityAnswerMap(
|
|
3009
|
-
"GROUPING",
|
|
3010
|
-
JSON.parse(JSON.stringify(data))
|
|
3011
|
-
);
|
|
2998
|
+
if (type === "GROUPING" && Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
2999
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3012
3000
|
}
|
|
3013
|
-
if (Object.keys(data).find(
|
|
3001
|
+
if (type === "FILL_IN_THE_BLANKS" && Object.keys(data).find(
|
|
3014
3002
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
3015
3003
|
)) {
|
|
3016
|
-
return constructActivityAnswerMap(
|
|
3017
|
-
"FILL_IN_THE_BLANKS",
|
|
3018
|
-
JSON.parse(JSON.stringify(data))
|
|
3019
|
-
);
|
|
3004
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3020
3005
|
}
|
|
3021
|
-
if (Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
3022
|
-
return constructActivityAnswerMap(
|
|
3023
|
-
"OPEN_ENDED",
|
|
3024
|
-
JSON.parse(JSON.stringify(data))
|
|
3025
|
-
);
|
|
3006
|
+
if (type === "OPEN_ENDED" && Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
3007
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3026
3008
|
}
|
|
3027
|
-
if (Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
3028
|
-
return constructActivityAnswerMap(
|
|
3029
|
-
"TRUE_FALSE",
|
|
3030
|
-
JSON.parse(JSON.stringify(data))
|
|
3031
|
-
);
|
|
3009
|
+
if (type === "TRUE_FALSE" && Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
3010
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
3032
3011
|
}
|
|
3033
3012
|
return {};
|
|
3034
3013
|
};
|
|
@@ -7281,7 +7260,8 @@ var ActivityPreviewByData = ({
|
|
|
7281
7260
|
}
|
|
7282
7261
|
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
7283
7262
|
if (!data) return;
|
|
7284
|
-
|
|
7263
|
+
if (!selectedType) return;
|
|
7264
|
+
const answerMap = constructAnswerBasedOnData(selectedType, data);
|
|
7285
7265
|
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { children: [
|
|
7286
7266
|
showType ? /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
7287
7267
|
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mb-4", children: [
|
package/dist/index.mjs
CHANGED
|
@@ -2755,56 +2755,35 @@ var constructActivityData = (activityTemplateType, contentMap, bodyMap, material
|
|
|
2755
2755
|
}
|
|
2756
2756
|
return constructedData;
|
|
2757
2757
|
};
|
|
2758
|
-
var constructAnswerBasedOnData = (data) => {
|
|
2759
|
-
if (Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2760
|
-
return constructActivityAnswerMap(
|
|
2761
|
-
"ORDERING",
|
|
2762
|
-
JSON.parse(JSON.stringify(data))
|
|
2763
|
-
);
|
|
2758
|
+
var constructAnswerBasedOnData = (type, data) => {
|
|
2759
|
+
if (type === "ORDERING" && Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")) {
|
|
2760
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2764
2761
|
}
|
|
2765
|
-
if (Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2766
|
-
return constructActivityAnswerMap(
|
|
2767
|
-
"DROPDOWN",
|
|
2768
|
-
JSON.parse(JSON.stringify(data))
|
|
2769
|
-
);
|
|
2762
|
+
if (type === "DROPDOWN" && Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")) {
|
|
2763
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2770
2764
|
}
|
|
2771
|
-
if (Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2772
|
-
return constructActivityAnswerMap(
|
|
2765
|
+
if (type === "MCSA" && Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")) {
|
|
2766
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2773
2767
|
}
|
|
2774
|
-
if (Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2775
|
-
return constructActivityAnswerMap(
|
|
2768
|
+
if (type === "MCMA" && Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")) {
|
|
2769
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2776
2770
|
}
|
|
2777
|
-
if (Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
2778
|
-
return constructActivityAnswerMap(
|
|
2779
|
-
"MATCHING",
|
|
2780
|
-
JSON.parse(JSON.stringify(data))
|
|
2781
|
-
);
|
|
2771
|
+
if (type === "MATCHING" && Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")) {
|
|
2772
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2782
2773
|
}
|
|
2783
|
-
if (Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
2784
|
-
return constructActivityAnswerMap(
|
|
2785
|
-
"GROUPING",
|
|
2786
|
-
JSON.parse(JSON.stringify(data))
|
|
2787
|
-
);
|
|
2774
|
+
if (type === "GROUPING" && Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")) {
|
|
2775
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2788
2776
|
}
|
|
2789
|
-
if (Object.keys(data).find(
|
|
2777
|
+
if (type === "FILL_IN_THE_BLANKS" && Object.keys(data).find(
|
|
2790
2778
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
2791
2779
|
)) {
|
|
2792
|
-
return constructActivityAnswerMap(
|
|
2793
|
-
"FILL_IN_THE_BLANKS",
|
|
2794
|
-
JSON.parse(JSON.stringify(data))
|
|
2795
|
-
);
|
|
2780
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2796
2781
|
}
|
|
2797
|
-
if (Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
2798
|
-
return constructActivityAnswerMap(
|
|
2799
|
-
"OPEN_ENDED",
|
|
2800
|
-
JSON.parse(JSON.stringify(data))
|
|
2801
|
-
);
|
|
2782
|
+
if (type === "OPEN_ENDED" && Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")) {
|
|
2783
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2802
2784
|
}
|
|
2803
|
-
if (Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
2804
|
-
return constructActivityAnswerMap(
|
|
2805
|
-
"TRUE_FALSE",
|
|
2806
|
-
JSON.parse(JSON.stringify(data))
|
|
2807
|
-
);
|
|
2785
|
+
if (type === "TRUE_FALSE" && Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")) {
|
|
2786
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
2808
2787
|
}
|
|
2809
2788
|
return {};
|
|
2810
2789
|
};
|
|
@@ -7057,7 +7036,8 @@ var ActivityPreviewByData = ({
|
|
|
7057
7036
|
}
|
|
7058
7037
|
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
7059
7038
|
if (!data) return;
|
|
7060
|
-
|
|
7039
|
+
if (!selectedType) return;
|
|
7040
|
+
const answerMap = constructAnswerBasedOnData(selectedType, data);
|
|
7061
7041
|
return /* @__PURE__ */ jsxs36("div", { children: [
|
|
7062
7042
|
showType ? /* @__PURE__ */ jsxs36(Fragment11, { children: [
|
|
7063
7043
|
/* @__PURE__ */ jsxs36("div", { className: "mb-4", children: [
|
package/package.json
CHANGED
|
@@ -80,7 +80,8 @@ const ActivityPreviewByData = ({
|
|
|
80
80
|
}, [data, lockedType, typeOptionList, showDifficulty]);
|
|
81
81
|
|
|
82
82
|
if (!data) return;
|
|
83
|
-
|
|
83
|
+
if (!selectedType) return;
|
|
84
|
+
const answerMap = constructAnswerBasedOnData(selectedType, data);
|
|
84
85
|
|
|
85
86
|
return (
|
|
86
87
|
<div key={key}>
|
|
@@ -1928,58 +1928,62 @@ export const constructActivityData = (
|
|
|
1928
1928
|
return constructedData;
|
|
1929
1929
|
};
|
|
1930
1930
|
|
|
1931
|
-
export const constructAnswerBasedOnData = (data: any) => {
|
|
1932
|
-
if (
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
);
|
|
1931
|
+
export const constructAnswerBasedOnData = (type: string, data: any) => {
|
|
1932
|
+
if (
|
|
1933
|
+
type === "ORDERING" &&
|
|
1934
|
+
Object.keys(data).find((dataKey) => dataKey === "orderingMaterialMap")
|
|
1935
|
+
) {
|
|
1936
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1937
1937
|
}
|
|
1938
|
-
if (
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
);
|
|
1938
|
+
if (
|
|
1939
|
+
type === "DROPDOWN" &&
|
|
1940
|
+
Object.keys(data).find((dataKey) => dataKey === "dropdownMaterialMap")
|
|
1941
|
+
) {
|
|
1942
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1943
1943
|
}
|
|
1944
|
-
if (
|
|
1945
|
-
|
|
1944
|
+
if (
|
|
1945
|
+
type === "MCSA" &&
|
|
1946
|
+
Object.keys(data).find((dataKey) => dataKey === "MCSAMaterialMap")
|
|
1947
|
+
) {
|
|
1948
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1946
1949
|
}
|
|
1947
|
-
if (
|
|
1948
|
-
|
|
1950
|
+
if (
|
|
1951
|
+
type === "MCMA" &&
|
|
1952
|
+
Object.keys(data).find((dataKey) => dataKey === "MCMAMaterialMap")
|
|
1953
|
+
) {
|
|
1954
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1949
1955
|
}
|
|
1950
|
-
if (
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
);
|
|
1956
|
+
if (
|
|
1957
|
+
type === "MATCHING" &&
|
|
1958
|
+
Object.keys(data).find((dataKey) => dataKey === "matchingMaterialMap")
|
|
1959
|
+
) {
|
|
1960
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1955
1961
|
}
|
|
1956
|
-
if (
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
);
|
|
1962
|
+
if (
|
|
1963
|
+
type === "GROUPING" &&
|
|
1964
|
+
Object.keys(data).find((dataKey) => dataKey === "groupingMaterialMap")
|
|
1965
|
+
) {
|
|
1966
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1961
1967
|
}
|
|
1962
1968
|
if (
|
|
1969
|
+
type === "FILL_IN_THE_BLANKS" &&
|
|
1963
1970
|
Object.keys(data).find(
|
|
1964
1971
|
(dataKey) => dataKey === "fillInTheBlanksMaterialMap"
|
|
1965
1972
|
)
|
|
1966
1973
|
) {
|
|
1967
|
-
return constructActivityAnswerMap(
|
|
1968
|
-
"FILL_IN_THE_BLANKS",
|
|
1969
|
-
JSON.parse(JSON.stringify(data))
|
|
1970
|
-
);
|
|
1974
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1971
1975
|
}
|
|
1972
|
-
if (
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
);
|
|
1976
|
+
if (
|
|
1977
|
+
type === "OPEN_ENDED" &&
|
|
1978
|
+
Object.keys(data).find((dataKey) => dataKey === "openEndedMaterialMap")
|
|
1979
|
+
) {
|
|
1980
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1977
1981
|
}
|
|
1978
|
-
if (
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
);
|
|
1982
|
+
if (
|
|
1983
|
+
type === "TRUE_FALSE" &&
|
|
1984
|
+
Object.keys(data).find((dataKey) => dataKey === "trueFalseMaterialMap")
|
|
1985
|
+
) {
|
|
1986
|
+
return constructActivityAnswerMap(type, JSON.parse(JSON.stringify(data)));
|
|
1983
1987
|
}
|
|
1984
1988
|
return {};
|
|
1985
1989
|
};
|