catchup-library-web 2.7.10 → 2.7.12

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
@@ -4891,7 +4891,8 @@ var DropdownActivityMaterialContent = ({
4891
4891
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(displayAnswerMap).map(
4892
4892
  (materialKey, index) => {
4893
4893
  const answerKey = Object.keys(materialMap[materialKey])[0];
4894
- const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(answerKey, displayAnswerMap[materialKey]);
4894
+ const currentAnswer = displayAnswerMap[materialKey];
4895
+ const learnerAnswerState = !isPreview ? null : !currentAnswer || currentAnswer === "DEFAULT_OPTION" ? null : checkAnswerState(answerKey, currentAnswer);
4895
4896
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
4896
4897
  /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "my-auto", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("p", { className: "text-xl", children: [
4897
4898
  parseFloat(materialKey) + 1,
@@ -5305,9 +5306,10 @@ var FillInTheBlanksActivityMaterialContent = ({
5305
5306
  )
5306
5307
  ) }),
5307
5308
  /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(displayAnswerMap).map((materialKey, index) => {
5308
- const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(
5309
+ const currentAnswer = displayAnswerMap[materialKey];
5310
+ const learnerAnswerState = !isPreview ? null : !currentAnswer || currentAnswer === "" || currentAnswer === "DEFAULT_OPTION" ? null : checkAnswerState(
5309
5311
  JSON.parse(materialMap[materialKey]),
5310
- displayAnswerMap[materialKey]
5312
+ currentAnswer
5311
5313
  );
5312
5314
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
5313
5315
  "div",
@@ -7101,7 +7103,7 @@ var OrderingActivityMaterialContent = ({
7101
7103
  }
7102
7104
  ),
7103
7105
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex-1 min-h-0 overflow-y-auto", children: Object.keys(displayAnswerMap).map((materialKey, index) => {
7104
- const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(displayAnswerMap[materialKey] + "", index + "");
7106
+ const learnerAnswerState = !isPreview ? null : checkAnswerState(displayAnswerMap[materialKey] + "", index + "");
7105
7107
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
7106
7108
  "div",
7107
7109
  {
@@ -7277,7 +7279,8 @@ var TrueFalseActivityMaterialContent = ({
7277
7279
  const learnerAnswer = displayAnswerMap.trueList.find(
7278
7280
  (trueItem) => trueItem === shuffleOption
7279
7281
  ) !== void 0 ? "TRUE" : "FALSE";
7280
- const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(correctAnswer, learnerAnswer);
7282
+ const hasAnswered = displayAnswerMap.trueList.includes(shuffleOption) || displayAnswerMap.falseList.includes(shuffleOption);
7283
+ const learnerAnswerState = !isPreview ? null : !hasAnswered ? null : checkAnswerState(correctAnswer, learnerAnswer);
7281
7284
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
7282
7285
  "div",
7283
7286
  {
package/dist/index.mjs CHANGED
@@ -4651,7 +4651,8 @@ var DropdownActivityMaterialContent = ({
4651
4651
  /* @__PURE__ */ jsx28("div", { className: "flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsx28("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(displayAnswerMap).map(
4652
4652
  (materialKey, index) => {
4653
4653
  const answerKey = Object.keys(materialMap[materialKey])[0];
4654
- const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(answerKey, displayAnswerMap[materialKey]);
4654
+ const currentAnswer = displayAnswerMap[materialKey];
4655
+ const learnerAnswerState = !isPreview ? null : !currentAnswer || currentAnswer === "DEFAULT_OPTION" ? null : checkAnswerState(answerKey, currentAnswer);
4655
4656
  return /* @__PURE__ */ jsx28("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ jsx28("div", { className: "mx-2", children: /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-row my-2 gap-x-2", children: [
4656
4657
  /* @__PURE__ */ jsx28("div", { className: "my-auto", children: /* @__PURE__ */ jsxs18("p", { className: "text-xl", children: [
4657
4658
  parseFloat(materialKey) + 1,
@@ -5065,9 +5066,10 @@ var FillInTheBlanksActivityMaterialContent = ({
5065
5066
  )
5066
5067
  ) }),
5067
5068
  /* @__PURE__ */ jsx30("div", { className: "w-full flex flex-row flex-wrap", children: Object.keys(displayAnswerMap).map((materialKey, index) => {
5068
- const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(
5069
+ const currentAnswer = displayAnswerMap[materialKey];
5070
+ const learnerAnswerState = !isPreview ? null : !currentAnswer || currentAnswer === "" || currentAnswer === "DEFAULT_OPTION" ? null : checkAnswerState(
5069
5071
  JSON.parse(materialMap[materialKey]),
5070
- displayAnswerMap[materialKey]
5072
+ currentAnswer
5071
5073
  );
5072
5074
  return /* @__PURE__ */ jsx30("div", { className: "w-full md:w-1/2", children: /* @__PURE__ */ jsx30("div", { className: "mx-2", children: /* @__PURE__ */ jsx30(
5073
5075
  "div",
@@ -6861,7 +6863,7 @@ var OrderingActivityMaterialContent = ({
6861
6863
  }
6862
6864
  ),
6863
6865
  /* @__PURE__ */ jsx42("div", { className: "flex-1 min-h-0 overflow-y-auto", children: Object.keys(displayAnswerMap).map((materialKey, index) => {
6864
- const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(displayAnswerMap[materialKey] + "", index + "");
6866
+ const learnerAnswerState = !isPreview ? null : checkAnswerState(displayAnswerMap[materialKey] + "", index + "");
6865
6867
  return /* @__PURE__ */ jsx42("div", { className: "w-full", children: /* @__PURE__ */ jsxs32(
6866
6868
  "div",
6867
6869
  {
@@ -7037,7 +7039,8 @@ var TrueFalseActivityMaterialContent = ({
7037
7039
  const learnerAnswer = displayAnswerMap.trueList.find(
7038
7040
  (trueItem) => trueItem === shuffleOption
7039
7041
  ) !== void 0 ? "TRUE" : "FALSE";
7040
- const learnerAnswerState = !isPreview ? null : !showCorrectAnswer ? null : checkAnswerState(correctAnswer, learnerAnswer);
7042
+ const hasAnswered = displayAnswerMap.trueList.includes(shuffleOption) || displayAnswerMap.falseList.includes(shuffleOption);
7043
+ const learnerAnswerState = !isPreview ? null : !hasAnswered ? null : checkAnswerState(correctAnswer, learnerAnswer);
7041
7044
  return /* @__PURE__ */ jsxs34(
7042
7045
  "div",
7043
7046
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.7.10",
3
+ "version": "2.7.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -53,11 +53,12 @@ const DropdownActivityMaterialContent = ({
53
53
  {Object.keys(displayAnswerMap).map(
54
54
  (materialKey: string, index: number) => {
55
55
  const answerKey = Object.keys(materialMap[materialKey])[0];
56
+ const currentAnswer = displayAnswerMap[materialKey];
56
57
  const learnerAnswerState = !isPreview
57
58
  ? null
58
- : !showCorrectAnswer
59
+ : !currentAnswer || currentAnswer === "DEFAULT_OPTION"
59
60
  ? null
60
- : checkAnswerState(answerKey, displayAnswerMap[materialKey]);
61
+ : checkAnswerState(answerKey, currentAnswer);
61
62
  return (
62
63
  <div key={index} className="w-full md:w-1/2">
63
64
  <div className="mx-2">
@@ -309,13 +309,14 @@ const FillInTheBlanksActivityMaterialContent = ({
309
309
  </div>
310
310
  <div className="w-full flex flex-row flex-wrap">
311
311
  {Object.keys(displayAnswerMap).map((materialKey, index) => {
312
+ const currentAnswer = displayAnswerMap[materialKey];
312
313
  const learnerAnswerState = !isPreview
313
314
  ? null
314
- : !showCorrectAnswer
315
+ : !currentAnswer || currentAnswer === "" || currentAnswer === "DEFAULT_OPTION"
315
316
  ? null
316
317
  : checkAnswerState(
317
318
  JSON.parse(materialMap[materialKey]),
318
- displayAnswerMap[materialKey],
319
+ currentAnswer,
319
320
  );
320
321
  return (
321
322
  <div key={index} className="w-full md:w-1/2">
@@ -256,9 +256,7 @@ const OrderingActivityMaterialContent = ({
256
256
  {Object.keys(displayAnswerMap).map((materialKey, index) => {
257
257
  const learnerAnswerState = !isPreview
258
258
  ? null
259
- : !showCorrectAnswer
260
- ? null
261
- : checkAnswerState(displayAnswerMap[materialKey] + "", index + "");
259
+ : checkAnswerState(displayAnswerMap[materialKey] + "", index + "");
262
260
  return (
263
261
  <div className="w-full" key={index}>
264
262
  <div
@@ -81,9 +81,12 @@ const TrueFalseActivityMaterialContent = ({
81
81
  ? "TRUE"
82
82
  : "FALSE";
83
83
 
84
+ const hasAnswered =
85
+ displayAnswerMap.trueList.includes(shuffleOption) ||
86
+ displayAnswerMap.falseList.includes(shuffleOption);
84
87
  const learnerAnswerState = !isPreview
85
88
  ? null
86
- : !showCorrectAnswer
89
+ : !hasAnswered
87
90
  ? null
88
91
  : checkAnswerState(correctAnswer, learnerAnswer);
89
92