touchstudy-core 0.1.138 → 0.1.139

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.
@@ -23807,9 +23807,6 @@ var useExamDetailView = function useExamDetailView(props) {
23807
23807
  useEffect(function () {
23808
23808
  getCategoryList();
23809
23809
  }, [exam.subjectId]);
23810
- console.log({
23811
- exam: exam
23812
- });
23813
23810
  var examGroupByArticle = useMemo(function () {
23814
23811
  if (!exam) return [];
23815
23812
  var articles = [];
@@ -28846,17 +28843,22 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
28846
28843
  setOpen(groupIndex === open ? undefined : groupIndex);
28847
28844
  };
28848
28845
  var handleGetNewQuestionGroup = function handleGetNewQuestionGroup() {
28849
- var questionGroup = isMath ? DEFAULT_MATH_QUESTION_GROUP : DEFAULT_QUESTION_GROUP;
28846
+ var newQuestionGroup = isMath ? DEFAULT_MATH_QUESTION_GROUP : DEFAULT_QUESTION_GROUP;
28850
28847
  var lastQuestionGroups = questionGroups.length ? questionGroups[questionGroups.length - 1] : undefined;
28851
- if (!lastQuestionGroups) return questionGroup;else {
28848
+ newQuestionGroup.questions = newQuestionGroup.questions.map(function (i, index) {
28849
+ return _extends({}, i, {
28850
+ questionOrder: index
28851
+ });
28852
+ });
28853
+ if (!lastQuestionGroups) return newQuestionGroup;else {
28852
28854
  var _lastQuestionGroups$q, _lastQuestionGroups$q2, _lastQuestionGroups$q3;
28853
28855
  var lastOrder = (_lastQuestionGroups$q = (_lastQuestionGroups$q2 = lastQuestionGroups.questions) === null || _lastQuestionGroups$q2 === void 0 ? void 0 : (_lastQuestionGroups$q3 = _lastQuestionGroups$q2[lastQuestionGroups.questions.length - 1]) === null || _lastQuestionGroups$q3 === void 0 ? void 0 : _lastQuestionGroups$q3.questionOrder) != null ? _lastQuestionGroups$q : 0;
28854
- questionGroup.questions = questionGroup.questions.map(function (q, index) {
28856
+ newQuestionGroup.questions = newQuestionGroup.questions.map(function (q, index) {
28855
28857
  return _extends({}, q, {
28856
28858
  questionOrder: lastOrder + index + 1
28857
28859
  });
28858
28860
  });
28859
- return questionGroup;
28861
+ return newQuestionGroup;
28860
28862
  }
28861
28863
  };
28862
28864
  var handelChanngeQuestionCount = function handelChanngeQuestionCount(questionCount, index) {
@@ -28995,7 +28997,8 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
28995
28997
  startIcon: React__default.createElement(IoIosAdd, null),
28996
28998
  onClick: function onClick() {
28997
28999
  var length = questionGroups.length;
28998
- arrayHelpers.push(handleGetNewQuestionGroup());
29000
+ var addedGroup = handleGetNewQuestionGroup();
29001
+ arrayHelpers.push(addedGroup);
28999
29002
  handleToggle(length);
29000
29003
  }
29001
29004
  }, t("question_group"))));
@@ -30424,10 +30427,6 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
30424
30427
  dirty = formikProps.dirty,
30425
30428
  submitCount = formikProps.submitCount,
30426
30429
  setValues = formikProps.setValues;
30427
- console.log({
30428
- values: values,
30429
- errors: errors
30430
- });
30431
30430
  useEffect(function () {
30432
30431
  var handleBeforeUnload = function handleBeforeUnload(event) {
30433
30432
  var message = t$1("are_you_sure_you_want_to_quit_yours_changes_may_not_be_saved");
@@ -31687,6 +31686,7 @@ var ChapterDetail = function ChapterDetail(_ref) {
31687
31686
  theme = _ref.theme,
31688
31687
  isEnglish = _ref.isEnglish,
31689
31688
  chapter = _ref.chapter,
31689
+ isStudying = _ref.isStudying,
31690
31690
  handleOpenChapterDialog = _ref.handleOpenChapterDialog;
31691
31691
  var _useExpand = useExpand(),
31692
31692
  expanded = _useExpand.expanded,
@@ -31801,6 +31801,7 @@ var ChapterDetail = function ChapterDetail(_ref) {
31801
31801
  },
31802
31802
  variant: "contained",
31803
31803
  startIcon: React__default.createElement(IoReceiptSharp, null),
31804
+ disabled: !isStudying,
31804
31805
  onClick: function onClick() {
31805
31806
  return handleOpenChapterDialog(chapter);
31806
31807
  }
@@ -32115,6 +32116,7 @@ var Statistic = function Statistic(_ref) {
32115
32116
  };
32116
32117
 
32117
32118
  var TextbookDrawer = function TextbookDrawer(_ref) {
32119
+ var _textbook$chapters, _textbook$chapters2;
32118
32120
  var isOpen = _ref.isOpen,
32119
32121
  onClose = _ref.onClose,
32120
32122
  textbookId = _ref.textbookId,
@@ -32353,12 +32355,13 @@ var TextbookDrawer = function TextbookDrawer(_ref) {
32353
32355
  sx: {
32354
32356
  gap: "16px"
32355
32357
  }
32356
- }, textbook === null || textbook === void 0 ? void 0 : textbook.chapters.map(function (chapter) {
32358
+ }, textbook === null || textbook === void 0 ? void 0 : (_textbook$chapters = textbook.chapters) === null || _textbook$chapters === void 0 ? void 0 : _textbook$chapters.map(function (chapter) {
32357
32359
  return React__default.createElement(ChapterDetail, {
32358
32360
  t: t,
32359
32361
  isEnglish: isEnglish,
32360
32362
  theme: theme,
32361
32363
  chapter: chapter,
32364
+ isStudying: !!(textbook !== null && textbook !== void 0 && textbook.isStudying),
32362
32365
  handleOpenChapterDialog: handleOpenChapterDialog
32363
32366
  });
32364
32367
  })))), React__default.createElement(CustomTabPanel, {
@@ -32374,7 +32377,7 @@ var TextbookDrawer = function TextbookDrawer(_ref) {
32374
32377
  m: "24px",
32375
32378
  gap: "8px"
32376
32379
  }
32377
- }, textbook === null || textbook === void 0 ? void 0 : textbook.chapters.map(function (chapter) {
32380
+ }, textbook === null || textbook === void 0 ? void 0 : (_textbook$chapters2 = textbook.chapters) === null || _textbook$chapters2 === void 0 ? void 0 : _textbook$chapters2.map(function (chapter) {
32378
32381
  return React__default.createElement(Statistic, {
32379
32382
  t: t,
32380
32383
  isEnglish: isEnglish,