touchstudy-core 0.1.138 → 0.1.140

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