catchup-library-web 1.0.20 → 1.0.22
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 +121 -122
- package/dist/index.mjs +121 -122
- package/package.json +1 -1
- package/src/components/activities/ActivityPreviewByData.tsx +110 -113
package/dist/index.js
CHANGED
|
@@ -5930,11 +5930,6 @@ var ActivityPreviewByData = ({
|
|
|
5930
5930
|
}) => {
|
|
5931
5931
|
const [selectedType, setSelectedType] = (0, import_react24.useState)(null);
|
|
5932
5932
|
const [optionList, setOptionList] = (0, import_react24.useState)([]);
|
|
5933
|
-
console.log("inner selected type: ", selectedType);
|
|
5934
|
-
(0, import_react24.useEffect)(() => {
|
|
5935
|
-
setSelectedType(null);
|
|
5936
|
-
setOptionList([]);
|
|
5937
|
-
}, []);
|
|
5938
5933
|
(0, import_react24.useEffect)(() => {
|
|
5939
5934
|
if (!typeOptionList) return;
|
|
5940
5935
|
if (typeOptionList.length === 0) return;
|
|
@@ -5982,17 +5977,18 @@ var ActivityPreviewByData = ({
|
|
|
5982
5977
|
if (showTaxonomy) {
|
|
5983
5978
|
setOptionList(
|
|
5984
5979
|
typeOptionList.map((typeOption) => __spreadProps(__spreadValues({}, typeOption), {
|
|
5985
|
-
|
|
5980
|
+
subText: retrieveTaxonomyNameByActivityTypeFromData(typeOption)
|
|
5986
5981
|
}))
|
|
5987
5982
|
);
|
|
5988
5983
|
} else {
|
|
5989
5984
|
setOptionList(typeOptionList);
|
|
5990
5985
|
}
|
|
5991
5986
|
}, [data, typeOptionList, showTaxonomy]);
|
|
5987
|
+
console.log(optionList);
|
|
5992
5988
|
if (!data) return;
|
|
5993
5989
|
const answer = constructAnswerBasedOnData(data);
|
|
5994
5990
|
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
|
|
5995
|
-
showType ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5991
|
+
showType ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
5996
5992
|
SelectionBox_default,
|
|
5997
5993
|
{
|
|
5998
5994
|
optionList,
|
|
@@ -6001,121 +5997,124 @@ var ActivityPreviewByData = ({
|
|
|
6001
5997
|
setSelectedType(itemId);
|
|
6002
5998
|
}
|
|
6003
5999
|
}
|
|
6004
|
-
)
|
|
6005
|
-
selectedType ?
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6069
|
-
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6000
|
+
) : null,
|
|
6001
|
+
selectedType ? /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "", children: [
|
|
6002
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(DividerLine_default, {}),
|
|
6003
|
+
selectedType === "ORDERING" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6004
|
+
OrderingActivityContent_default,
|
|
6005
|
+
{
|
|
6006
|
+
answer,
|
|
6007
|
+
changeAnswer: () => {
|
|
6008
|
+
},
|
|
6009
|
+
canAnswerQuestion: () => {
|
|
6010
|
+
return true;
|
|
6011
|
+
},
|
|
6012
|
+
data,
|
|
6013
|
+
isPreview: true,
|
|
6014
|
+
showCorrectAnswer: true
|
|
6015
|
+
}
|
|
6016
|
+
) : selectedType === "DROPDOWN" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6017
|
+
DropdownActivityContent_default,
|
|
6018
|
+
{
|
|
6019
|
+
answer,
|
|
6020
|
+
changeAnswer: () => {
|
|
6021
|
+
},
|
|
6022
|
+
canAnswerQuestion: () => {
|
|
6023
|
+
return true;
|
|
6024
|
+
},
|
|
6025
|
+
data,
|
|
6026
|
+
isPreview: true,
|
|
6027
|
+
showCorrectAnswer: true
|
|
6028
|
+
}
|
|
6029
|
+
) : selectedType === "MCSA" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6030
|
+
MCSAActivityContent_default,
|
|
6031
|
+
{
|
|
6032
|
+
answer,
|
|
6033
|
+
changeAnswer: () => {
|
|
6034
|
+
},
|
|
6035
|
+
canAnswerQuestion: () => {
|
|
6036
|
+
return true;
|
|
6037
|
+
},
|
|
6038
|
+
data,
|
|
6039
|
+
isPreview: true,
|
|
6040
|
+
showCorrectAnswer: true
|
|
6041
|
+
}
|
|
6042
|
+
) : selectedType === "MCMA" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6043
|
+
MCMAActivityContent_default,
|
|
6044
|
+
{
|
|
6045
|
+
answer,
|
|
6046
|
+
changeAnswer: () => {
|
|
6047
|
+
},
|
|
6048
|
+
canAnswerQuestion: () => {
|
|
6049
|
+
return true;
|
|
6050
|
+
},
|
|
6051
|
+
data,
|
|
6052
|
+
isPreview: true,
|
|
6053
|
+
showCorrectAnswer: true
|
|
6054
|
+
}
|
|
6055
|
+
) : selectedType === "MATCHING" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6056
|
+
MatchingActivityContent_default,
|
|
6057
|
+
{
|
|
6058
|
+
answer,
|
|
6059
|
+
changeAnswer: () => {
|
|
6060
|
+
},
|
|
6061
|
+
canAnswerQuestion: () => {
|
|
6062
|
+
return true;
|
|
6063
|
+
},
|
|
6064
|
+
data,
|
|
6065
|
+
isPreview: true,
|
|
6066
|
+
showCorrectAnswer: true
|
|
6067
|
+
}
|
|
6068
|
+
) : selectedType === "GROUPING" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6069
|
+
GroupingActivityContent_default,
|
|
6070
|
+
{
|
|
6071
|
+
answer,
|
|
6072
|
+
changeAnswer: () => {
|
|
6073
|
+
},
|
|
6074
|
+
canAnswerQuestion: () => {
|
|
6075
|
+
return true;
|
|
6076
|
+
},
|
|
6077
|
+
data,
|
|
6078
|
+
isPreview: true,
|
|
6079
|
+
showCorrectAnswer: true
|
|
6080
|
+
}
|
|
6081
|
+
) : selectedType === "FILL_IN_THE_BLANKS" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6082
|
+
FillInTheBlanksActivityContent_default,
|
|
6083
|
+
{
|
|
6084
|
+
answer,
|
|
6085
|
+
changeAnswer: () => {
|
|
6086
|
+
},
|
|
6087
|
+
canAnswerQuestion: () => {
|
|
6088
|
+
return true;
|
|
6089
|
+
},
|
|
6090
|
+
data,
|
|
6091
|
+
isPreview: true,
|
|
6092
|
+
showCorrectAnswer: true
|
|
6093
|
+
}
|
|
6094
|
+
) : selectedType === "OPEN_ENDED" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6095
|
+
OpenEndedActivityContent_default,
|
|
6096
|
+
{
|
|
6097
|
+
answer,
|
|
6098
|
+
changeAnswer: () => {
|
|
6099
|
+
},
|
|
6100
|
+
showMaterialContent: false,
|
|
6101
|
+
data
|
|
6102
|
+
}
|
|
6103
|
+
) : selectedType === "TRUE_FALSE" ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6104
|
+
TrueFalseActivityContent_default,
|
|
6105
|
+
{
|
|
6106
|
+
answer,
|
|
6107
|
+
changeAnswer: () => {
|
|
6108
|
+
},
|
|
6109
|
+
canAnswerQuestion: () => {
|
|
6110
|
+
return true;
|
|
6111
|
+
},
|
|
6112
|
+
data,
|
|
6113
|
+
isPreview: true,
|
|
6114
|
+
showCorrectAnswer: true
|
|
6115
|
+
}
|
|
6116
|
+
) : null
|
|
6117
|
+
] }) : null,
|
|
6119
6118
|
selectedType && showSolution ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "my-4", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
6120
6119
|
ActivitySolutionContent_default,
|
|
6121
6120
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -5756,11 +5756,6 @@ var ActivityPreviewByData = ({
|
|
|
5756
5756
|
}) => {
|
|
5757
5757
|
const [selectedType, setSelectedType] = useState19(null);
|
|
5758
5758
|
const [optionList, setOptionList] = useState19([]);
|
|
5759
|
-
console.log("inner selected type: ", selectedType);
|
|
5760
|
-
useEffect11(() => {
|
|
5761
|
-
setSelectedType(null);
|
|
5762
|
-
setOptionList([]);
|
|
5763
|
-
}, []);
|
|
5764
5759
|
useEffect11(() => {
|
|
5765
5760
|
if (!typeOptionList) return;
|
|
5766
5761
|
if (typeOptionList.length === 0) return;
|
|
@@ -5808,17 +5803,18 @@ var ActivityPreviewByData = ({
|
|
|
5808
5803
|
if (showTaxonomy) {
|
|
5809
5804
|
setOptionList(
|
|
5810
5805
|
typeOptionList.map((typeOption) => __spreadProps(__spreadValues({}, typeOption), {
|
|
5811
|
-
|
|
5806
|
+
subText: retrieveTaxonomyNameByActivityTypeFromData(typeOption)
|
|
5812
5807
|
}))
|
|
5813
5808
|
);
|
|
5814
5809
|
} else {
|
|
5815
5810
|
setOptionList(typeOptionList);
|
|
5816
5811
|
}
|
|
5817
5812
|
}, [data, typeOptionList, showTaxonomy]);
|
|
5813
|
+
console.log(optionList);
|
|
5818
5814
|
if (!data) return;
|
|
5819
5815
|
const answer = constructAnswerBasedOnData(data);
|
|
5820
5816
|
return /* @__PURE__ */ jsxs32(Fragment9, { children: [
|
|
5821
|
-
showType ? /* @__PURE__ */ jsx41(
|
|
5817
|
+
showType ? /* @__PURE__ */ jsx41(
|
|
5822
5818
|
SelectionBox_default,
|
|
5823
5819
|
{
|
|
5824
5820
|
optionList,
|
|
@@ -5827,121 +5823,124 @@ var ActivityPreviewByData = ({
|
|
|
5827
5823
|
setSelectedType(itemId);
|
|
5828
5824
|
}
|
|
5829
5825
|
}
|
|
5830
|
-
)
|
|
5831
|
-
selectedType ?
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5826
|
+
) : null,
|
|
5827
|
+
selectedType ? /* @__PURE__ */ jsxs32("div", { className: "", children: [
|
|
5828
|
+
/* @__PURE__ */ jsx41(DividerLine_default, {}),
|
|
5829
|
+
selectedType === "ORDERING" ? /* @__PURE__ */ jsx41(
|
|
5830
|
+
OrderingActivityContent_default,
|
|
5831
|
+
{
|
|
5832
|
+
answer,
|
|
5833
|
+
changeAnswer: () => {
|
|
5834
|
+
},
|
|
5835
|
+
canAnswerQuestion: () => {
|
|
5836
|
+
return true;
|
|
5837
|
+
},
|
|
5838
|
+
data,
|
|
5839
|
+
isPreview: true,
|
|
5840
|
+
showCorrectAnswer: true
|
|
5841
|
+
}
|
|
5842
|
+
) : selectedType === "DROPDOWN" ? /* @__PURE__ */ jsx41(
|
|
5843
|
+
DropdownActivityContent_default,
|
|
5844
|
+
{
|
|
5845
|
+
answer,
|
|
5846
|
+
changeAnswer: () => {
|
|
5847
|
+
},
|
|
5848
|
+
canAnswerQuestion: () => {
|
|
5849
|
+
return true;
|
|
5850
|
+
},
|
|
5851
|
+
data,
|
|
5852
|
+
isPreview: true,
|
|
5853
|
+
showCorrectAnswer: true
|
|
5854
|
+
}
|
|
5855
|
+
) : selectedType === "MCSA" ? /* @__PURE__ */ jsx41(
|
|
5856
|
+
MCSAActivityContent_default,
|
|
5857
|
+
{
|
|
5858
|
+
answer,
|
|
5859
|
+
changeAnswer: () => {
|
|
5860
|
+
},
|
|
5861
|
+
canAnswerQuestion: () => {
|
|
5862
|
+
return true;
|
|
5863
|
+
},
|
|
5864
|
+
data,
|
|
5865
|
+
isPreview: true,
|
|
5866
|
+
showCorrectAnswer: true
|
|
5867
|
+
}
|
|
5868
|
+
) : selectedType === "MCMA" ? /* @__PURE__ */ jsx41(
|
|
5869
|
+
MCMAActivityContent_default,
|
|
5870
|
+
{
|
|
5871
|
+
answer,
|
|
5872
|
+
changeAnswer: () => {
|
|
5873
|
+
},
|
|
5874
|
+
canAnswerQuestion: () => {
|
|
5875
|
+
return true;
|
|
5876
|
+
},
|
|
5877
|
+
data,
|
|
5878
|
+
isPreview: true,
|
|
5879
|
+
showCorrectAnswer: true
|
|
5880
|
+
}
|
|
5881
|
+
) : selectedType === "MATCHING" ? /* @__PURE__ */ jsx41(
|
|
5882
|
+
MatchingActivityContent_default,
|
|
5883
|
+
{
|
|
5884
|
+
answer,
|
|
5885
|
+
changeAnswer: () => {
|
|
5886
|
+
},
|
|
5887
|
+
canAnswerQuestion: () => {
|
|
5888
|
+
return true;
|
|
5889
|
+
},
|
|
5890
|
+
data,
|
|
5891
|
+
isPreview: true,
|
|
5892
|
+
showCorrectAnswer: true
|
|
5893
|
+
}
|
|
5894
|
+
) : selectedType === "GROUPING" ? /* @__PURE__ */ jsx41(
|
|
5895
|
+
GroupingActivityContent_default,
|
|
5896
|
+
{
|
|
5897
|
+
answer,
|
|
5898
|
+
changeAnswer: () => {
|
|
5899
|
+
},
|
|
5900
|
+
canAnswerQuestion: () => {
|
|
5901
|
+
return true;
|
|
5902
|
+
},
|
|
5903
|
+
data,
|
|
5904
|
+
isPreview: true,
|
|
5905
|
+
showCorrectAnswer: true
|
|
5906
|
+
}
|
|
5907
|
+
) : selectedType === "FILL_IN_THE_BLANKS" ? /* @__PURE__ */ jsx41(
|
|
5908
|
+
FillInTheBlanksActivityContent_default,
|
|
5909
|
+
{
|
|
5910
|
+
answer,
|
|
5911
|
+
changeAnswer: () => {
|
|
5912
|
+
},
|
|
5913
|
+
canAnswerQuestion: () => {
|
|
5914
|
+
return true;
|
|
5915
|
+
},
|
|
5916
|
+
data,
|
|
5917
|
+
isPreview: true,
|
|
5918
|
+
showCorrectAnswer: true
|
|
5919
|
+
}
|
|
5920
|
+
) : selectedType === "OPEN_ENDED" ? /* @__PURE__ */ jsx41(
|
|
5921
|
+
OpenEndedActivityContent_default,
|
|
5922
|
+
{
|
|
5923
|
+
answer,
|
|
5924
|
+
changeAnswer: () => {
|
|
5925
|
+
},
|
|
5926
|
+
showMaterialContent: false,
|
|
5927
|
+
data
|
|
5928
|
+
}
|
|
5929
|
+
) : selectedType === "TRUE_FALSE" ? /* @__PURE__ */ jsx41(
|
|
5930
|
+
TrueFalseActivityContent_default,
|
|
5931
|
+
{
|
|
5932
|
+
answer,
|
|
5933
|
+
changeAnswer: () => {
|
|
5934
|
+
},
|
|
5935
|
+
canAnswerQuestion: () => {
|
|
5936
|
+
return true;
|
|
5937
|
+
},
|
|
5938
|
+
data,
|
|
5939
|
+
isPreview: true,
|
|
5940
|
+
showCorrectAnswer: true
|
|
5941
|
+
}
|
|
5942
|
+
) : null
|
|
5943
|
+
] }) : null,
|
|
5945
5944
|
selectedType && showSolution ? /* @__PURE__ */ jsx41("div", { className: "my-4", children: /* @__PURE__ */ jsx41(
|
|
5946
5945
|
ActivitySolutionContent_default,
|
|
5947
5946
|
{
|
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ import SelectionBox from "../boxes/SelectionBox";
|
|
|
12
12
|
import TrueFalseActivityContent from "./TrueFalseActivityContent";
|
|
13
13
|
import { IActivityPreviewByDataProps } from "../../properties/ActivityProperties";
|
|
14
14
|
import ActivitySolutionContent from "./solution-content/ActivitySolutionContent";
|
|
15
|
+
import DividerLine from "../dividers/DividerLine";
|
|
15
16
|
|
|
16
17
|
const ActivityPreviewByData = ({
|
|
17
18
|
data,
|
|
@@ -24,13 +25,6 @@ const ActivityPreviewByData = ({
|
|
|
24
25
|
const [selectedType, setSelectedType] = useState<string | null>(null);
|
|
25
26
|
const [optionList, setOptionList] = useState<any[]>([]);
|
|
26
27
|
|
|
27
|
-
console.log("inner selected type: ", selectedType);
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
setSelectedType(null);
|
|
31
|
-
setOptionList([]);
|
|
32
|
-
}, []);
|
|
33
|
-
|
|
34
28
|
useEffect(() => {
|
|
35
29
|
if (!typeOptionList) return;
|
|
36
30
|
if (typeOptionList.length === 0) return;
|
|
@@ -80,7 +74,7 @@ const ActivityPreviewByData = ({
|
|
|
80
74
|
setOptionList(
|
|
81
75
|
typeOptionList.map((typeOption) => ({
|
|
82
76
|
...typeOption,
|
|
83
|
-
|
|
77
|
+
subText: retrieveTaxonomyNameByActivityTypeFromData(typeOption),
|
|
84
78
|
}))
|
|
85
79
|
);
|
|
86
80
|
} else {
|
|
@@ -88,119 +82,122 @@ const ActivityPreviewByData = ({
|
|
|
88
82
|
}
|
|
89
83
|
}, [data, typeOptionList, showTaxonomy]);
|
|
90
84
|
|
|
85
|
+
console.log(optionList);
|
|
86
|
+
|
|
91
87
|
if (!data) return;
|
|
92
88
|
const answer = constructAnswerBasedOnData(data);
|
|
93
89
|
|
|
94
90
|
return (
|
|
95
91
|
<>
|
|
96
92
|
{showType ? (
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
/>
|
|
105
|
-
</div>
|
|
93
|
+
<SelectionBox
|
|
94
|
+
optionList={optionList}
|
|
95
|
+
selectedId={selectedType}
|
|
96
|
+
handleSelectOnClick={(itemId) => {
|
|
97
|
+
setSelectedType(itemId);
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
106
100
|
) : null}
|
|
107
101
|
{selectedType ? (
|
|
108
|
-
|
|
109
|
-
<
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
102
|
+
<div className="">
|
|
103
|
+
<DividerLine />
|
|
104
|
+
{selectedType === "ORDERING" ? (
|
|
105
|
+
<OrderingActivityContent
|
|
106
|
+
answer={answer}
|
|
107
|
+
changeAnswer={() => {}}
|
|
108
|
+
canAnswerQuestion={() => {
|
|
109
|
+
return true;
|
|
110
|
+
}}
|
|
111
|
+
data={data}
|
|
112
|
+
isPreview={true}
|
|
113
|
+
showCorrectAnswer={true}
|
|
114
|
+
/>
|
|
115
|
+
) : selectedType === "DROPDOWN" ? (
|
|
116
|
+
<DropdownActivityContent
|
|
117
|
+
answer={answer}
|
|
118
|
+
changeAnswer={() => {}}
|
|
119
|
+
canAnswerQuestion={() => {
|
|
120
|
+
return true;
|
|
121
|
+
}}
|
|
122
|
+
data={data}
|
|
123
|
+
isPreview={true}
|
|
124
|
+
showCorrectAnswer={true}
|
|
125
|
+
/>
|
|
126
|
+
) : selectedType === "MCSA" ? (
|
|
127
|
+
<MCSAActivityContent
|
|
128
|
+
answer={answer}
|
|
129
|
+
changeAnswer={() => {}}
|
|
130
|
+
canAnswerQuestion={() => {
|
|
131
|
+
return true;
|
|
132
|
+
}}
|
|
133
|
+
data={data}
|
|
134
|
+
isPreview={true}
|
|
135
|
+
showCorrectAnswer={true}
|
|
136
|
+
/>
|
|
137
|
+
) : selectedType === "MCMA" ? (
|
|
138
|
+
<MCMAActivityContent
|
|
139
|
+
answer={answer}
|
|
140
|
+
changeAnswer={() => {}}
|
|
141
|
+
canAnswerQuestion={() => {
|
|
142
|
+
return true;
|
|
143
|
+
}}
|
|
144
|
+
data={data}
|
|
145
|
+
isPreview={true}
|
|
146
|
+
showCorrectAnswer={true}
|
|
147
|
+
/>
|
|
148
|
+
) : selectedType === "MATCHING" ? (
|
|
149
|
+
<MatchingActivityContent
|
|
150
|
+
answer={answer}
|
|
151
|
+
changeAnswer={() => {}}
|
|
152
|
+
canAnswerQuestion={() => {
|
|
153
|
+
return true;
|
|
154
|
+
}}
|
|
155
|
+
data={data}
|
|
156
|
+
isPreview={true}
|
|
157
|
+
showCorrectAnswer={true}
|
|
158
|
+
/>
|
|
159
|
+
) : selectedType === "GROUPING" ? (
|
|
160
|
+
<GroupingActivityContent
|
|
161
|
+
answer={answer}
|
|
162
|
+
changeAnswer={() => {}}
|
|
163
|
+
canAnswerQuestion={() => {
|
|
164
|
+
return true;
|
|
165
|
+
}}
|
|
166
|
+
data={data}
|
|
167
|
+
isPreview={true}
|
|
168
|
+
showCorrectAnswer={true}
|
|
169
|
+
/>
|
|
170
|
+
) : selectedType === "FILL_IN_THE_BLANKS" ? (
|
|
171
|
+
<FillInTheBlanksActivityContent
|
|
172
|
+
answer={answer}
|
|
173
|
+
changeAnswer={() => {}}
|
|
174
|
+
canAnswerQuestion={() => {
|
|
175
|
+
return true;
|
|
176
|
+
}}
|
|
177
|
+
data={data}
|
|
178
|
+
isPreview={true}
|
|
179
|
+
showCorrectAnswer={true}
|
|
180
|
+
/>
|
|
181
|
+
) : selectedType === "OPEN_ENDED" ? (
|
|
182
|
+
<OpenEndedActivityContent
|
|
183
|
+
answer={answer}
|
|
184
|
+
changeAnswer={() => {}}
|
|
185
|
+
showMaterialContent={false}
|
|
186
|
+
data={data}
|
|
187
|
+
/>
|
|
188
|
+
) : selectedType === "TRUE_FALSE" ? (
|
|
189
|
+
<TrueFalseActivityContent
|
|
190
|
+
answer={answer}
|
|
191
|
+
changeAnswer={() => {}}
|
|
192
|
+
canAnswerQuestion={() => {
|
|
193
|
+
return true;
|
|
194
|
+
}}
|
|
195
|
+
data={data}
|
|
196
|
+
isPreview={true}
|
|
197
|
+
showCorrectAnswer={true}
|
|
198
|
+
/>
|
|
199
|
+
) : null}
|
|
200
|
+
</div>
|
|
204
201
|
) : null}
|
|
205
202
|
{selectedType && showSolution ? (
|
|
206
203
|
<div className="my-4">
|