catchup-library-web 2.2.7 → 2.2.9

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
@@ -4188,7 +4188,9 @@ var InputGroup = ({
4188
4188
  value,
4189
4189
  onChange: handleTextOnChange,
4190
4190
  onFocus,
4191
- onKeyDown
4191
+ onKeyDown,
4192
+ min: minValue,
4193
+ max: maxValue
4192
4194
  }
4193
4195
  )
4194
4196
  }
@@ -7199,23 +7201,30 @@ var ActivityEvaluationRubricContent = ({
7199
7201
  Object.keys(evaluationRubricMap).map((key, index) => {
7200
7202
  const currentItem = JSON.parse(evaluationRubricMap[key]);
7201
7203
  const { value } = currentItem;
7202
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
7203
- "p",
7204
- {
7205
- className: "my-1 text-xl whitespace-pre-wrap",
7206
- children: constructInputWithSpecialExpressionList(value).map(
7207
- (inputPart, index2) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
7208
- "span",
7209
- {
7210
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
7211
- 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
7212
- },
7213
- index2
7214
- )
7204
+ const matchedRegex = value.match(/\[(\d+)\]\s*(.*)/);
7205
+ let score = 0;
7206
+ let evaluationRubric = value;
7207
+ if (matchedRegex) {
7208
+ score = 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
+ score,
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
7215
7225
  )
7216
- },
7217
- `${key}_${index}`
7218
- );
7226
+ ) })
7227
+ ] }, `${key}_${index}`);
7219
7228
  })
7220
7229
  ] }) });
7221
7230
  };
package/dist/index.mjs CHANGED
@@ -3965,7 +3965,9 @@ var InputGroup = ({
3965
3965
  value,
3966
3966
  onChange: handleTextOnChange,
3967
3967
  onFocus,
3968
- onKeyDown
3968
+ onKeyDown,
3969
+ min: minValue,
3970
+ max: maxValue
3969
3971
  }
3970
3972
  )
3971
3973
  }
@@ -6976,23 +6978,30 @@ var ActivityEvaluationRubricContent = ({
6976
6978
  Object.keys(evaluationRubricMap).map((key, index) => {
6977
6979
  const currentItem = JSON.parse(evaluationRubricMap[key]);
6978
6980
  const { value } = currentItem;
6979
- return /* @__PURE__ */ jsx45(
6980
- "p",
6981
- {
6982
- className: "my-1 text-xl whitespace-pre-wrap",
6983
- children: constructInputWithSpecialExpressionList(value).map(
6984
- (inputPart, index2) => /* @__PURE__ */ jsx45(
6985
- "span",
6986
- {
6987
- className: `${inputPart.isBold ? "font-bold" : ""} ${inputPart.isUnderline ? "underline" : ""}`,
6988
- children: inputPart.isEquation ? /* @__PURE__ */ jsx45("span", { className: "text-xl", children: /* @__PURE__ */ jsx45(InlineMath12, { math: inputPart.value }) }) : inputPart.value
6989
- },
6990
- index2
6991
- )
6981
+ const matchedRegex = value.match(/\[(\d+)\]\s*(.*)/);
6982
+ let score = 0;
6983
+ let evaluationRubric = value;
6984
+ if (matchedRegex) {
6985
+ score = 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
+ score,
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
6992
7002
  )
6993
- },
6994
- `${key}_${index}`
6995
- );
7003
+ ) })
7004
+ ] }, `${key}_${index}`);
6996
7005
  })
6997
7006
  ] }) });
6998
7007
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.2.7",
3
+ "version": "2.2.9",
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*(.*)/);
48
+ let score = 0;
49
+ let evaluationRubric = value;
50
+
51
+ if (matchedRegex) {
52
+ score = 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
+ {score} {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>
@@ -505,6 +505,8 @@ const InputGroup = ({
505
505
  onChange={handleTextOnChange}
506
506
  onFocus={onFocus}
507
507
  onKeyDown={onKeyDown}
508
+ min={minValue}
509
+ max={maxValue}
508
510
  />
509
511
  </div>
510
512