catchup-library-web 2.2.9 → 2.2.11

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
@@ -6236,11 +6236,8 @@ var MCSAActivityMaterialContent = ({
6236
6236
  const [displayAnswerMap, setDisplayAnswerMap] = (0, import_react23.useState)(answerMap);
6237
6237
  (0, import_react23.useEffect)(() => {
6238
6238
  if (showCorrectAnswer) {
6239
- const correctAnswerMap = {};
6240
- Object.keys(materialMap).forEach((materialKey) => {
6241
- correctAnswerMap[materialKey] = materialMap[materialKey][0];
6242
- });
6243
- setDisplayAnswerMap(correctAnswerMap);
6239
+ const correctAnswer2 = retrieveCorrectAnswer();
6240
+ setDisplayAnswerMap({ correctAnswer: correctAnswer2 });
6244
6241
  } else {
6245
6242
  setDisplayAnswerMap(answerMap);
6246
6243
  }
@@ -7201,16 +7198,16 @@ var ActivityEvaluationRubricContent = ({
7201
7198
  Object.keys(evaluationRubricMap).map((key, index) => {
7202
7199
  const currentItem = JSON.parse(evaluationRubricMap[key]);
7203
7200
  const { value } = currentItem;
7204
- const matchedRegex = value.match(/\[(\d+)\]\s*(.*)/);
7205
- let score = 0;
7201
+ const matchedRegex = value.match(/\[(\d+)\]\s*([\s\S]*)/);
7202
+ let points = 0;
7206
7203
  let evaluationRubric = value;
7207
7204
  if (matchedRegex) {
7208
- score = parseFloat(matchedRegex[1]);
7205
+ points = parseFloat(matchedRegex[1]);
7209
7206
  evaluationRubric = matchedRegex[2];
7210
7207
  }
7211
7208
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "my-2 flex flex-row gap-x-3", children: [
7212
7209
  /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "font-bold text-xl whitespace-nowrap", children: [
7213
- score,
7210
+ points,
7214
7211
  " ",
7215
7212
  i18n_default.t("points")
7216
7213
  ] }),
package/dist/index.mjs CHANGED
@@ -6013,11 +6013,8 @@ var MCSAActivityMaterialContent = ({
6013
6013
  const [displayAnswerMap, setDisplayAnswerMap] = useState22(answerMap);
6014
6014
  useEffect13(() => {
6015
6015
  if (showCorrectAnswer) {
6016
- const correctAnswerMap = {};
6017
- Object.keys(materialMap).forEach((materialKey) => {
6018
- correctAnswerMap[materialKey] = materialMap[materialKey][0];
6019
- });
6020
- setDisplayAnswerMap(correctAnswerMap);
6016
+ const correctAnswer2 = retrieveCorrectAnswer();
6017
+ setDisplayAnswerMap({ correctAnswer: correctAnswer2 });
6021
6018
  } else {
6022
6019
  setDisplayAnswerMap(answerMap);
6023
6020
  }
@@ -6978,16 +6975,16 @@ var ActivityEvaluationRubricContent = ({
6978
6975
  Object.keys(evaluationRubricMap).map((key, index) => {
6979
6976
  const currentItem = JSON.parse(evaluationRubricMap[key]);
6980
6977
  const { value } = currentItem;
6981
- const matchedRegex = value.match(/\[(\d+)\]\s*(.*)/);
6982
- let score = 0;
6978
+ const matchedRegex = value.match(/\[(\d+)\]\s*([\s\S]*)/);
6979
+ let points = 0;
6983
6980
  let evaluationRubric = value;
6984
6981
  if (matchedRegex) {
6985
- score = parseFloat(matchedRegex[1]);
6982
+ points = parseFloat(matchedRegex[1]);
6986
6983
  evaluationRubric = matchedRegex[2];
6987
6984
  }
6988
6985
  return /* @__PURE__ */ jsxs34("div", { className: "my-2 flex flex-row gap-x-3", children: [
6989
6986
  /* @__PURE__ */ jsxs34("div", { className: "font-bold text-xl whitespace-nowrap", children: [
6990
- score,
6987
+ points,
6991
6988
  " ",
6992
6989
  i18n_default.t("points")
6993
6990
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.2.9",
3
+ "version": "2.2.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -44,19 +44,19 @@ const ActivityEvaluationRubricContent = ({
44
44
  {Object.keys(evaluationRubricMap).map((key, index) => {
45
45
  const currentItem = JSON.parse(evaluationRubricMap[key]);
46
46
  const { value } = currentItem;
47
- const matchedRegex = value.match(/\[(\d+)\]\s*(.*)/);
48
- let score = 0;
47
+ const matchedRegex = value.match(/\[(\d+)\]\s*([\s\S]*)/);
48
+ let points = 0;
49
49
  let evaluationRubric = value;
50
50
 
51
51
  if (matchedRegex) {
52
- score = parseFloat(matchedRegex[1]);
52
+ points = parseFloat(matchedRegex[1]);
53
53
  evaluationRubric = matchedRegex[2];
54
54
  }
55
55
 
56
56
  return (
57
57
  <div key={`${key}_${index}`} className="my-2 flex flex-row gap-x-3">
58
58
  <div className="font-bold text-xl whitespace-nowrap">
59
- {score} {i18n.t("points")}
59
+ {points} {i18n.t("points")}
60
60
  </div>
61
61
  <p className="flex-1 text-xl whitespace-pre-wrap">
62
62
  {constructInputWithSpecialExpressionList(evaluationRubric).map(
@@ -21,12 +21,8 @@ const MCSAActivityMaterialContent = ({
21
21
 
22
22
  useEffect(() => {
23
23
  if (showCorrectAnswer) {
24
- // Create correct answer map where each key maps to the first item (correct answer)
25
- const correctAnswerMap: any = {};
26
- Object.keys(materialMap).forEach((materialKey) => {
27
- correctAnswerMap[materialKey] = materialMap[materialKey][0];
28
- });
29
- setDisplayAnswerMap(correctAnswerMap);
24
+ const correctAnswer = retrieveCorrectAnswer();
25
+ setDisplayAnswerMap({ correctAnswer });
30
26
  } else {
31
27
  setDisplayAnswerMap(answerMap);
32
28
  }