touchstudy-core 0.1.121 → 0.1.122

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.
Files changed (44) hide show
  1. package/README.md +46 -46
  2. package/dist/components/List/List.d.ts +7 -0
  3. package/dist/containers/ExamResult/components/Dialog/CreateNewQuestion2.d.ts +9 -0
  4. package/dist/containers/ExamResult/components/MyAnswer/components/CreateNewQuestion.d.ts +2 -3
  5. package/dist/containers/ExamResult/components/Notes/components/ActionItem.d.ts +7 -0
  6. package/dist/containers/ExamResult/components/Notes/components/ActionsTooltip.d.ts +14 -0
  7. package/dist/containers/ExamResult/components/Notes/components/ContentTooltip.d.ts +14 -0
  8. package/dist/containers/ExamResult/components/Notes/components/NewNoteButton.d.ts +6 -0
  9. package/dist/containers/ExamResult/components/Notes/components/NoteItem.d.ts +9 -0
  10. package/dist/containers/ExamResult/components/Notes/components/NoteList.d.ts +12 -0
  11. package/dist/containers/ExamResult/components/Notes/configs/constants.d.ts +2 -0
  12. package/dist/containers/ExamResult/components/Notes/configs/interfaces.d.ts +4 -0
  13. package/dist/containers/ExamResult/components/Notes/hooks/useNotes.d.ts +8 -0
  14. package/dist/containers/ExamResult/components/Notes/styles/styles.d.ts +67 -0
  15. package/dist/containers/ExamResult/components/StudentNotes/components/ActionItem.d.ts +7 -0
  16. package/dist/containers/ExamResult/components/StudentNotes/components/ActionsTooltip.d.ts +14 -0
  17. package/dist/containers/ExamResult/components/StudentNotes/components/NewNoteButton.d.ts +6 -0
  18. package/dist/containers/ExamResult/components/StudentNotes/components/NoteItem.d.ts +9 -0
  19. package/dist/containers/ExamResult/components/StudentNotes/configs/constants.d.ts +2 -0
  20. package/dist/containers/ExamResult/components/StudentNotes/configs/interfaces.d.ts +7 -0
  21. package/dist/containers/ExamResult/components/StudentNotes/hooks/useStudentNotes.d.ts +12 -0
  22. package/dist/containers/ExamResult/components/StudentNotes/index.d.ts +4 -0
  23. package/dist/containers/ExamResult/components/StudentNotes/styles/styles.d.ts +67 -0
  24. package/dist/containers/ExamResult/hooks/useExamNoteDialog.d.ts +18 -0
  25. package/dist/containers/Login/views/LoginQRCode.d.ts +10 -0
  26. package/dist/containers/Notes/components/ActionItem.d.ts +7 -0
  27. package/dist/containers/Notes/components/ActionsTooltip.d.ts +16 -0
  28. package/dist/containers/Notes/components/NoteDialog.d.ts +4 -0
  29. package/dist/containers/Textbooks/components/TextbookShareDialog.d.ts +26 -0
  30. package/dist/index.css +9 -9
  31. package/dist/index.js +114 -48
  32. package/dist/index.js.map +1 -1
  33. package/dist/index.modern.js +114 -48
  34. package/dist/index.modern.js.map +1 -1
  35. package/dist/utils/enums/examStatus.d.ts +3 -2
  36. package/package.json +102 -102
  37. package/dist/StudyTouch_Character_v1_Question~jLFvuYmI.png +0 -0
  38. package/dist/components/Selectors/InActiveAcademySelector.d.ts +0 -16
  39. package/dist/containers/Academies/hooks/usePassCodeDialog.d.ts +0 -10
  40. package/dist/containers/PreparedTextbook/apiClients/academyService.d.ts +0 -1
  41. package/dist/tests/performances/do-exam-session-list-student.d.ts +0 -19
  42. package/dist/tests/performances/do-exam-session-request-answer-one-time.d.ts +0 -19
  43. package/dist/tests/performances/do-exam-session-skip-answer.d.ts +0 -19
  44. package/dist/tests/performances/do-exam-session2.d.ts +0 -19
package/dist/index.js CHANGED
@@ -4499,12 +4499,11 @@ function _objectDestructuringEmpty(obj) {
4499
4499
  function _objectWithoutPropertiesLoose(source, excluded) {
4500
4500
  if (source == null) return {};
4501
4501
  var target = {};
4502
- var sourceKeys = Object.keys(source);
4503
- var key, i;
4504
- for (i = 0; i < sourceKeys.length; i++) {
4505
- key = sourceKeys[i];
4506
- if (excluded.indexOf(key) >= 0) continue;
4507
- target[key] = source[key];
4502
+ for (var key in source) {
4503
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
4504
+ if (excluded.indexOf(key) >= 0) continue;
4505
+ target[key] = source[key];
4506
+ }
4508
4507
  }
4509
4508
  return target;
4510
4509
  }
@@ -6131,8 +6130,9 @@ function _finally(body, finalizer) {
6131
6130
  ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
6132
6131
  })(exports.ExamStatus || (exports.ExamStatus = {}));
6133
6132
  (function (QuestionAnswerType) {
6134
- QuestionAnswerType[QuestionAnswerType["ChoiceOption"] = 0] = "ChoiceOption";
6135
- QuestionAnswerType[QuestionAnswerType["Textual"] = 1] = "Textual";
6133
+ QuestionAnswerType[QuestionAnswerType["SingleChoice"] = 0] = "SingleChoice";
6134
+ QuestionAnswerType[QuestionAnswerType["MultipleChoice"] = 1] = "MultipleChoice";
6135
+ QuestionAnswerType[QuestionAnswerType["ShortAnswer"] = 2] = "ShortAnswer";
6136
6136
  })(exports.QuestionAnswerType || (exports.QuestionAnswerType = {}));
6137
6137
 
6138
6138
  (function (OrderType) {
@@ -15992,6 +15992,28 @@ var CompareGrass = function CompareGrass(_ref2) {
15992
15992
  var effectSize = _ref2.effectSize;
15993
15993
  var _useTranslation = reactI18next.useTranslation(),
15994
15994
  t = _useTranslation.t;
15995
+ var renderAnswer = function renderAnswer(type, content) {
15996
+ var _content$split, _content$split$map;
15997
+ if (!content) return "";
15998
+ switch (type) {
15999
+ case exports.QuestionAnswerType.ShortAnswer:
16000
+ return React__default.createElement(MathJaxContainer, {
16001
+ content: content
16002
+ });
16003
+ case exports.QuestionAnswerType.SingleChoice:
16004
+ return t("number_question", {
16005
+ number: content
16006
+ });
16007
+ case exports.QuestionAnswerType.MultipleChoice:
16008
+ return content === null || content === void 0 ? void 0 : (_content$split = content.split("|")) === null || _content$split === void 0 ? void 0 : (_content$split$map = _content$split.map(function (i) {
16009
+ return t("number_question", {
16010
+ number: i
16011
+ });
16012
+ })) === null || _content$split$map === void 0 ? void 0 : _content$split$map.join(",");
16013
+ default:
16014
+ return content;
16015
+ }
16016
+ };
15995
16017
  var renderTableBody = function renderTableBody(effectSize) {
15996
16018
  return effectSize.map(function (item, index) {
15997
16019
  return React__default.createElement("tr", {
@@ -16009,29 +16031,17 @@ var CompareGrass = function CompareGrass(_ref2) {
16009
16031
  textAlign: "center",
16010
16032
  color: "#202B37"
16011
16033
  }
16012
- }, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === exports.QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
16013
- content: item === null || item === void 0 ? void 0 : item.correctAnswers
16014
- }) : t("number_question", {
16015
- number: item.correctAnswers
16016
- })), React__default.createElement("td", {
16034
+ }, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.correctAnswers)), React__default.createElement("td", {
16017
16035
  className: styles$3["tdcolumn3"],
16018
16036
  style: {
16019
16037
  color: item.isCorrect ? styles$3.green_support_900 : styles$3.red_900
16020
16038
  }
16021
- }, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === exports.QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
16022
- content: item === null || item === void 0 ? void 0 : item.selectedAnswers
16023
- }) : t("number_question", {
16024
- number: item.selectedAnswers
16025
- })), React__default.createElement("td", {
16039
+ }, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.selectedAnswers)), React__default.createElement("td", {
16026
16040
  style: {
16027
16041
  textAlign: "center",
16028
16042
  color: "#414E62"
16029
16043
  }
16030
- }, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === exports.QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
16031
- content: item === null || item === void 0 ? void 0 : item.mostSelectedAnswers
16032
- }) : t("number_question", {
16033
- number: item.mostSelectedAnswers
16034
- })), React__default.createElement("td", {
16044
+ }, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.mostSelectedAnswers)), React__default.createElement("td", {
16035
16045
  className: "" + printStyles["avoid-break-inside"]
16036
16046
  }, React__default.createElement("div", {
16037
16047
  className: styles$3["classification"] + " " + printStyles["avoid-break-inside"]
@@ -16384,6 +16394,28 @@ var Vulnerable = function Vulnerable(_ref) {
16384
16394
  return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
16385
16395
  }).slice(0, limitQuestions);
16386
16396
  }, [JSON.stringify(data.questions)]);
16397
+ var renderAnswer = function renderAnswer(type, content) {
16398
+ var _content$split, _content$split$map;
16399
+ if (!content) return "";
16400
+ switch (type) {
16401
+ case exports.QuestionAnswerType.ShortAnswer:
16402
+ return React__default.createElement(MathJaxContainer, {
16403
+ content: content
16404
+ });
16405
+ case exports.QuestionAnswerType.SingleChoice:
16406
+ return t("number_question", {
16407
+ number: content
16408
+ });
16409
+ case exports.QuestionAnswerType.MultipleChoice:
16410
+ return content === null || content === void 0 ? void 0 : (_content$split = content.split("|")) === null || _content$split === void 0 ? void 0 : (_content$split$map = _content$split.map(function (i) {
16411
+ return t("number_question", {
16412
+ number: i
16413
+ });
16414
+ })) === null || _content$split$map === void 0 ? void 0 : _content$split$map.join(",");
16415
+ default:
16416
+ return content;
16417
+ }
16418
+ };
16387
16419
  var renderTableBody = function renderTableBody(data) {
16388
16420
  return data.map(function (item, index) {
16389
16421
  return React__default.createElement("tr", {
@@ -16418,20 +16450,12 @@ var Vulnerable = function Vulnerable(_ref) {
16418
16450
  fontSize: "13px",
16419
16451
  fontWeight: 500
16420
16452
  }
16421
- }, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === exports.QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
16422
- content: item === null || item === void 0 ? void 0 : item.selectedAnswers
16423
- }) : t("number_question", {
16424
- number: item.selectedAnswers
16425
- })), React__default.createElement("td", {
16453
+ }, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.selectedAnswers)), React__default.createElement("td", {
16426
16454
  style: {
16427
16455
  textAlign: "center",
16428
16456
  color: styles$3.gray_700
16429
16457
  }
16430
- }, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === exports.QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
16431
- content: item === null || item === void 0 ? void 0 : item.correctAnswers
16432
- }) : t("number_question", {
16433
- number: item.correctAnswers
16434
- })), React__default.createElement("td", {
16458
+ }, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.correctAnswers)), React__default.createElement("td", {
16435
16459
  style: {
16436
16460
  textAlign: "center",
16437
16461
  color: styles$3.gray_700
@@ -16441,6 +16465,7 @@ var Vulnerable = function Vulnerable(_ref) {
16441
16465
  };
16442
16466
  var renderQuestions = function renderQuestions(questions) {
16443
16467
  return questions.map(function (question) {
16468
+ var _question$selectedAns, _question$selectedAns2, _question$correctAnsw, _question$correctAnsw2, _question$correctAnsw3;
16444
16469
  return React__default.createElement(material.Grid, {
16445
16470
  container: true,
16446
16471
  flexWrap: "nowrap",
@@ -16467,7 +16492,23 @@ var Vulnerable = function Vulnerable(_ref) {
16467
16492
  className: styles$3["span2"]
16468
16493
  }, t("my_wrong_answer"))), React__default.createElement("div", null, React__default.createElement("span", {
16469
16494
  className: styles$3["overallCorrectRate"]
16470
- }, question.overallCorrectRate.toFixed(2), "%"), React__default.createElement("span", {
16495
+ }, question.overallCorrectRate.toFixed(2), "%"), question.questionAnswerType === exports.QuestionAnswerType.ShortAnswer ? React__default.createElement("span", {
16496
+ className: styles$3["answer"]
16497
+ }, React__default.createElement(MathJaxContainer, {
16498
+ content: question.selectedAnswers
16499
+ }), " ", t("answer"), " ", React__default.createElement(MathJaxContainer, {
16500
+ content: question.correctAnswers
16501
+ })) : question.questionAnswerType === exports.QuestionAnswerType.MultipleChoice ? React__default.createElement("span", {
16502
+ className: styles$3["answer"]
16503
+ }, (_question$selectedAns = question.selectedAnswers.split("|")) === null || _question$selectedAns === void 0 ? void 0 : (_question$selectedAns2 = _question$selectedAns.map(function (i) {
16504
+ return t("number_question", {
16505
+ number: i
16506
+ });
16507
+ })) === null || _question$selectedAns2 === void 0 ? void 0 : _question$selectedAns2.join(","), " (", t("answer"), " ", (_question$correctAnsw = question.correctAnswers) === null || _question$correctAnsw === void 0 ? void 0 : (_question$correctAnsw2 = _question$correctAnsw.split("|")) === null || _question$correctAnsw2 === void 0 ? void 0 : (_question$correctAnsw3 = _question$correctAnsw2.map(function (i) {
16508
+ return t("number_question", {
16509
+ number: i
16510
+ });
16511
+ })) === null || _question$correctAnsw3 === void 0 ? void 0 : _question$correctAnsw3.join(","), ")") : React__default.createElement("span", {
16471
16512
  className: styles$3["answer"]
16472
16513
  }, t("number_question", {
16473
16514
  number: question.selectedAnswers
@@ -18231,6 +18272,28 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
18231
18272
  return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
18232
18273
  }).slice(0, limitQuestions$1);
18233
18274
  }, [JSON.stringify(data === null || data === void 0 ? void 0 : data.studentQuestionResults)]);
18275
+ var renderAnswer = function renderAnswer(type, content) {
18276
+ var _content$split, _content$split$map;
18277
+ if (!content) return "";
18278
+ switch (type) {
18279
+ case exports.QuestionAnswerType.ShortAnswer:
18280
+ return React__default.createElement(MathJaxContainer, {
18281
+ content: content
18282
+ });
18283
+ case exports.QuestionAnswerType.SingleChoice:
18284
+ return t("number_question", {
18285
+ number: content
18286
+ });
18287
+ case exports.QuestionAnswerType.MultipleChoice:
18288
+ return content === null || content === void 0 ? void 0 : (_content$split = content.split("|")) === null || _content$split === void 0 ? void 0 : (_content$split$map = _content$split.map(function (i) {
18289
+ return t("number_question", {
18290
+ number: i
18291
+ });
18292
+ })) === null || _content$split$map === void 0 ? void 0 : _content$split$map.join(",");
18293
+ default:
18294
+ return content;
18295
+ }
18296
+ };
18234
18297
  var renderTableBody = function renderTableBody(data) {
18235
18298
  return data === null || data === void 0 ? void 0 : data.map(function (item, index) {
18236
18299
  return React__default.createElement("tr", {
@@ -18265,20 +18328,12 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
18265
18328
  fontSize: "13px",
18266
18329
  fontWeight: 500
18267
18330
  }
18268
- }, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === exports.QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
18269
- content: item === null || item === void 0 ? void 0 : item.selectedAnswers
18270
- }) : t("number_question", {
18271
- number: item.selectedAnswers
18272
- })), React__default.createElement("td", {
18331
+ }, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.selectedAnswers)), React__default.createElement("td", {
18273
18332
  style: {
18274
18333
  textAlign: "center",
18275
18334
  color: styles$3.gray_700
18276
18335
  }
18277
- }, (item === null || item === void 0 ? void 0 : item.questionAnswerType) === exports.QuestionAnswerType.Textual ? React__default.createElement(MathJaxContainer, {
18278
- content: item === null || item === void 0 ? void 0 : item.correctAnswers
18279
- }) : t("number_question", {
18280
- number: item.correctAnswers
18281
- })), React__default.createElement("td", {
18336
+ }, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.correctAnswers)), React__default.createElement("td", {
18282
18337
  style: {
18283
18338
  textAlign: "center",
18284
18339
  color: styles$3.gray_700
@@ -18290,6 +18345,7 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
18290
18345
  };
18291
18346
  var renderQuestions = function renderQuestions(questions) {
18292
18347
  return questions.map(function (question) {
18348
+ var _question$selectedAns, _question$selectedAns2, _question$selectedAns3, _question$correctAnsw, _question$correctAnsw2, _question$correctAnsw3;
18293
18349
  return React__default.createElement(material.Grid, {
18294
18350
  container: true,
18295
18351
  flexWrap: "nowrap",
@@ -18316,17 +18372,27 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
18316
18372
  className: styles$3["span2"]
18317
18373
  }, t("my_wrong_answer"))), React__default.createElement("div", null, React__default.createElement("span", {
18318
18374
  className: styles$3["overallCorrectRate"]
18319
- }, question.overallCorrectRate.toFixed(2), "%"), (question === null || question === void 0 ? void 0 : question.questionAnswerType) === exports.QuestionAnswerType.Textual ? React__default.createElement("span", {
18375
+ }, question.overallCorrectRate.toFixed(2), "%"), (question === null || question === void 0 ? void 0 : question.questionAnswerType) === exports.QuestionAnswerType.ShortAnswer ? React__default.createElement("span", {
18320
18376
  className: styles$3["answer"]
18321
18377
  }, React__default.createElement(MathJaxContainer, {
18322
18378
  content: question === null || question === void 0 ? void 0 : question.selectedAnswers
18323
18379
  }), " ", React__default.createElement(MathJaxContainer, {
18324
18380
  content: question === null || question === void 0 ? void 0 : question.correctAnswers
18325
- })) : React__default.createElement("span", {
18381
+ })) : exports.QuestionAnswerType.MultipleChoice ? React__default.createElement("span", {
18382
+ className: styles$3["answer"]
18383
+ }, (_question$selectedAns = question.selectedAnswers) === null || _question$selectedAns === void 0 ? void 0 : (_question$selectedAns2 = _question$selectedAns.split("|")) === null || _question$selectedAns2 === void 0 ? void 0 : (_question$selectedAns3 = _question$selectedAns2.map(function (i) {
18384
+ return t("number_question", {
18385
+ number: i
18386
+ });
18387
+ })) === null || _question$selectedAns3 === void 0 ? void 0 : _question$selectedAns3.join(","), " ", "(", t("answer"), " ", (_question$correctAnsw = question.correctAnswers) === null || _question$correctAnsw === void 0 ? void 0 : (_question$correctAnsw2 = _question$correctAnsw.split("|")) === null || _question$correctAnsw2 === void 0 ? void 0 : (_question$correctAnsw3 = _question$correctAnsw2.map(function (i) {
18388
+ return t("number_question", {
18389
+ number: i
18390
+ });
18391
+ })) === null || _question$correctAnsw3 === void 0 ? void 0 : _question$correctAnsw3.join(","), ")", " ") : React__default.createElement("span", {
18326
18392
  className: styles$3["answer"]
18327
18393
  }, t("number_question", {
18328
18394
  number: question.selectedAnswers
18329
- }), " (", t("answer"), " ", t("number_question", {
18395
+ }), " ", "(", t("answer"), " ", t("number_question", {
18330
18396
  number: question.correctAnswers
18331
18397
  }), ")"))));
18332
18398
  });
@@ -26739,7 +26805,7 @@ var DefaultQuestion = {
26739
26805
  author: "",
26740
26806
  subjectId: null,
26741
26807
  preparedType: null,
26742
- questionAnswerType: exports.QuestionAnswerType.ChoiceOption,
26808
+ questionAnswerType: exports.QuestionAnswerType.SingleChoice,
26743
26809
  textualAnswer: ""
26744
26810
  };
26745
26811
  var DefaultArticle = {