catchup-library-web 2.2.13 → 2.2.15

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.d.mts CHANGED
@@ -225,6 +225,7 @@ interface IActivityPreviewByDataProps {
225
225
  showDifficulty?: boolean;
226
226
  isFullScreen?: boolean;
227
227
  showCorrectAnswer?: boolean;
228
+ showMaterialContent?: boolean;
228
229
  }
229
230
 
230
231
  declare const ActivityBodyContent: ({ templateType, bodyMap, contentMap, answerMap, }: IActivityBodyContentProps) => react_jsx_runtime.JSX.Element | null;
@@ -251,7 +252,7 @@ declare const ActivitySolutionContent: ({ activityTemplateType, data, }: IActivi
251
252
 
252
253
  declare const ActivityEvaluationRubricContent: ({ activityTemplateType, data, }: IActivityEvaluationRubricProps) => react_jsx_runtime.JSX.Element | null | undefined;
253
254
 
254
- declare const ActivityPreviewByData: ({ data, answerType, showType, showDescription, typeList, showSolution, showEvaluationRubric, showDifficulty, isFullScreen, showCorrectAnswer, }: IActivityPreviewByDataProps) => react_jsx_runtime.JSX.Element | null;
255
+ declare const ActivityPreviewByData: ({ data, answerType, showType, showDescription, typeList, showSolution, showEvaluationRubric, showDifficulty, isFullScreen, showCorrectAnswer, showMaterialContent, }: IActivityPreviewByDataProps) => react_jsx_runtime.JSX.Element | null;
255
256
 
256
257
  interface IStatusErrorProperties {
257
258
  statusCode?: string;
package/dist/index.d.ts CHANGED
@@ -225,6 +225,7 @@ interface IActivityPreviewByDataProps {
225
225
  showDifficulty?: boolean;
226
226
  isFullScreen?: boolean;
227
227
  showCorrectAnswer?: boolean;
228
+ showMaterialContent?: boolean;
228
229
  }
229
230
 
230
231
  declare const ActivityBodyContent: ({ templateType, bodyMap, contentMap, answerMap, }: IActivityBodyContentProps) => react_jsx_runtime.JSX.Element | null;
@@ -251,7 +252,7 @@ declare const ActivitySolutionContent: ({ activityTemplateType, data, }: IActivi
251
252
 
252
253
  declare const ActivityEvaluationRubricContent: ({ activityTemplateType, data, }: IActivityEvaluationRubricProps) => react_jsx_runtime.JSX.Element | null | undefined;
253
254
 
254
- declare const ActivityPreviewByData: ({ data, answerType, showType, showDescription, typeList, showSolution, showEvaluationRubric, showDifficulty, isFullScreen, showCorrectAnswer, }: IActivityPreviewByDataProps) => react_jsx_runtime.JSX.Element | null;
255
+ declare const ActivityPreviewByData: ({ data, answerType, showType, showDescription, typeList, showSolution, showEvaluationRubric, showDifficulty, isFullScreen, showCorrectAnswer, showMaterialContent, }: IActivityPreviewByDataProps) => react_jsx_runtime.JSX.Element | null;
255
256
 
256
257
  interface IStatusErrorProperties {
257
258
  statusCode?: string;
package/dist/index.js CHANGED
@@ -7193,7 +7193,7 @@ var ActivityEvaluationRubricContent = ({
7193
7193
  }
7194
7194
  if (!evaluationRubricMap || Object.keys(evaluationRubricMap).length === 0)
7195
7195
  return null;
7196
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "mx-2", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "p-4 border-catchup-gray-400 border-2 rounded-catchup-xlarge", children: [
7196
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "p-4 border-catchup-gray-400 border-2 rounded-catchup-xlarge", children: [
7197
7197
  /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "text-xl font-bold text-center mb-3", children: i18n_default.t("evaluation_rubric") }),
7198
7198
  Object.keys(evaluationRubricMap).map((key, index) => {
7199
7199
  const currentItem = JSON.parse(evaluationRubricMap[key]);
@@ -7223,7 +7223,7 @@ var ActivityEvaluationRubricContent = ({
7223
7223
  ) })
7224
7224
  ] }, `${key}_${index}`);
7225
7225
  })
7226
- ] }) });
7226
+ ] });
7227
7227
  };
7228
7228
  var ActivityEvaluationRubricContent_default = ActivityEvaluationRubricContent;
7229
7229
 
@@ -7293,7 +7293,8 @@ var ActivityPreviewByData = ({
7293
7293
  showEvaluationRubric = false,
7294
7294
  showDifficulty = true,
7295
7295
  isFullScreen = false,
7296
- showCorrectAnswer = false
7296
+ showCorrectAnswer = false,
7297
+ showMaterialContent = true
7297
7298
  }) => {
7298
7299
  const [selectedType, setSelectedType] = (0, import_react27.useState)(null);
7299
7300
  const [optionList, setOptionList] = (0, import_react27.useState)([]);
@@ -7411,7 +7412,7 @@ var ActivityPreviewByData = ({
7411
7412
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
7412
7413
  OpenEndedActivityContent_default,
7413
7414
  __spreadProps(__spreadValues({}, commonProps), {
7414
- showMaterialContent: true
7415
+ showMaterialContent
7415
7416
  })
7416
7417
  )
7417
7418
  ] }) : null;
package/dist/index.mjs CHANGED
@@ -6970,7 +6970,7 @@ var ActivityEvaluationRubricContent = ({
6970
6970
  }
6971
6971
  if (!evaluationRubricMap || Object.keys(evaluationRubricMap).length === 0)
6972
6972
  return null;
6973
- return /* @__PURE__ */ jsx45("div", { className: "mx-2", children: /* @__PURE__ */ jsxs34("div", { className: "p-4 border-catchup-gray-400 border-2 rounded-catchup-xlarge", children: [
6973
+ return /* @__PURE__ */ jsxs34("div", { className: "p-4 border-catchup-gray-400 border-2 rounded-catchup-xlarge", children: [
6974
6974
  /* @__PURE__ */ jsx45("p", { className: "text-xl font-bold text-center mb-3", children: i18n_default.t("evaluation_rubric") }),
6975
6975
  Object.keys(evaluationRubricMap).map((key, index) => {
6976
6976
  const currentItem = JSON.parse(evaluationRubricMap[key]);
@@ -7000,7 +7000,7 @@ var ActivityEvaluationRubricContent = ({
7000
7000
  ) })
7001
7001
  ] }, `${key}_${index}`);
7002
7002
  })
7003
- ] }) });
7003
+ ] });
7004
7004
  };
7005
7005
  var ActivityEvaluationRubricContent_default = ActivityEvaluationRubricContent;
7006
7006
 
@@ -7070,7 +7070,8 @@ var ActivityPreviewByData = ({
7070
7070
  showEvaluationRubric = false,
7071
7071
  showDifficulty = true,
7072
7072
  isFullScreen = false,
7073
- showCorrectAnswer = false
7073
+ showCorrectAnswer = false,
7074
+ showMaterialContent = true
7074
7075
  }) => {
7075
7076
  const [selectedType, setSelectedType] = useState26(null);
7076
7077
  const [optionList, setOptionList] = useState26([]);
@@ -7188,7 +7189,7 @@ var ActivityPreviewByData = ({
7188
7189
  /* @__PURE__ */ jsx47(
7189
7190
  OpenEndedActivityContent_default,
7190
7191
  __spreadProps(__spreadValues({}, commonProps), {
7191
- showMaterialContent: true
7192
+ showMaterialContent
7192
7193
  })
7193
7194
  )
7194
7195
  ] }) : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "catchup-library-web",
3
- "version": "2.2.13",
3
+ "version": "2.2.15",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -46,6 +46,7 @@ const ActivityPreviewByData = ({
46
46
  showDifficulty = true,
47
47
  isFullScreen = false,
48
48
  showCorrectAnswer = false,
49
+ showMaterialContent = true,
49
50
  }: IActivityPreviewByDataProps) => {
50
51
  const [selectedType, setSelectedType] = useState<string | null>(null);
51
52
  const [optionList, setOptionList] = useState<any[]>([]);
@@ -195,7 +196,7 @@ const ActivityPreviewByData = ({
195
196
  {isEmpty && <ActivityEmptyContent />}
196
197
  <OpenEndedActivityContent
197
198
  {...commonProps}
198
- showMaterialContent={true}
199
+ showMaterialContent={showMaterialContent}
199
200
  />
200
201
  </>
201
202
  ) : null;
@@ -36,52 +36,50 @@ const ActivityEvaluationRubricContent = ({
36
36
  return null;
37
37
 
38
38
  return (
39
- <div className="mx-2">
40
- <div className="p-4 border-catchup-gray-400 border-2 rounded-catchup-xlarge">
41
- <p className="text-xl font-bold text-center mb-3">
42
- {i18n.t("evaluation_rubric")}
43
- </p>
44
- {Object.keys(evaluationRubricMap).map((key, index) => {
45
- const currentItem = JSON.parse(evaluationRubricMap[key]);
46
- const { value } = currentItem;
47
- const matchedRegex = value.match(/\[(\d+)\]\s*([\s\S]*)/);
48
- let points = 0;
49
- let evaluationRubric = value;
39
+ <div className="p-4 border-catchup-gray-400 border-2 rounded-catchup-xlarge">
40
+ <p className="text-xl font-bold text-center mb-3">
41
+ {i18n.t("evaluation_rubric")}
42
+ </p>
43
+ {Object.keys(evaluationRubricMap).map((key, index) => {
44
+ const currentItem = JSON.parse(evaluationRubricMap[key]);
45
+ const { value } = currentItem;
46
+ const matchedRegex = value.match(/\[(\d+)\]\s*([\s\S]*)/);
47
+ let points = 0;
48
+ let evaluationRubric = value;
50
49
 
51
- if (matchedRegex) {
52
- points = parseFloat(matchedRegex[1]);
53
- evaluationRubric = matchedRegex[2];
54
- }
50
+ if (matchedRegex) {
51
+ points = parseFloat(matchedRegex[1]);
52
+ evaluationRubric = matchedRegex[2];
53
+ }
55
54
 
56
- return (
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>
55
+ return (
56
+ <div key={`${key}_${index}`} className="my-2 flex flex-row gap-x-3">
57
+ <div className="font-bold text-xl whitespace-nowrap">
58
+ {points} {i18n.t("points")}
81
59
  </div>
82
- );
83
- })}
84
- </div>
60
+ <p className="flex-1 text-xl whitespace-pre-wrap">
61
+ {constructInputWithSpecialExpressionList(evaluationRubric).map(
62
+ (inputPart, inputIndex) => (
63
+ <span
64
+ key={inputIndex}
65
+ className={`${inputPart.isBold ? "font-bold" : ""} ${
66
+ inputPart.isUnderline ? "underline" : ""
67
+ }`}
68
+ >
69
+ {inputPart.isEquation ? (
70
+ <span className="text-xl">
71
+ <InlineMath math={inputPart.value} />
72
+ </span>
73
+ ) : (
74
+ inputPart.value
75
+ )}
76
+ </span>
77
+ )
78
+ )}
79
+ </p>
80
+ </div>
81
+ );
82
+ })}
85
83
  </div>
86
84
  );
87
85
  };
@@ -230,4 +230,5 @@ export interface IActivityPreviewByDataProps {
230
230
  showDifficulty?: boolean;
231
231
  isFullScreen?: boolean;
232
232
  showCorrectAnswer?: boolean;
233
+ showMaterialContent?: boolean;
233
234
  }