catchup-library-web 2.2.8 → 2.2.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
@@ -7201,23 +7201,30 @@ var ActivityEvaluationRubricContent = ({
7201
7201
  Object.keys(evaluationRubricMap).map((key, index) => {
7202
7202
  const currentItem = JSON.parse(evaluationRubricMap[key]);
7203
7203
  const { value } = currentItem;
7204
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
7205
- "p",
7206
- {
7207
- className: "my-1 text-xl whitespace-pre-wrap",
7208
- children: constructInputWithSpecialExpressionList(value).map(
7209
- (inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
7210
- "span",
7211
- {
7212
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
7213
- children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_katex12.InlineMath, { math: inputPart.value }) }) : inputPart.value
7214
- },
7215
- index2
7216
- )
7204
+ const matchedRegex = value.match(/\[(\d+)\]\s*([\s\S]*)/);
7205
+ let points = 0;
7206
+ let evaluationRubric = value;
7207
+ if (matchedRegex) {
7208
+ points = parseFloat(matchedRegex[1]);
7209
+ evaluationRubric = matchedRegex[2];
7210
+ }
7211
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "my-2 flex flex-row gap-x-3", children: [
7212
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "font-bold text-xl whitespace-nowrap", children: [
7213
+ points,
7214
+ " ",
7215
+ i18n_default.t("points")
7216
+ ] }),
7217
+ /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "flex-1 text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(evaluationRubric).map(
7218
+ (inputPart, inputIndex) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
7219
+ "span",
7220
+ {
7221
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
7222
+ children: inputPart.isEquation ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { className: "text-xl", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_react_katex12.InlineMath, { math: inputPart.value }) }) : inputPart.value
7223
+ },
7224
+ inputIndex
7217
7225
  )
7218
- },
7219
- `${key}_${index}`
7220
- );
7226
+ ) })
7227
+ ] }, `${key}_${index}`);
7221
7228
  })
7222
7229
  ] }) });
7223
7230
  };
package/dist/index.mjs CHANGED
@@ -6978,23 +6978,30 @@ var ActivityEvaluationRubricContent = ({
6978
6978
  Object.keys(evaluationRubricMap).map((key, index) => {
6979
6979
  const currentItem = JSON.parse(evaluationRubricMap[key]);
6980
6980
  const { value } = currentItem;
6981
- return /* @__PURE__ */ jsx45(
6982
- "p",
6983
- {
6984
- className: "my-1 text-xl whitespace-pre-wrap",
6985
- children: constructInputWithSpecialExpressionList(value).map(
6986
- (inputPart, index2) => /* @__PURE__ */ jsx45(
6987
- "span",
6988
- {
6989
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6990
- children: inputPart.isEquation ? /* @__PURE__ */ jsx45("span", { className: "text-xl", children: /* @__PURE__ */ jsx45(InlineMath12, { math: inputPart.value }) }) : inputPart.value
6991
- },
6992
- index2
6993
- )
6981
+ const matchedRegex = value.match(/\[(\d+)\]\s*([\s\S]*)/);
6982
+ let points = 0;
6983
+ let evaluationRubric = value;
6984
+ if (matchedRegex) {
6985
+ points = parseFloat(matchedRegex[1]);
6986
+ evaluationRubric = matchedRegex[2];
6987
+ }
6988
+ return /* @__PURE__ */ jsxs34("div", { className: "my-2 flex flex-row gap-x-3", children: [
6989
+ /* @__PURE__ */ jsxs34("div", { className: "font-bold text-xl whitespace-nowrap", children: [
6990
+ points,
6991
+ " ",
6992
+ i18n_default.t("points")
6993
+ ] }),
6994
+ /* @__PURE__ */ jsx45("p", { className: "flex-1 text-xl whitespace-pre-wrap", children: constructInputWithSpecialExpressionList(evaluationRubric).map(
6995
+ (inputPart, inputIndex) => /* @__PURE__ */ jsx45(
6996
+ "span",
6997
+ {
6998
+ className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6999
+ children: inputPart.isEquation ? /* @__PURE__ */ jsx45("span", { className: "text-xl", children: /* @__PURE__ */ jsx45(InlineMath12, { math: inputPart.value }) }) : inputPart.value
7000
+ },
7001
+ inputIndex
6994
7002
  )
6995
- },
6996
- `${key}_${index}`
6997
- );
7003
+ ) })
7004
+ ] }, `${key}_${index}`);
6998
7005
  })
6999
7006
  ] }) });
7000
7007
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.2.8",
3
+ "version": "2.2.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -44,30 +44,41 @@ 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*([\s\S]*)/);
48
+ let points = 0;
49
+ let evaluationRubric = value;
50
+
51
+ if (matchedRegex) {
52
+ points = parseFloat(matchedRegex[1]);
53
+ evaluationRubric = matchedRegex[2];
54
+ }
55
+
47
56
  return (
48
- <p
49
- key={`${key}_${index}`}
50
- className="my-1 text-xl whitespace-pre-wrap"
51
- >
52
- {constructInputWithSpecialExpressionList(value).map(
53
- (inputPart, index) => (
54
- <span
55
- key={index}
56
- className={`${inputPart.isBold ? "font-bold" : ""} ${
57
- inputPart.isUnderline ? "underline" : ""
58
- }`}
59
- >
60
- {inputPart.isEquation ? (
61
- <span className="text-xl">
62
- <InlineMath math={inputPart.value} />
63
- </span>
64
- ) : (
65
- inputPart.value
66
- )}
67
- </span>
68
- )
69
- )}
70
- </p>
57
+ <div key={`${key}_${index}`} className="my-2 flex flex-row gap-x-3">
58
+ <div className="font-bold text-xl whitespace-nowrap">
59
+ {points} {i18n.t("points")}
60
+ </div>
61
+ <p className="flex-1 text-xl whitespace-pre-wrap">
62
+ {constructInputWithSpecialExpressionList(evaluationRubric).map(
63
+ (inputPart, inputIndex) => (
64
+ <span
65
+ key={inputIndex}
66
+ className={`${inputPart.isBold ? "font-bold" : ""} ${
67
+ inputPart.isUnderline ? "underline" : ""
68
+ }`}
69
+ >
70
+ {inputPart.isEquation ? (
71
+ <span className="text-xl">
72
+ <InlineMath math={inputPart.value} />
73
+ </span>
74
+ ) : (
75
+ inputPart.value
76
+ )}
77
+ </span>
78
+ )
79
+ )}
80
+ </p>
81
+ </div>
71
82
  );
72
83
  })}
73
84
  </div>