catchup-library-web 2.7.9 → 2.7.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.js CHANGED
@@ -5027,7 +5027,13 @@ var DropdownActivityContent = ({
5027
5027
  ActivityBodyContent_default,
5028
5028
  {
5029
5029
  bodyMap: dropdownBodyMap,
5030
- answerMap: currentAnswerMap,
5030
+ answerMap: showCorrectAnswer ? Object.keys(dropdownMaterialMap).reduce(
5031
+ (acc, key) => {
5032
+ acc[key] = Object.keys(dropdownMaterialMap[key])[0];
5033
+ return acc;
5034
+ },
5035
+ {}
5036
+ ) : currentAnswerMap,
5031
5037
  contentMap,
5032
5038
  templateType: "DROPDOWN"
5033
5039
  }
@@ -5299,7 +5305,7 @@ var FillInTheBlanksActivityMaterialContent = ({
5299
5305
  )
5300
5306
  ) }),
5301
5307
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(displayAnswerMap).map((materialKey, index) => {
5302
- const learnerAnswerState = !isPreview ? null : checkAnswerState(
5308
+ const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(
5303
5309
  JSON.parse(materialMap[materialKey]),
5304
5310
  displayAnswerMap[materialKey]
5305
5311
  );
@@ -5451,7 +5457,14 @@ var FillInTheBlanksActivityContent = ({
5451
5457
  ActivityBodyContent_default,
5452
5458
  {
5453
5459
  bodyMap: fillInTheBlanksBodyMap,
5454
- answerMap: currentAnswerMap,
5460
+ answerMap: showCorrectAnswer ? Object.keys(fillInTheBlanksMaterialMap).reduce(
5461
+ (acc, key) => {
5462
+ const parsed = JSON.parse(fillInTheBlanksMaterialMap[key]);
5463
+ acc[key] = parsed[0];
5464
+ return acc;
5465
+ },
5466
+ {}
5467
+ ) : currentAnswerMap,
5455
5468
  contentMap,
5456
5469
  templateType: "FILL_IN_THE_BLANKS"
5457
5470
  }
@@ -7264,7 +7277,7 @@ var TrueFalseActivityMaterialContent = ({
7264
7277
  const learnerAnswer = displayAnswerMap.trueList.find(
7265
7278
  (trueItem) => trueItem === shuffleOption
7266
7279
  ) !== void 0 ? "TRUE" : "FALSE";
7267
- const learnerAnswerState = !isPreview ? null : checkAnswerState(correctAnswer, learnerAnswer);
7280
+ const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(correctAnswer, learnerAnswer);
7268
7281
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7269
7282
  "div",
7270
7283
  {
package/dist/index.mjs CHANGED
@@ -4787,7 +4787,13 @@ var DropdownActivityContent = ({
4787
4787
  ActivityBodyContent_default,
4788
4788
  {
4789
4789
  bodyMap: dropdownBodyMap,
4790
- answerMap: currentAnswerMap,
4790
+ answerMap: showCorrectAnswer ? Object.keys(dropdownMaterialMap).reduce(
4791
+ (acc, key) => {
4792
+ acc[key] = Object.keys(dropdownMaterialMap[key])[0];
4793
+ return acc;
4794
+ },
4795
+ {}
4796
+ ) : currentAnswerMap,
4791
4797
  contentMap,
4792
4798
  templateType: "DROPDOWN"
4793
4799
  }
@@ -5059,7 +5065,7 @@ var FillInTheBlanksActivityMaterialContent = ({
5059
5065
  )
5060
5066
  ) }),
5061
5067
  /* @__PURE__ */ jsx30("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(displayAnswerMap).map((materialKey, index) => {
5062
- const learnerAnswerState = !isPreview ? null : checkAnswerState(
5068
+ const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(
5063
5069
  JSON.parse(materialMap[materialKey]),
5064
5070
  displayAnswerMap[materialKey]
5065
5071
  );
@@ -5211,7 +5217,14 @@ var FillInTheBlanksActivityContent = ({
5211
5217
  ActivityBodyContent_default,
5212
5218
  {
5213
5219
  bodyMap: fillInTheBlanksBodyMap,
5214
- answerMap: currentAnswerMap,
5220
+ answerMap: showCorrectAnswer ? Object.keys(fillInTheBlanksMaterialMap).reduce(
5221
+ (acc, key) => {
5222
+ const parsed = JSON.parse(fillInTheBlanksMaterialMap[key]);
5223
+ acc[key] = parsed[0];
5224
+ return acc;
5225
+ },
5226
+ {}
5227
+ ) : currentAnswerMap,
5215
5228
  contentMap,
5216
5229
  templateType: "FILL_IN_THE_BLANKS"
5217
5230
  }
@@ -7024,7 +7037,7 @@ var TrueFalseActivityMaterialContent = ({
7024
7037
  const learnerAnswer = displayAnswerMap.trueList.find(
7025
7038
  (trueItem) => trueItem === shuffleOption
7026
7039
  ) !== void 0 ? "TRUE" : "FALSE";
7027
- const learnerAnswerState = !isPreview ? null : checkAnswerState(correctAnswer, learnerAnswer);
7040
+ const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(correctAnswer, learnerAnswer);
7028
7041
  return /* @__PURE__ */ jsxs34(
7029
7042
  "div",
7030
7043
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.7.9",
3
+ "version": "2.7.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -44,7 +44,17 @@ const DropdownActivityContent = ({
44
44
  <div className={`${isFullScreen ? "w-full" : "w-full md:w-[60%] md:overflow-y-auto"}`}>
45
45
  <ActivityBodyContent
46
46
  bodyMap={dropdownBodyMap}
47
- answerMap={currentAnswerMap} // Use local state instead of function call
47
+ answerMap={
48
+ showCorrectAnswer
49
+ ? Object.keys(dropdownMaterialMap).reduce(
50
+ (acc: any, key: string) => {
51
+ acc[key] = Object.keys(dropdownMaterialMap[key])[0];
52
+ return acc;
53
+ },
54
+ {},
55
+ )
56
+ : currentAnswerMap
57
+ }
48
58
  contentMap={contentMap}
49
59
  templateType={"DROPDOWN"}
50
60
  />
@@ -73,7 +73,18 @@ const FillInTheBlanksActivityContent = ({
73
73
  <div className={`${isFullScreen ? "w-full" : "w-full md:w-[60%] md:overflow-y-auto"}`}>
74
74
  <ActivityBodyContent
75
75
  bodyMap={fillInTheBlanksBodyMap}
76
- answerMap={currentAnswerMap}
76
+ answerMap={
77
+ showCorrectAnswer
78
+ ? Object.keys(fillInTheBlanksMaterialMap).reduce(
79
+ (acc: any, key: string) => {
80
+ const parsed = JSON.parse(fillInTheBlanksMaterialMap[key]);
81
+ acc[key] = parsed[0];
82
+ return acc;
83
+ },
84
+ {},
85
+ )
86
+ : currentAnswerMap
87
+ }
77
88
  contentMap={contentMap}
78
89
  templateType={"FILL_IN_THE_BLANKS"}
79
90
  />
@@ -311,10 +311,12 @@ const FillInTheBlanksActivityMaterialContent = ({
311
311
  {Object.keys(displayAnswerMap).map((materialKey, index) => {
312
312
  const learnerAnswerState = !isPreview
313
313
  ? null
314
- : checkAnswerState(
315
- JSON.parse(materialMap[materialKey]),
316
- displayAnswerMap[materialKey],
317
- );
314
+ : !showCorrectAnswer
315
+ ? null
316
+ : checkAnswerState(
317
+ JSON.parse(materialMap[materialKey]),
318
+ displayAnswerMap[materialKey],
319
+ );
318
320
  return (
319
321
  <div key={index} className="w-full md:w-1/2">
320
322
  <div className="mx-2">
@@ -83,7 +83,9 @@ const TrueFalseActivityMaterialContent = ({
83
83
 
84
84
  const learnerAnswerState = !isPreview
85
85
  ? null
86
- : checkAnswerState(correctAnswer, learnerAnswer);
86
+ : !showCorrectAnswer
87
+ ? null
88
+ : checkAnswerState(correctAnswer, learnerAnswer);
87
89
 
88
90
  return (
89
91
  <div