touchstudy-core 0.1.149 → 0.1.151
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/containers/ExamResult/configs/types.d.ts +4 -2
- package/dist/containers/PreparedTextbook/components/QuestionShortInput.d.ts +3 -0
- package/dist/containers/PreparedTextbook/configs/types.d.ts +2 -2
- package/dist/index.js +166 -133
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +166 -133
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -21,7 +21,7 @@ var Select = require('react-select');
|
|
21
21
|
var Select__default = _interopDefault(Select);
|
22
22
|
var CreatableSelect = _interopDefault(require('react-select/creatable'));
|
23
23
|
var axios = _interopDefault(require('axios'));
|
24
|
-
var _$
|
24
|
+
var _$8 = _interopDefault(require('lodash'));
|
25
25
|
var reactGoogleLogin = require('@leecheuk/react-google-login');
|
26
26
|
require('moment/locale/ko.js');
|
27
27
|
require('moment/locale/en-au.js');
|
@@ -1473,6 +1473,7 @@ var order_matters = "순서 상관 있음";
|
|
1473
1473
|
var order_does_not_matter = "순서 상관 없음";
|
1474
1474
|
var synonym_processing = "답 이음동의어 처리";
|
1475
1475
|
var compare_type = "비교 유형";
|
1476
|
+
var answer_cannot_be_empty = "답변은 비워둘 수 없습니다";
|
1476
1477
|
var lang_ko = {
|
1477
1478
|
problem_solving: problem_solving,
|
1478
1479
|
my_story: my_story,
|
@@ -2583,7 +2584,8 @@ var lang_ko = {
|
|
2583
2584
|
order_matters: order_matters,
|
2584
2585
|
order_does_not_matter: order_does_not_matter,
|
2585
2586
|
synonym_processing: synonym_processing,
|
2586
|
-
compare_type: compare_type
|
2587
|
+
compare_type: compare_type,
|
2588
|
+
answer_cannot_be_empty: answer_cannot_be_empty
|
2587
2589
|
};
|
2588
2590
|
|
2589
2591
|
var problem_solving$1 = "Problem Solving";
|
@@ -3717,6 +3719,7 @@ var order_matters$1 = "Order matters";
|
|
3717
3719
|
var order_does_not_matter$1 = "Order doesn't matter";
|
3718
3720
|
var synonym_processing$1 = "Answer Synonym processing";
|
3719
3721
|
var compare_type$1 = "Compare Type";
|
3722
|
+
var answer_cannot_be_empty$1 = "Answer cannot be empty";
|
3720
3723
|
var lang_en = {
|
3721
3724
|
problem_solving: problem_solving$1,
|
3722
3725
|
my_story: my_story$1,
|
@@ -4829,7 +4832,8 @@ var lang_en = {
|
|
4829
4832
|
order_matters: order_matters$1,
|
4830
4833
|
order_does_not_matter: order_does_not_matter$1,
|
4831
4834
|
synonym_processing: synonym_processing$1,
|
4832
|
-
compare_type: compare_type$1
|
4835
|
+
compare_type: compare_type$1,
|
4836
|
+
answer_cannot_be_empty: answer_cannot_be_empty$1
|
4833
4837
|
};
|
4834
4838
|
|
4835
4839
|
i18n__default.use(reactI18next.initReactI18next).init({
|
@@ -6426,7 +6430,7 @@ var getLocalDayOfWeek = function getLocalDayOfWeek(utcDateTime, dayOfWeek) {
|
|
6426
6430
|
return moment.utc(utcDateTime).add(diff, "days").local().weekday();
|
6427
6431
|
};
|
6428
6432
|
var getUtcDayOfWeek = function getUtcDayOfWeek(localDateTime, dayOfWeek) {
|
6429
|
-
var currentDayOfWeek = _$
|
6433
|
+
var currentDayOfWeek = _$8.cloneDeep(localDateTime).local().weekday();
|
6430
6434
|
var diff = dayOfWeek - currentDayOfWeek;
|
6431
6435
|
if (diff < 0) diff += 7;
|
6432
6436
|
return localDateTime.add(diff, "days").utc().weekday();
|
@@ -6927,7 +6931,7 @@ var useList = function useList(fetchData, defaultQuery) {
|
|
6927
6931
|
var _paging$page, _paging$limit;
|
6928
6932
|
return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
|
6929
6933
|
};
|
6930
|
-
var debounceSearch = _$
|
6934
|
+
var debounceSearch = _$8.debounce(function () {
|
6931
6935
|
var _textSearchRef$curren;
|
6932
6936
|
setFilter(_extends({}, filter, {
|
6933
6937
|
currentPage: 1,
|
@@ -12764,7 +12768,7 @@ var ClassForm = function ClassForm(_ref) {
|
|
12764
12768
|
};
|
12765
12769
|
var handleDeleteWeeklyDays = function handleDeleteWeeklyDays(currentValue) {
|
12766
12770
|
if (formikProp.values.courseWeeklyDays.length <= 1) return;
|
12767
|
-
var courseWeeklyDays = _$
|
12771
|
+
var courseWeeklyDays = _$8.cloneDeep(formikProp.values.courseWeeklyDays);
|
12768
12772
|
var newValues = courseWeeklyDays.filter(function (i) {
|
12769
12773
|
var _i$startTime, _currentValue$startTi, _i$endTime, _currentValue$endTime;
|
12770
12774
|
return i.dayOfWeek !== currentValue.dayOfWeek || ((_i$startTime = i.startTime) === null || _i$startTime === void 0 ? void 0 : _i$startTime.format("HH:mm:ss")) !== ((_currentValue$startTi = currentValue.startTime) === null || _currentValue$startTi === void 0 ? void 0 : _currentValue$startTi.format("HH:mm:ss")) || ((_i$endTime = i.endTime) === null || _i$endTime === void 0 ? void 0 : _i$endTime.format("HH:mm:ss")) !== ((_currentValue$endTime = currentValue.endTime) === null || _currentValue$endTime === void 0 ? void 0 : _currentValue$endTime.format("HH:mm:ss"));
|
@@ -12800,7 +12804,7 @@ var ClassForm = function ClassForm(_ref) {
|
|
12800
12804
|
var handleChangeWeeklyDayTime = function handleChangeWeeklyDayTime(key, newValue, currentValue) {
|
12801
12805
|
var _extends2;
|
12802
12806
|
var time = newValue === null || newValue === void 0 ? void 0 : newValue.local();
|
12803
|
-
var courseWeeklyDays = _$
|
12807
|
+
var courseWeeklyDays = _$8.cloneDeep(formikProp.values.courseWeeklyDays);
|
12804
12808
|
var currentIndex = courseWeeklyDays.findIndex(function (i) {
|
12805
12809
|
var _i$startTime2, _currentValue$startTi2, _i$endTime2, _currentValue$endTime2;
|
12806
12810
|
return i.dayOfWeek === currentValue.dayOfWeek && ((_i$startTime2 = i.startTime) === null || _i$startTime2 === void 0 ? void 0 : _i$startTime2.format("HH:mm:ss")) === ((_currentValue$startTi2 = currentValue.startTime) === null || _currentValue$startTi2 === void 0 ? void 0 : _currentValue$startTi2.format("HH:mm:ss")) && ((_i$endTime2 = i.endTime) === null || _i$endTime2 === void 0 ? void 0 : _i$endTime2.format("HH:mm:ss")) === ((_currentValue$endTime2 = currentValue.endTime) === null || _currentValue$endTime2 === void 0 ? void 0 : _currentValue$endTime2.format("HH:mm:ss"));
|
@@ -12835,11 +12839,11 @@ var ClassForm = function ClassForm(_ref) {
|
|
12835
12839
|
}, [JSON.stringify(data)]);
|
12836
12840
|
var minDate = React.useMemo(function () {
|
12837
12841
|
if (!formikProp.values.startDate) return undefined;
|
12838
|
-
return _$
|
12842
|
+
return _$8.cloneDeep(formikProp.values.startDate).add(1, "days");
|
12839
12843
|
}, [formikProp.values.startDate]);
|
12840
12844
|
var maxDate = React.useMemo(function () {
|
12841
12845
|
if (!formikProp.values.endDate) return undefined;
|
12842
|
-
return _$
|
12846
|
+
return _$8.cloneDeep(formikProp.values.endDate).add(1, "days");
|
12843
12847
|
}, [formikProp.values.endDate]);
|
12844
12848
|
var WeeklyDayErrors = formikProp.touched.courseWeeklyDays && formikProp.errors.courseWeeklyDays && React__default.createElement("div", {
|
12845
12849
|
className: "mt-1"
|
@@ -12856,7 +12860,7 @@ var ClassForm = function ClassForm(_ref) {
|
|
12856
12860
|
});
|
12857
12861
|
}, [JSON.stringify(formikProp.values.courseWeeklyDays)]);
|
12858
12862
|
var courseWeeklyDays = React.useMemo(function () {
|
12859
|
-
return _$
|
12863
|
+
return _$8.sortBy(formikProp.values.courseWeeklyDays, ["dayOfWeek"]);
|
12860
12864
|
}, [JSON.stringify(formikProp.values.courseWeeklyDays)]);
|
12861
12865
|
return React__default.createElement("div", {
|
12862
12866
|
className: "d-flex flex-column"
|
@@ -13007,7 +13011,7 @@ var ClassForm = function ClassForm(_ref) {
|
|
13007
13011
|
value: v.startTime,
|
13008
13012
|
format: "HH:mm",
|
13009
13013
|
open: open === index + "-startTime",
|
13010
|
-
maxTime: v.endTime ? _$
|
13014
|
+
maxTime: v.endTime ? _$8.cloneDeep(v.endTime).add(-1, "minutes") : undefined,
|
13011
13015
|
onAccept: function onAccept(newValue) {
|
13012
13016
|
return handleChangeWeeklyDayTime("startTime", newValue, v);
|
13013
13017
|
},
|
@@ -13037,7 +13041,7 @@ var ClassForm = function ClassForm(_ref) {
|
|
13037
13041
|
components: ["TimePicker"]
|
13038
13042
|
}, React__default.createElement(xDatePickers.TimePicker, {
|
13039
13043
|
value: v.endTime,
|
13040
|
-
minTime: v.startTime ? (_$cloneDeep = _$
|
13044
|
+
minTime: v.startTime ? (_$cloneDeep = _$8.cloneDeep(v.startTime)) === null || _$cloneDeep === void 0 ? void 0 : _$cloneDeep.add(1, "minutes") : undefined,
|
13041
13045
|
format: "HH:mm",
|
13042
13046
|
open: open === index + "-endTime",
|
13043
13047
|
onAccept: function onAccept(newValue) {
|
@@ -13170,7 +13174,7 @@ var useStudentInfoDrawer = function useStudentInfoDrawer(props) {
|
|
13170
13174
|
return _extends({}, state, (_extends2 = {}, _extends2[newValue] = true, _extends2));
|
13171
13175
|
});
|
13172
13176
|
};
|
13173
|
-
var debounceChangeTab = _$
|
13177
|
+
var debounceChangeTab = _$8.debounce(handleChangeTab, 300);
|
13174
13178
|
React.useEffect(function () {
|
13175
13179
|
var getStudent = function getStudent() {
|
13176
13180
|
try {
|
@@ -14729,7 +14733,7 @@ var useNotes = function useNotes(setFilter, filter) {
|
|
14729
14733
|
var items = (data === null || data === void 0 ? void 0 : data.items) || [];
|
14730
14734
|
var newNotes = items;
|
14731
14735
|
if (filter !== null && filter !== void 0 && filter.currentPage && (filter === null || filter === void 0 ? void 0 : filter.currentPage) > 1) {
|
14732
|
-
newNotes = [].concat(_$
|
14736
|
+
newNotes = [].concat(_$8.uniqBy([].concat(notes, items), "id"));
|
14733
14737
|
}
|
14734
14738
|
setNotes(newNotes);
|
14735
14739
|
});
|
@@ -14752,7 +14756,7 @@ var useNotes = function useNotes(setFilter, filter) {
|
|
14752
14756
|
});
|
14753
14757
|
}, [filter === null || filter === void 0 ? void 0 : filter.currentPage, totalPages]);
|
14754
14758
|
var handleNoteAdded = function handleNoteAdded(note) {
|
14755
|
-
var newNotes = [].concat(_$
|
14759
|
+
var newNotes = [].concat(_$8.uniqBy([note].concat(notes), "id"));
|
14756
14760
|
setNotes(newNotes);
|
14757
14761
|
};
|
14758
14762
|
var handleNoteUpdated = function handleNoteUpdated(note) {
|
@@ -15137,7 +15141,7 @@ var useVirtualList = function useVirtualList(studentId, defaultFilter, getItemsA
|
|
15137
15141
|
var responseItems = (responseData === null || responseData === void 0 ? void 0 : responseData.items) || [];
|
15138
15142
|
var results = responseItems;
|
15139
15143
|
if (filter !== null && filter !== void 0 && filter.currentPage && filter.currentPage > 1) {
|
15140
|
-
results = [].concat(_$
|
15144
|
+
results = [].concat(_$8.uniqBy([].concat(items, responseItems), "id"));
|
15141
15145
|
}
|
15142
15146
|
setItems(results);
|
15143
15147
|
});
|
@@ -15160,7 +15164,7 @@ var useVirtualList = function useVirtualList(studentId, defaultFilter, getItemsA
|
|
15160
15164
|
});
|
15161
15165
|
}, [filter === null || filter === void 0 ? void 0 : filter.currentPage, totalPages]);
|
15162
15166
|
var handleItemAdded = function handleItemAdded(item) {
|
15163
|
-
var results = [].concat(_$
|
15167
|
+
var results = [].concat(_$8.uniqBy([item].concat(items), "id"));
|
15164
15168
|
setItems(results);
|
15165
15169
|
};
|
15166
15170
|
var handleItemUpdated = function handleItemUpdated(item) {
|
@@ -18489,6 +18493,7 @@ var TimeOrderChart = function TimeOrderChart(_ref) {
|
|
18489
18493
|
};
|
18490
18494
|
|
18491
18495
|
var TextbookAnswerItem = function TextbookAnswerItem(_ref) {
|
18496
|
+
var _data$selectedAnswers, _data$textualAnswers, _data$selectedAnswers2, _data$textualAnswers2, _data$selectedAnswers3, _data$textualAnswers3;
|
18492
18497
|
var data = _ref.data,
|
18493
18498
|
nextData = _ref.nextData,
|
18494
18499
|
isFirst = _ref.isFirst,
|
@@ -18542,11 +18547,11 @@ var TextbookAnswerItem = function TextbookAnswerItem(_ref) {
|
|
18542
18547
|
alignItems: "center",
|
18543
18548
|
gap: "4px"
|
18544
18549
|
}
|
18545
|
-
}, data.isCorrect && data.selectedAnswers !==
|
18550
|
+
}, data.isCorrect && (!!((_data$selectedAnswers = data.selectedAnswers) !== null && _data$selectedAnswers !== void 0 && _data$selectedAnswers.length) || !!((_data$textualAnswers = data.textualAnswers) !== null && _data$textualAnswers !== void 0 && _data$textualAnswers.length)) && React__default.createElement(React.Fragment, null, React__default.createElement(iconCorrectAnswer, null), React__default.createElement("span", {
|
18546
18551
|
className: styles$4["answerCorrect"]
|
18547
|
-
}, t("correct"))), !data.isCorrect && data.selectedAnswers !==
|
18552
|
+
}, t("correct"))), !data.isCorrect && (!!((_data$selectedAnswers2 = data.selectedAnswers) !== null && _data$selectedAnswers2 !== void 0 && _data$selectedAnswers2.length) || !!((_data$textualAnswers2 = data.textualAnswers) !== null && _data$textualAnswers2 !== void 0 && _data$textualAnswers2.length)) && React__default.createElement(React.Fragment, null, React__default.createElement(iconCorrectAnswer$1, null), React__default.createElement("span", {
|
18548
18553
|
className: styles$4["answerIncorrect"]
|
18549
|
-
}, t("incorrect"))), data.selectedAnswers
|
18554
|
+
}, t("incorrect"))), !((_data$selectedAnswers3 = data.selectedAnswers) !== null && _data$selectedAnswers3 !== void 0 && _data$selectedAnswers3.length) && !((_data$textualAnswers3 = data.textualAnswers) !== null && _data$textualAnswers3 !== void 0 && _data$textualAnswers3.length) && React__default.createElement(React.Fragment, null, React__default.createElement(iconNoGrass, null), React__default.createElement("span", {
|
18550
18555
|
className: styles$4["answerNograss"]
|
18551
18556
|
}, t("no_solution")))), React__default.createElement("div", {
|
18552
18557
|
className: styles["custom-col-2"],
|
@@ -18930,11 +18935,30 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
18930
18935
|
var isOpen = openProblem === keyOpen;
|
18931
18936
|
var incorrectQuestions = React.useMemo(function () {
|
18932
18937
|
return data === null || data === void 0 ? void 0 : data.studentQuestionResults.filter(function (i) {
|
18933
|
-
|
18938
|
+
var _i$selectedAnswers, _i$textualAnswers;
|
18939
|
+
return (((_i$selectedAnswers = i.selectedAnswers) === null || _i$selectedAnswers === void 0 ? void 0 : _i$selectedAnswers.length) || ((_i$textualAnswers = i.textualAnswers) === null || _i$textualAnswers === void 0 ? void 0 : _i$textualAnswers.length)) && i.isCorrect === false && i.isStar === false && i.overallCorrectRate >= correctRateThreshHold$1;
|
18934
18940
|
}).sort(function (q1, q2) {
|
18935
18941
|
return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
|
18936
18942
|
}).slice(0, limitQuestions$1);
|
18937
18943
|
}, [JSON.stringify(data === null || data === void 0 ? void 0 : data.studentQuestionResults)]);
|
18944
|
+
var renderTextbookAnswer = function renderTextbookAnswer(type, answers, textualAnswers, isCorrect) {
|
18945
|
+
var _textualAnswers$;
|
18946
|
+
switch (type) {
|
18947
|
+
case exports.QuestionAnswerType.ShortAnswer:
|
18948
|
+
case exports.QuestionAnswerType.SynonymProcessing:
|
18949
|
+
return isCorrect ? textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(" | ") : (_textualAnswers$ = textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers[0]) != null ? _textualAnswers$ : "";
|
18950
|
+
case exports.QuestionAnswerType.SingleChoice:
|
18951
|
+
case exports.QuestionAnswerType.MultipleChoice:
|
18952
|
+
if (!(answers !== null && answers !== void 0 && answers.length)) return "";
|
18953
|
+
return answers.map(function (i) {
|
18954
|
+
return t("number_question", {
|
18955
|
+
number: i
|
18956
|
+
});
|
18957
|
+
}).join(",");
|
18958
|
+
default:
|
18959
|
+
return textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(", ");
|
18960
|
+
}
|
18961
|
+
};
|
18938
18962
|
var renderAnswer = function renderAnswer(type, content) {
|
18939
18963
|
var _content$split, _content$split$map;
|
18940
18964
|
if (!content) return "";
|
@@ -18991,12 +19015,12 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
18991
19015
|
fontSize: "13px",
|
18992
19016
|
fontWeight: 500
|
18993
19017
|
}
|
18994
|
-
},
|
19018
|
+
}, typeof item.selectedAnswers === "string" ? renderAnswer(item.questionAnswerType, item.selectedAnswers) : renderTextbookAnswer(item.questionAnswerType, item.selectedAnswers, item.textualAnswers)), React__default.createElement("td", {
|
18995
19019
|
style: {
|
18996
19020
|
textAlign: "center",
|
18997
19021
|
color: styles$4.gray_700
|
18998
19022
|
}
|
18999
|
-
},
|
19023
|
+
}, typeof item.correctAnswers === "string" ? renderAnswer(item.questionAnswerType, item.correctAnswers) : renderTextbookAnswer(item.questionAnswerType, item.correctAnswers, item.correctTextualAnswers, true)), React__default.createElement("td", {
|
19000
19024
|
style: {
|
19001
19025
|
textAlign: "center",
|
19002
19026
|
color: styles$4.gray_700
|
@@ -19008,7 +19032,6 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
19008
19032
|
};
|
19009
19033
|
var renderQuestions = function renderQuestions(questions) {
|
19010
19034
|
return questions.map(function (question) {
|
19011
|
-
var _question$selectedAns, _question$selectedAns2, _question$selectedAns3, _question$correctAnsw, _question$correctAnsw2, _question$correctAnsw3;
|
19012
19035
|
return React__default.createElement(material.Grid, {
|
19013
19036
|
container: true,
|
19014
19037
|
flexWrap: "nowrap",
|
@@ -19035,29 +19058,9 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
19035
19058
|
className: styles$4["span2"]
|
19036
19059
|
}, t("my_wrong_answer"))), React__default.createElement("div", null, React__default.createElement("span", {
|
19037
19060
|
className: styles$4["overallCorrectRate"]
|
19038
|
-
}, question.overallCorrectRate.toFixed(2), "%"),
|
19039
|
-
className: styles$4["answer"]
|
19040
|
-
}, React__default.createElement(MathJaxContainer, {
|
19041
|
-
content: question === null || question === void 0 ? void 0 : question.selectedAnswers
|
19042
|
-
}), " ", React__default.createElement(MathJaxContainer, {
|
19043
|
-
content: question === null || question === void 0 ? void 0 : question.correctAnswers
|
19044
|
-
})) : exports.QuestionAnswerType.MultipleChoice ? React__default.createElement("span", {
|
19045
|
-
className: styles$4["answer"]
|
19046
|
-
}, (_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) {
|
19047
|
-
return t("number_question", {
|
19048
|
-
number: i
|
19049
|
-
});
|
19050
|
-
})) === 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) {
|
19051
|
-
return t("number_question", {
|
19052
|
-
number: i
|
19053
|
-
});
|
19054
|
-
})) === null || _question$correctAnsw3 === void 0 ? void 0 : _question$correctAnsw3.join(","), ")", " ") : React__default.createElement("span", {
|
19061
|
+
}, question.overallCorrectRate.toFixed(2), "%"), React__default.createElement("span", {
|
19055
19062
|
className: styles$4["answer"]
|
19056
|
-
}, t("
|
19057
|
-
number: question.selectedAnswers
|
19058
|
-
}), " ", "(", t("answer"), " ", t("number_question", {
|
19059
|
-
number: question.correctAnswers
|
19060
|
-
}), ")"))));
|
19063
|
+
}, typeof question.selectedAnswers === "string" ? renderAnswer(question.questionAnswerType, question.selectedAnswers) : renderTextbookAnswer(question.questionAnswerType, question.selectedAnswers, question.textualAnswers), " ", t("answer"), " ", typeof question.correctAnswers === "string" ? renderAnswer(question.questionAnswerType, question.correctAnswers) : renderTextbookAnswer(question.questionAnswerType, question.correctAnswers, question.correctTextualAnswers, true)))));
|
19061
19064
|
});
|
19062
19065
|
};
|
19063
19066
|
var handleToggle = function handleToggle() {
|
@@ -19859,7 +19862,7 @@ var useExamResultData = function useExamResultData(props) {
|
|
19859
19862
|
topAnswerOrder: i.topAnswerOrder == null ? 0 : i.topAnswerOrder
|
19860
19863
|
});
|
19861
19864
|
});
|
19862
|
-
var sortedMySeriesQuestionData = _$
|
19865
|
+
var sortedMySeriesQuestionData = _$8.sortBy(questionsData.filter(function (i) {
|
19863
19866
|
return i.answerOrder !== 0;
|
19864
19867
|
}), ["answerOrder", "questionOrder"]);
|
19865
19868
|
var mySeriesData = [null].concat(sortedMySeriesQuestionData.map(function (item) {
|
@@ -19869,7 +19872,7 @@ var useExamResultData = function useExamResultData(props) {
|
|
19869
19872
|
}).map(function () {
|
19870
19873
|
return null;
|
19871
19874
|
}), [null]);
|
19872
|
-
var sortedTopSeriesQuestionData = _$
|
19875
|
+
var sortedTopSeriesQuestionData = _$8.sortBy(questionsData.filter(function (i) {
|
19873
19876
|
return i.topAnswerOrder !== 0;
|
19874
19877
|
}), ["topAnswerOrder", "questionOrder"]);
|
19875
19878
|
var topSeriesData = [null].concat(sortedTopSeriesQuestionData.map(function (item) {
|
@@ -21838,7 +21841,7 @@ var usePreparedExam = function usePreparedExam(_ref) {
|
|
21838
21841
|
return Promise.reject(e);
|
21839
21842
|
}
|
21840
21843
|
};
|
21841
|
-
var debounceSearch = _$
|
21844
|
+
var debounceSearch = _$8.debounce(function () {
|
21842
21845
|
setTextbookFilter(_extends({}, textbookFilter, {
|
21843
21846
|
currentPage: 1
|
21844
21847
|
}));
|
@@ -23595,7 +23598,7 @@ var PreparedItem = function PreparedItem(_ref) {
|
|
23595
23598
|
});
|
23596
23599
|
return React__default.createElement(formik.Form, {
|
23597
23600
|
style: {
|
23598
|
-
height: !_$
|
23601
|
+
height: !_$8.isEmpty(values) && !textbookList.length ? "100%" : "unset"
|
23599
23602
|
}
|
23600
23603
|
}, React__default.createElement(material.Stack, null, React__default.createElement(material.Accordion, {
|
23601
23604
|
sx: {
|
@@ -24001,7 +24004,7 @@ var PreparedItem = function PreparedItem(_ref) {
|
|
24001
24004
|
open: openConfirmDialog,
|
24002
24005
|
onClose: handleCloseConfirmDialog,
|
24003
24006
|
onSubmit: handleResetFilter
|
24004
|
-
}), !_$
|
24007
|
+
}), !_$8.isEmpty(values) && !textbookList.length && React__default.createElement(material.Stack, {
|
24005
24008
|
height: 1,
|
24006
24009
|
justifyContent: "center",
|
24007
24010
|
alignItems: "center"
|
@@ -25371,7 +25374,7 @@ var useStudentClassList = function useStudentClassList(courseId) {
|
|
25371
25374
|
currentPage: 1
|
25372
25375
|
}));
|
25373
25376
|
};
|
25374
|
-
var debounceSearch = _$
|
25377
|
+
var debounceSearch = _$8.debounce(function () {
|
25375
25378
|
setFilter(_extends({}, filter, {
|
25376
25379
|
currentPage: 1
|
25377
25380
|
}));
|
@@ -25507,7 +25510,7 @@ var useTeacherClassList = function useTeacherClassList(courseId) {
|
|
25507
25510
|
currentPage: 1
|
25508
25511
|
}));
|
25509
25512
|
};
|
25510
|
-
var debounceSearch = _$
|
25513
|
+
var debounceSearch = _$8.debounce(function () {
|
25511
25514
|
setFilter(_extends({}, filter, {
|
25512
25515
|
currentPage: 1
|
25513
25516
|
}));
|
@@ -25820,7 +25823,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
25820
25823
|
});
|
25821
25824
|
}, [JSON.stringify(course)]);
|
25822
25825
|
var convertToRequestBody = function convertToRequestBody(request) {
|
25823
|
-
var localStartDate = _$
|
25826
|
+
var localStartDate = _$8.cloneDeep(request.startDate);
|
25824
25827
|
return _extends({}, request, {
|
25825
25828
|
startDate: request.startDate.utc().format(DATE_TIME_FORMAT),
|
25826
25829
|
endDate: request.endDate.utc().format(DATE_TIME_FORMAT),
|
@@ -26069,13 +26072,13 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
26069
26072
|
});
|
26070
26073
|
if (event.target.checked) {
|
26071
26074
|
setSelected(function (prev) {
|
26072
|
-
return _$
|
26075
|
+
return _$8.uniq([].concat(prev, newSelected));
|
26073
26076
|
});
|
26074
26077
|
return;
|
26075
26078
|
}
|
26076
|
-
setSelected(_$
|
26079
|
+
setSelected(_$8.difference(selected, newSelected));
|
26077
26080
|
};
|
26078
|
-
var debounceSearch = _$
|
26081
|
+
var debounceSearch = _$8.debounce(function () {
|
26079
26082
|
setFilter(_extends({}, filter, {
|
26080
26083
|
currentPage: 1
|
26081
26084
|
}));
|
@@ -26093,7 +26096,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
26093
26096
|
}) : userList.map(function (n) {
|
26094
26097
|
return n.teacherId;
|
26095
26098
|
});
|
26096
|
-
var checkLength = _$
|
26099
|
+
var checkLength = _$8.intersection(selected, newSelected).length;
|
26097
26100
|
return checkLength === userLength;
|
26098
26101
|
};
|
26099
26102
|
var handleClear = function handleClear() {
|
@@ -26128,7 +26131,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
26128
26131
|
}));
|
26129
26132
|
setSelected([]);
|
26130
26133
|
};
|
26131
|
-
var debounceSort = _$
|
26134
|
+
var debounceSort = _$8.debounce(handleSort, 300);
|
26132
26135
|
var handleChangePage = function handleChangePage(_, page) {
|
26133
26136
|
setFilter(_extends({}, filter, {
|
26134
26137
|
currentPage: page
|
@@ -26212,8 +26215,8 @@ var LessonFormBody = function LessonFormBody(_ref) {
|
|
26212
26215
|
React.useEffect(function () {
|
26213
26216
|
if (open && data) formikProp.setValues(data);else formikProp.setValues(DEFAULT_LESSON_REQUEST);
|
26214
26217
|
}, [open, JSON.stringify(data)]);
|
26215
|
-
var maxTime = formikProp.values.endTime ? _$
|
26216
|
-
var minTime = formikProp.values.startTime ? _$
|
26218
|
+
var maxTime = formikProp.values.endTime ? _$8.cloneDeep(formikProp.values.endTime).add(-1, "minutes") : undefined;
|
26219
|
+
var minTime = formikProp.values.startTime ? _$8.cloneDeep(formikProp.values.startTime).add(1, "minutes") : undefined;
|
26217
26220
|
return React__default.createElement(React.Fragment, null, React__default.createElement(material.DialogContent, {
|
26218
26221
|
sx: {
|
26219
26222
|
overflowY: "unset"
|
@@ -26780,7 +26783,7 @@ var useClassList = function useClassList(history, classCreateUrl, classUpdateUrl
|
|
26780
26783
|
currentPage: 1
|
26781
26784
|
}));
|
26782
26785
|
};
|
26783
|
-
var debounceSearch = _$
|
26786
|
+
var debounceSearch = _$8.debounce(function () {
|
26784
26787
|
setClassFilter(_extends({}, classFilter, {
|
26785
26788
|
currentPage: 1
|
26786
26789
|
}));
|
@@ -27904,7 +27907,7 @@ var useUserList = function useUserList(role) {
|
|
27904
27907
|
currentPage: 1
|
27905
27908
|
}));
|
27906
27909
|
};
|
27907
|
-
var debounceSort = _$
|
27910
|
+
var debounceSort = _$8.debounce(handleSort, 300);
|
27908
27911
|
var getUserById = function getUserById(id) {
|
27909
27912
|
try {
|
27910
27913
|
var _temp8 = function _temp8() {
|
@@ -28062,7 +28065,7 @@ var useUserList = function useUserList(role) {
|
|
28062
28065
|
return Promise.reject(e);
|
28063
28066
|
}
|
28064
28067
|
};
|
28065
|
-
var debounceSearch = _$
|
28068
|
+
var debounceSearch = _$8.debounce(function () {
|
28066
28069
|
setFilter(_extends({}, filter, {
|
28067
28070
|
currentPage: 1
|
28068
28071
|
}));
|
@@ -29375,8 +29378,8 @@ var useExamDetailView = function useExamDetailView(props) {
|
|
29375
29378
|
var handleAddArticle = function handleAddArticle() {
|
29376
29379
|
var _$maxBy, _$maxBy2;
|
29377
29380
|
if (!exam) return;
|
29378
|
-
var maxArticle = ((_$maxBy = _$
|
29379
|
-
var maxOrder = ((_$maxBy2 = _$
|
29381
|
+
var maxArticle = ((_$maxBy = _$8.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
|
29382
|
+
var maxOrder = ((_$maxBy2 = _$8.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
|
29380
29383
|
onChangeExam(_extends({}, exam, {
|
29381
29384
|
questions: [].concat(exam.questions, [{
|
29382
29385
|
questionAnswerType: exports.QuestionAnswerType.SingleChoice,
|
@@ -29424,7 +29427,7 @@ var useExamDetailView = function useExamDetailView(props) {
|
|
29424
29427
|
var examGroupByArticle = React.useMemo(function () {
|
29425
29428
|
if (!exam) return [];
|
29426
29429
|
var articles = [];
|
29427
|
-
var groupedArticle = _$
|
29430
|
+
var groupedArticle = _$8.groupBy(exam.questions, "article");
|
29428
29431
|
for (var key in groupedArticle) {
|
29429
29432
|
if (Object.prototype.hasOwnProperty.call(groupedArticle, key)) {
|
29430
29433
|
var _questions$find, _$maxBy3;
|
@@ -29434,13 +29437,13 @@ var useExamDetailView = function useExamDetailView(props) {
|
|
29434
29437
|
categoryId: (_questions$find = questions.find(function (i) {
|
29435
29438
|
return !!i.categoryId;
|
29436
29439
|
})) === null || _questions$find === void 0 ? void 0 : _questions$find.categoryId,
|
29437
|
-
answerCount: ((_$maxBy3 = _$
|
29440
|
+
answerCount: ((_$maxBy3 = _$8.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT,
|
29438
29441
|
questionCount: questions.length,
|
29439
29442
|
questions: questions
|
29440
29443
|
});
|
29441
29444
|
}
|
29442
29445
|
}
|
29443
|
-
return _$
|
29446
|
+
return _$8.sortBy(articles, "article");
|
29444
29447
|
}, [JSON.stringify(exam)]);
|
29445
29448
|
var durationOptions = React.useMemo(function () {
|
29446
29449
|
var options = DURATION_OPTIONS.map(function (i) {
|
@@ -31861,11 +31864,11 @@ var useTextbookShare = function useTextbookShare(props) {
|
|
31861
31864
|
});
|
31862
31865
|
if (event.target.checked) {
|
31863
31866
|
setSelectedShare(function (prev) {
|
31864
|
-
return _$
|
31867
|
+
return _$8.uniq([].concat(prev, newSelected));
|
31865
31868
|
});
|
31866
31869
|
return;
|
31867
31870
|
}
|
31868
|
-
setSelectedShare(_$
|
31871
|
+
setSelectedShare(_$8.difference(selectedShare, newSelected));
|
31869
31872
|
};
|
31870
31873
|
var isCheckAllShare = function isCheckAllShare(userLength) {
|
31871
31874
|
var newSelected = isUpdate ? shared.map(function (n) {
|
@@ -31873,7 +31876,7 @@ var useTextbookShare = function useTextbookShare(props) {
|
|
31873
31876
|
}) : notShared.map(function (n) {
|
31874
31877
|
return n.id;
|
31875
31878
|
});
|
31876
|
-
var checkLength = _$
|
31879
|
+
var checkLength = _$8.intersection(selectedShare, newSelected).length;
|
31877
31880
|
return checkLength === userLength;
|
31878
31881
|
};
|
31879
31882
|
var handleClickCheckboxShare = function handleClickCheckboxShare(id) {
|
@@ -32132,7 +32135,7 @@ var TextbookList = function TextbookList(props) {
|
|
32132
32135
|
handleUpdateSharedTextbook = _useTextbookShare.handleUpdateSharedTextbook,
|
32133
32136
|
currentModel = _useTextbookShare.currentModel;
|
32134
32137
|
var textbookHeaders = React.useMemo(function () {
|
32135
|
-
var headers = _$
|
32138
|
+
var headers = _$8.clone(TEXTBOOK_HEADERS);
|
32136
32139
|
if (isTeacher && isTeacherSite) headers.splice(5, 0, {
|
32137
32140
|
title: "teacher_personal_textbook"
|
32138
32141
|
});
|
@@ -32727,7 +32730,7 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
32727
32730
|
currentPage: 1
|
32728
32731
|
}));
|
32729
32732
|
};
|
32730
|
-
var debounceSearch = _$
|
32733
|
+
var debounceSearch = _$8.debounce(function () {
|
32731
32734
|
setNotificationFilter(_extends({}, notificationFilter, {
|
32732
32735
|
currentPage: 1
|
32733
32736
|
}));
|
@@ -33290,7 +33293,7 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
|
33290
33293
|
return !isTextType(answerType);
|
33291
33294
|
},
|
33292
33295
|
then: function then(schema) {
|
33293
|
-
return schema.min(
|
33296
|
+
return schema.min(1, t("answer_cannot_be_empty"));
|
33294
33297
|
},
|
33295
33298
|
otherwise: function otherwise(schema) {
|
33296
33299
|
return schema.notRequired();
|
@@ -33299,12 +33302,12 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
|
33299
33302
|
score: yup.number().required(),
|
33300
33303
|
questionOrder: yup.number().required(),
|
33301
33304
|
questionTypeId: yup.number().notRequired(),
|
33302
|
-
correctTextualAnswers: yup.array().
|
33305
|
+
correctTextualAnswers: yup.array().when("questionAnswerType", {
|
33303
33306
|
is: function is(answerType) {
|
33304
33307
|
return isTextType(answerType);
|
33305
33308
|
},
|
33306
33309
|
then: function then(schema) {
|
33307
|
-
return schema.min(1, t("
|
33310
|
+
return schema.of(yup.string().trim().required(t("answer_cannot_be_empty"))).min(1, t("answer_cannot_be_empty"));
|
33308
33311
|
},
|
33309
33312
|
otherwise: function otherwise(schema) {
|
33310
33313
|
return schema.notRequired();
|
@@ -33314,7 +33317,7 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
|
33314
33317
|
return isTextType(answerType) && answerType !== exports.QuestionAnswerType.ShortAnswer;
|
33315
33318
|
},
|
33316
33319
|
then: function then(schema) {
|
33317
|
-
return schema.min(2, t("
|
33320
|
+
return schema.of(yup.string().trim().required(t("answer_cannot_be_empty"))).min(2, t("answer_cannot_be_empty"));
|
33318
33321
|
}
|
33319
33322
|
})
|
33320
33323
|
});
|
@@ -33454,7 +33457,7 @@ var CustomTextbookTab = function CustomTextbookTab(props) {
|
|
33454
33457
|
};
|
33455
33458
|
|
33456
33459
|
var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
|
33457
|
-
var values = isMath !== undefined ? _$
|
33460
|
+
var values = isMath !== undefined ? _$8.cloneDeep(textbook) : textbook;
|
33458
33461
|
if (isMath !== undefined) values.type = isMath;
|
33459
33462
|
for (var key in values) {
|
33460
33463
|
if (values.hasOwnProperty(key)) {
|
@@ -33469,7 +33472,7 @@ var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
|
|
33469
33472
|
return values;
|
33470
33473
|
};
|
33471
33474
|
var _resetAllCategoriesAndQuestionTypesBySubject = function resetAllCategoriesAndQuestionTypesBySubject(textbook, subject) {
|
33472
|
-
var values = subject ? _$
|
33475
|
+
var values = subject ? _$8.cloneDeep(textbook) : textbook;
|
33473
33476
|
if (subject) {
|
33474
33477
|
values.subjectId = subject === null || subject === void 0 ? void 0 : subject.value;
|
33475
33478
|
values.subject = subject;
|
@@ -33632,7 +33635,7 @@ var isSequentialQuestionGroups = function isSequentialQuestionGroups(questionGro
|
|
33632
33635
|
return true;
|
33633
33636
|
};
|
33634
33637
|
|
33635
|
-
var _ = _$
|
33638
|
+
var _ = _$8;
|
33636
33639
|
var ArticleBlock = function ArticleBlock(_ref) {
|
33637
33640
|
var errors = _ref.errors,
|
33638
33641
|
expandedIndex = _ref.expandedIndex,
|
@@ -33977,13 +33980,18 @@ var QuestionOrderName = function QuestionOrderName(_ref) {
|
|
33977
33980
|
}));
|
33978
33981
|
};
|
33979
33982
|
|
33983
|
+
var _$1 = _$8;
|
33980
33984
|
var QuestionShortInput = function QuestionShortInput(_ref) {
|
33981
33985
|
var name = _ref.name,
|
33982
33986
|
deletable = _ref.deletable,
|
33987
|
+
errors = _ref.errors,
|
33983
33988
|
onDelete = _ref.onDelete;
|
33984
33989
|
var _useTranslation = reactI18next.useTranslation(),
|
33985
33990
|
t = _useTranslation.t;
|
33986
|
-
|
33991
|
+
var error = _$1.get(errors, name);
|
33992
|
+
return React__default.createElement(material.Stack, {
|
33993
|
+
direction: "column"
|
33994
|
+
}, React__default.createElement(formik.Field, {
|
33987
33995
|
name: name,
|
33988
33996
|
render: function render(_ref2) {
|
33989
33997
|
var field = _ref2.field;
|
@@ -34000,7 +34008,8 @@ var QuestionShortInput = function QuestionShortInput(_ref) {
|
|
34000
34008
|
"& input": {
|
34001
34009
|
paddingRight: deletable ? "40px" : undefined
|
34002
34010
|
}
|
34003
|
-
}
|
34011
|
+
},
|
34012
|
+
error: !!error
|
34004
34013
|
})), deletable && React__default.createElement(material.Stack, {
|
34005
34014
|
justifyContent: "center",
|
34006
34015
|
alignItems: "center",
|
@@ -34022,14 +34031,23 @@ var QuestionShortInput = function QuestionShortInput(_ref) {
|
|
34022
34031
|
size: 12
|
34023
34032
|
})))));
|
34024
34033
|
}
|
34025
|
-
})
|
34034
|
+
}), !!error && React__default.createElement(material.Typography, {
|
34035
|
+
fontWeight: 500,
|
34036
|
+
fontSize: "10px",
|
34037
|
+
lineHeight: "11.93px",
|
34038
|
+
mt: 1,
|
34039
|
+
color: !error ? "#97A1AF" : "#F34B4B"
|
34040
|
+
}, error));
|
34026
34041
|
};
|
34027
34042
|
var isEqual$1 = function isEqual(prev, next) {
|
34028
|
-
|
34043
|
+
var prevError = _$1.get(prev.errors, prev.name);
|
34044
|
+
var nextError = _$1.get(next.errors, next.name);
|
34045
|
+
return JSON.stringify(prevError) === JSON.stringify(nextError) && prev.value === next.value && prev.name == next.name && prev.deletable == next.deletable;
|
34029
34046
|
};
|
34030
34047
|
var QuestionShortInput$1 = React.memo(QuestionShortInput, isEqual$1);
|
34031
34048
|
|
34032
34049
|
var _excluded$h = ["onChange"];
|
34050
|
+
var _$2 = _$8;
|
34033
34051
|
var BpIcon$1 = material.styled("span")(function (_ref) {
|
34034
34052
|
var theme = _ref.theme;
|
34035
34053
|
return {
|
@@ -34060,6 +34078,7 @@ var BpCheckedIcon$1 = material.styled(BpIcon$1)({
|
|
34060
34078
|
}
|
34061
34079
|
});
|
34062
34080
|
var QuestionBlock = function QuestionBlock(_ref2) {
|
34081
|
+
var _data$correctTextualA4;
|
34063
34082
|
var answerCount = _ref2.answerCount,
|
34064
34083
|
isMath = _ref2.isMath,
|
34065
34084
|
disabled = _ref2.disabled,
|
@@ -34069,6 +34088,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34069
34088
|
isLoadingQuestionTypes = _ref2.isLoadingQuestionTypes,
|
34070
34089
|
optionKey = _ref2.optionKey,
|
34071
34090
|
questionTypes = _ref2.questionTypes,
|
34091
|
+
errors = _ref2.errors,
|
34072
34092
|
setFieldValue = _ref2.setFieldValue,
|
34073
34093
|
onCloseQuestionTypeMenu = _ref2.onCloseQuestionTypeMenu,
|
34074
34094
|
onOpenQuestionTypeMenu = _ref2.onOpenQuestionTypeMenu;
|
@@ -34077,7 +34097,8 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34077
34097
|
var theme = material.useTheme();
|
34078
34098
|
var isTabletUp = material.useMediaQuery(theme.breakpoints.up("lg"));
|
34079
34099
|
var handleCheckMultiChoice = function handleCheckMultiChoice(choice) {
|
34080
|
-
var
|
34100
|
+
var _data$correctAnswers;
|
34101
|
+
var updatedAnswers = (_data$correctAnswers = data.correctAnswers) != null ? _data$correctAnswers : [];
|
34081
34102
|
if (updatedAnswers.includes(choice)) {
|
34082
34103
|
updatedAnswers = updatedAnswers.filter(function (item) {
|
34083
34104
|
return item !== choice;
|
@@ -34088,36 +34109,41 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34088
34109
|
setFieldValue(path + ".correctAnswers", updatedAnswers);
|
34089
34110
|
};
|
34090
34111
|
var handleAddTextualAnswer = function handleAddTextualAnswer() {
|
34091
|
-
|
34092
|
-
setFieldValue(path + ".
|
34112
|
+
var _data$correctTextualA, _data$correctTextualA2;
|
34113
|
+
((_data$correctTextualA = data.correctTextualAnswers) === null || _data$correctTextualA === void 0 ? void 0 : _data$correctTextualA.length) === 1 && setFieldValue(path + ".questionAnswerType", exports.QuestionAnswerType.OrderMatters);
|
34114
|
+
setFieldValue(path + ".correctTextualAnswers", [].concat((_data$correctTextualA2 = data.correctTextualAnswers) != null ? _data$correctTextualA2 : [], [""]));
|
34093
34115
|
};
|
34094
34116
|
var handleRemoveTextualAnswer = function handleRemoveTextualAnswer(remove, index) {
|
34095
|
-
|
34117
|
+
var _data$correctTextualA3;
|
34118
|
+
((_data$correctTextualA3 = data.correctTextualAnswers) === null || _data$correctTextualA3 === void 0 ? void 0 : _data$correctTextualA3.length) === 2 && setFieldValue(path + ".questionAnswerType", exports.QuestionAnswerType.ShortAnswer);
|
34096
34119
|
remove(index);
|
34097
34120
|
};
|
34098
34121
|
var handleChangeQuestionAnswerType = function handleChangeQuestionAnswerType(value) {
|
34099
34122
|
switch (value === null || value === void 0 ? void 0 : value.value) {
|
34100
34123
|
case exports.QuestionAnswerType.SingleChoice:
|
34101
34124
|
case exports.QuestionAnswerType.MultipleChoice:
|
34102
|
-
setFieldValue(path + ".correctTextualAnswers",
|
34125
|
+
setFieldValue(path + ".correctTextualAnswers", null);
|
34126
|
+
if (!data.correctAnswers || data.correctAnswers.length === 0) setFieldValue(path + ".correctAnswers", [1]);
|
34103
34127
|
break;
|
34104
34128
|
default:
|
34105
|
-
if (data.correctTextualAnswers.length === 0) setFieldValue(path + ".correctTextualAnswers", [""]);
|
34129
|
+
if (!data.correctTextualAnswers || data.correctTextualAnswers.length === 0) setFieldValue(path + ".correctTextualAnswers", [""]);
|
34130
|
+
setFieldValue(path + ".correctAnswers", null);
|
34106
34131
|
break;
|
34107
34132
|
}
|
34108
|
-
setFieldValue(path + ".questionAnswerType", (value === null || value === void 0 ? void 0 : value.value) ||
|
34133
|
+
setFieldValue(path + ".questionAnswerType", (value === null || value === void 0 ? void 0 : value.value) || exports.QuestionAnswerType.SingleChoice);
|
34109
34134
|
};
|
34110
34135
|
var handleChangeCompareType = function handleChangeCompareType(_, value) {
|
34111
|
-
setFieldValue(path + ".questionAnswerType", Number(value) ||
|
34136
|
+
setFieldValue(path + ".questionAnswerType", Number(value) || exports.QuestionAnswerType.OrderMatters);
|
34112
34137
|
};
|
34113
34138
|
var handleOpenQuestionTypeMenu = function handleOpenQuestionTypeMenu() {
|
34114
34139
|
onOpenQuestionTypeMenu(path + ".questionTypeId");
|
34115
34140
|
};
|
34116
|
-
var isIncomplatedTextualAnswers = data.correctTextualAnswers.some(function (i) {
|
34117
|
-
return !i.trim();
|
34118
|
-
});
|
34119
34141
|
var isTextAnswerType = isTextType(data.questionAnswerType);
|
34142
|
+
var isIncomplatedTextualAnswers = isTextAnswerType && ((_data$correctTextualA4 = data.correctTextualAnswers) === null || _data$correctTextualA4 === void 0 ? void 0 : _data$correctTextualA4.some(function (i) {
|
34143
|
+
return !i.trim();
|
34144
|
+
}));
|
34120
34145
|
var renderAnswer = function renderAnswer() {
|
34146
|
+
var _data$correctAnswers3;
|
34121
34147
|
switch (data.questionAnswerType) {
|
34122
34148
|
case exports.QuestionAnswerType.ShortAnswer:
|
34123
34149
|
case exports.QuestionAnswerType.SynonymProcessing:
|
@@ -34126,6 +34152,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34126
34152
|
return React__default.createElement(formik.FieldArray, {
|
34127
34153
|
name: path + ".correctTextualAnswers"
|
34128
34154
|
}, function (_ref3) {
|
34155
|
+
var _data$correctTextualA5;
|
34129
34156
|
var remove = _ref3.remove;
|
34130
34157
|
return React__default.createElement(material.Stack, {
|
34131
34158
|
sx: {
|
@@ -34139,18 +34166,19 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34139
34166
|
gap: "12px",
|
34140
34167
|
flexWrap: "wrap"
|
34141
34168
|
}, React__default.createElement(ListView, {
|
34142
|
-
data: data.correctTextualAnswers,
|
34169
|
+
data: (_data$correctTextualA5 = data.correctTextualAnswers) != null ? _data$correctTextualA5 : [],
|
34143
34170
|
render: function render(_, index) {
|
34144
34171
|
return React__default.createElement(material.Box, {
|
34145
34172
|
key: index,
|
34146
34173
|
minWidth: "200px"
|
34147
34174
|
}, React__default.createElement(QuestionShortInput$1, {
|
34175
|
+
errors: errors,
|
34148
34176
|
value: data.correctTextualAnswers[index],
|
34149
34177
|
name: path + ".correctTextualAnswers[" + index + "]",
|
34150
34178
|
onDelete: function onDelete() {
|
34151
34179
|
return handleRemoveTextualAnswer(remove, index);
|
34152
34180
|
},
|
34153
|
-
deletable: data.correctTextualAnswers.length > 1
|
34181
|
+
deletable: data.correctTextualAnswers && data.correctTextualAnswers.length > 1
|
34154
34182
|
}));
|
34155
34183
|
}
|
34156
34184
|
})));
|
@@ -34165,6 +34193,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34165
34193
|
}, function (_, i) {
|
34166
34194
|
return i + 1;
|
34167
34195
|
}).map(function (i) {
|
34196
|
+
var _data$correctAnswers2;
|
34168
34197
|
return React__default.createElement(material.FormControlLabel, {
|
34169
34198
|
key: i,
|
34170
34199
|
className: styles$a["question-label"] + " w-fit",
|
@@ -34172,7 +34201,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34172
34201
|
value: i,
|
34173
34202
|
disabled: disabled,
|
34174
34203
|
control: React__default.createElement(material.Checkbox, {
|
34175
|
-
checked: data.correctAnswers.includes(i),
|
34204
|
+
checked: (_data$correctAnswers2 = data.correctAnswers) === null || _data$correctAnswers2 === void 0 ? void 0 : _data$correctAnswers2.includes(i),
|
34176
34205
|
onChange: function onChange(e) {
|
34177
34206
|
return handleCheckMultiChoice(+e.target.value);
|
34178
34207
|
}
|
@@ -34190,7 +34219,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34190
34219
|
}, React__default.createElement(material.FormControl, {
|
34191
34220
|
className: "flex-grow-1 w-100"
|
34192
34221
|
}, React__default.createElement(material.RadioGroup, {
|
34193
|
-
value: data.correctAnswers[0],
|
34222
|
+
value: (_data$correctAnswers3 = data.correctAnswers) === null || _data$correctAnswers3 === void 0 ? void 0 : _data$correctAnswers3[0],
|
34194
34223
|
name: "answers",
|
34195
34224
|
className: "flex-row w-100"
|
34196
34225
|
}, Array.from({
|
@@ -34198,6 +34227,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34198
34227
|
}, function (_, i) {
|
34199
34228
|
return i + 1;
|
34200
34229
|
}).map(function (i) {
|
34230
|
+
var _data$correctAnswers4;
|
34201
34231
|
return React__default.createElement(material.FormControlLabel, {
|
34202
34232
|
key: i,
|
34203
34233
|
className: styles$a["question-label"] + " w-fit",
|
@@ -34209,7 +34239,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34209
34239
|
disabled: disabled,
|
34210
34240
|
control: React__default.createElement(material.Radio, {
|
34211
34241
|
size: "small",
|
34212
|
-
checked: +i === data.correctAnswers[0],
|
34242
|
+
checked: +i === ((_data$correctAnswers4 = data.correctAnswers) === null || _data$correctAnswers4 === void 0 ? void 0 : _data$correctAnswers4[0]),
|
34213
34243
|
checkedIcon: React__default.createElement(BpCheckedIcon$1, null),
|
34214
34244
|
icon: React__default.createElement(BpIcon$1, null)
|
34215
34245
|
}),
|
@@ -34257,7 +34287,7 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34257
34287
|
questionTitleStyle: questionTitleStyle
|
34258
34288
|
})), React__default.createElement(material.Box, {
|
34259
34289
|
flexGrow: 1
|
34260
|
-
}, data.correctTextualAnswers.length > 1 && React__default.createElement(material.Box, null, React__default.createElement(QuestionCompareType, {
|
34290
|
+
}, data.correctTextualAnswers && data.correctTextualAnswers.length > 1 && React__default.createElement(material.Box, null, React__default.createElement(QuestionCompareType, {
|
34261
34291
|
value: data.questionAnswerType,
|
34262
34292
|
onChange: handleChangeCompareType
|
34263
34293
|
})), renderAnswer())), React__default.createElement(material.Stack, {
|
@@ -34362,6 +34392,8 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34362
34392
|
})))));
|
34363
34393
|
};
|
34364
34394
|
var isEqual$2 = function isEqual(prev, next) {
|
34395
|
+
var prevError = _$2.get(prev.errors, prev.path);
|
34396
|
+
var nextError = _$2.get(next.errors, next.path);
|
34365
34397
|
var isPrevMatched = prev.optionKey === prev.path + ".questionTypeId";
|
34366
34398
|
var isNextMatched = next.optionKey === next.path + ".questionTypeId";
|
34367
34399
|
var prevOptionKey = isPrevMatched ? prev.optionKey : undefined;
|
@@ -34370,12 +34402,12 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
34370
34402
|
var nextIsLoadingQuestionTypes = isNextMatched ? next.isLoadingQuestionTypes : undefined;
|
34371
34403
|
var prevQuestionTypes = isPrevMatched ? prev.questionTypes : undefined;
|
34372
34404
|
var nextQuestionTypes = isNextMatched ? next.questionTypes : undefined;
|
34373
|
-
return prevOptionKey === nextOptionKey && prevIsLoadingQuestionTypes === nextIsLoadingQuestionTypes && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevQuestionTypes) === JSON.stringify(nextQuestionTypes) && prev.path === next.path && prev.isMath == next.isMath && prev.answerCount == next.answerCount && prev.disabled == next.disabled && JSON.stringify(prev.questionTitleStyle) === JSON.stringify(next.questionTitleStyle) && prev.onOpenQuestionTypeMenu == next.onOpenQuestionTypeMenu;
|
34405
|
+
return JSON.stringify(prevError) === JSON.stringify(nextError) && prevOptionKey === nextOptionKey && prevIsLoadingQuestionTypes === nextIsLoadingQuestionTypes && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevQuestionTypes) === JSON.stringify(nextQuestionTypes) && prev.path === next.path && prev.isMath == next.isMath && prev.answerCount == next.answerCount && prev.disabled == next.disabled && JSON.stringify(prev.questionTitleStyle) === JSON.stringify(next.questionTitleStyle) && prev.onOpenQuestionTypeMenu == next.onOpenQuestionTypeMenu;
|
34374
34406
|
};
|
34375
34407
|
var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$2);
|
34376
34408
|
|
34377
34409
|
var _excluded$i = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
34378
|
-
var _$
|
34410
|
+
var _$3 = _$8;
|
34379
34411
|
var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
34380
34412
|
var _data$articles$3, _data$articles$3$cate, _data$articles$4, _data$articles$4$cate, _questions$2;
|
34381
34413
|
var data = _ref.data,
|
@@ -34400,13 +34432,12 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
34400
34432
|
var startOrderRef = React.useRef(null);
|
34401
34433
|
var articles = data.articles,
|
34402
34434
|
questions = data.questions;
|
34403
|
-
var blockErrors = _$
|
34404
|
-
console.log(path + ": ", blockErrors);
|
34435
|
+
var blockErrors = _$3.get(errors, path);
|
34405
34436
|
var handleOpenQuestionTypeMenu = React.useCallback(function (key) {
|
34406
34437
|
var _data$articles$, _data$articles$$categ, _data$articles$2, _data$articles$2$cate;
|
34407
34438
|
onOpenQuestionTypeMenu(key, (_data$articles$ = data.articles[0]) === null || _data$articles$ === void 0 ? void 0 : (_data$articles$$categ = _data$articles$.categories) === null || _data$articles$$categ === void 0 ? void 0 : _data$articles$$categ[0], (_data$articles$2 = data.articles[0]) === null || _data$articles$2 === void 0 ? void 0 : (_data$articles$2$cate = _data$articles$2.categories) === null || _data$articles$2$cate === void 0 ? void 0 : _data$articles$2$cate[1]);
|
34408
34439
|
}, [(_data$articles$3 = data.articles[0]) === null || _data$articles$3 === void 0 ? void 0 : (_data$articles$3$cate = _data$articles$3.categories) === null || _data$articles$3$cate === void 0 ? void 0 : _data$articles$3$cate[0], (_data$articles$4 = data.articles[0]) === null || _data$articles$4 === void 0 ? void 0 : (_data$articles$4$cate = _data$articles$4.categories) === null || _data$articles$4$cate === void 0 ? void 0 : _data$articles$4$cate[1]]);
|
34409
|
-
var debounceQuestionStartOrderChange = _$
|
34440
|
+
var debounceQuestionStartOrderChange = _$3.debounce(onQuestioStartOrderChange, 300);
|
34410
34441
|
var handleChangeStartQuestionOrder = function handleChangeStartQuestionOrder(e) {
|
34411
34442
|
var value = e.target.value.replace(/\D/g, '');
|
34412
34443
|
var order = +value;
|
@@ -34518,8 +34549,8 @@ var isEqual$3 = function isEqual(prev, next) {
|
|
34518
34549
|
var isNextMatched = next.optionKey.startsWith(next.path);
|
34519
34550
|
var prevOptionKey = isPrevMatched ? prev.optionKey : undefined;
|
34520
34551
|
var nextOptionKey = isNextMatched ? next.optionKey : undefined;
|
34521
|
-
var prevBlockErrors = _$
|
34522
|
-
var nextBlockErrors = _$
|
34552
|
+
var prevBlockErrors = _$3.get(prev.errors, prev.path);
|
34553
|
+
var nextBlockErrors = _$3.get(next.errors, next.path);
|
34523
34554
|
var prevIsLoadingCategories = isPrevMatched ? prev.isLoadingCategories : undefined;
|
34524
34555
|
var nextIsLoadingCategories = isNextMatched ? next.isLoadingCategories : undefined;
|
34525
34556
|
var prevCategories = isPrevMatched ? prev.categories : undefined;
|
@@ -34539,7 +34570,7 @@ var isEqual$3 = function isEqual(prev, next) {
|
|
34539
34570
|
var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$3);
|
34540
34571
|
|
34541
34572
|
var _excluded$j = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "disabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
34542
|
-
var _$
|
34573
|
+
var _$4 = _$8;
|
34543
34574
|
var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
34544
34575
|
var _data$articles$3, _data$articles$3$cate, _data$articles$3$cate2, _data$articles$4, _data$articles$4$cate, _data$articles$4$cate2;
|
34545
34576
|
var expandedIndex = _ref.expandedIndex,
|
@@ -34612,9 +34643,11 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
34612
34643
|
}));
|
34613
34644
|
} else {
|
34614
34645
|
setFieldValue(path + ".questions", questions.map(function (q) {
|
34615
|
-
var correctAnswers
|
34646
|
+
var _q$correctAnswers$fil, _q$correctAnswers;
|
34647
|
+
if (isTextType(q.questionAnswerType)) return _extends({}, q);
|
34648
|
+
var correctAnswers = (_q$correctAnswers$fil = (_q$correctAnswers = q.correctAnswers) === null || _q$correctAnswers === void 0 ? void 0 : _q$correctAnswers.filter(function (i) {
|
34616
34649
|
return i <= newAnswerCount;
|
34617
|
-
});
|
34650
|
+
})) != null ? _q$correctAnswers$fil : [1];
|
34618
34651
|
if (correctAnswers.length === 0) correctAnswers = [1];
|
34619
34652
|
return _extends({}, q, {
|
34620
34653
|
numberOfAnswers: newAnswerCount,
|
@@ -34664,10 +34697,10 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
34664
34697
|
}).join(",") : ""].filter(function (i) {
|
34665
34698
|
return !!i;
|
34666
34699
|
}).join(" / ");
|
34667
|
-
var pageFromError = _$
|
34668
|
-
var pageToError = _$
|
34669
|
-
var categoryError = _$
|
34670
|
-
var blockErrors = _$
|
34700
|
+
var pageFromError = _$4.get(errors, path + ".pageFrom");
|
34701
|
+
var pageToError = _$4.get(errors, path + ".pageTo");
|
34702
|
+
var categoryError = _$4.get(errors, path + ".articles[0].categories");
|
34703
|
+
var blockErrors = _$4.get(errors, path);
|
34671
34704
|
return React__default.createElement(material.Accordion, {
|
34672
34705
|
expanded: open,
|
34673
34706
|
onChange: handleToggle,
|
@@ -35224,7 +35257,7 @@ var ChapterBlockBody = function ChapterBlockBody(_ref) {
|
|
35224
35257
|
};
|
35225
35258
|
|
35226
35259
|
var _excluded$l = ["data", "expandedIndex", "open", "path", "paths", "isMath", "isLoadingCategories", "isLoadingQuestionTypes", "categories", "questionTypes", "optionKey", "disabled", "onToggle", "onDelete", "onCopiedPrevQuestionGroup", "onCloseCategoryMenu", "onOpenCategoryMenu", "onOpenSubCategoryMenu", "onOpenQuestionTypeMenu", "onCloseQuestionTypeMenu"];
|
35227
|
-
var _$
|
35260
|
+
var _$5 = _$8;
|
35228
35261
|
var ChapterBlock = function ChapterBlock(_ref) {
|
35229
35262
|
var data = _ref.data,
|
35230
35263
|
expandedIndex = _ref.expandedIndex,
|
@@ -35264,10 +35297,10 @@ var ChapterBlock = function ChapterBlock(_ref) {
|
|
35264
35297
|
chapter: title
|
35265
35298
|
}), title, path.replace(/\[(\d+)\]$/, ""), expandedIndex);
|
35266
35299
|
};
|
35267
|
-
var pageNameError = _$
|
35268
|
-
var pageFromError = _$
|
35269
|
-
var pageToError = _$
|
35270
|
-
var blockErrors = _$
|
35300
|
+
var pageNameError = _$5.get(errors, path + ".name");
|
35301
|
+
var pageFromError = _$5.get(errors, path + ".pageFrom");
|
35302
|
+
var pageToError = _$5.get(errors, path + ".pageTo");
|
35303
|
+
var blockErrors = _$5.get(errors, path);
|
35271
35304
|
return React__default.createElement(material.Accordion, {
|
35272
35305
|
expanded: open,
|
35273
35306
|
onChange: handleToggle,
|
@@ -35615,7 +35648,7 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
|
|
35615
35648
|
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.academyDomain;
|
35616
35649
|
});
|
35617
35650
|
var getOptionFilter = function getOptionFilter() {
|
35618
|
-
var cloneFilter = _$
|
35651
|
+
var cloneFilter = _$8.clone(filter);
|
35619
35652
|
for (var key in cloneFilter) {
|
35620
35653
|
if (Object.prototype.hasOwnProperty.call(cloneFilter, key)) {
|
35621
35654
|
var element = cloneFilter[key];
|
@@ -35765,7 +35798,7 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
|
|
35765
35798
|
};
|
35766
35799
|
};
|
35767
35800
|
|
35768
|
-
var _$
|
35801
|
+
var _$6 = _$8;
|
35769
35802
|
var TextbookContentsTab = function TextbookContentsTab(props) {
|
35770
35803
|
var disabled = props.disabled,
|
35771
35804
|
values = props.values,
|
@@ -35808,7 +35841,7 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
35808
35841
|
};
|
35809
35842
|
var handleConfirmDeleteBlock = function handleConfirmDeleteBlock() {
|
35810
35843
|
if (!(openConfirmDelete !== null && openConfirmDelete !== void 0 && openConfirmDelete.path)) return;
|
35811
|
-
var items = _$
|
35844
|
+
var items = _$6.get(values, openConfirmDelete.path, []);
|
35812
35845
|
setFieldValue(openConfirmDelete.path, items.filter(function (_, i) {
|
35813
35846
|
return i !== openConfirmDelete.itemIndex;
|
35814
35847
|
}));
|
@@ -35848,12 +35881,12 @@ var TextbookContentsTab = function TextbookContentsTab(props) {
|
|
35848
35881
|
if (!newParts.length) return;
|
35849
35882
|
if (newParts.length < parts.length) {
|
35850
35883
|
var _$get, _$get2, _$get3;
|
35851
|
-
var subChapters = (_$get = _$
|
35884
|
+
var subChapters = (_$get = _$6.get(values, newPath + ".subChapters")) != null ? _$get : [];
|
35852
35885
|
var questionGroups = [];
|
35853
|
-
if (!subChapters.length) questionGroups = (_$get2 = _$
|
35854
|
-
return _$
|
35886
|
+
if (!subChapters.length) questionGroups = (_$get2 = _$6.get(values, newPath + ".questionGroups")) != null ? _$get2 : [];else questionGroups = (_$get3 = _$6.get(values, newPath + ".subChapters[" + (subChapters.length - 1) + "].questionGroups")) != null ? _$get3 : [];
|
35887
|
+
return _$6.last(questionGroups);
|
35855
35888
|
}
|
35856
|
-
return _$
|
35889
|
+
return _$6.get(values, newPath);
|
35857
35890
|
};
|
35858
35891
|
var handleOpenSubCategoryMenu = React.useCallback(function (key, categoryId) {
|
35859
35892
|
setOptionKey(key);
|
@@ -36345,7 +36378,7 @@ var useSelect = function useSelect(_ref) {
|
|
36345
36378
|
setLoading = _useState2[1];
|
36346
36379
|
React.useEffect(function () {
|
36347
36380
|
if (!email || !academy) return;
|
36348
|
-
var fetchData = _$
|
36381
|
+
var fetchData = _$8.debounce(function () {
|
36349
36382
|
try {
|
36350
36383
|
var _temp2 = function _temp2() {
|
36351
36384
|
setLoading(false);
|
@@ -36459,7 +36492,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
|
|
36459
36492
|
}, errors === null || errors === void 0 ? void 0 : errors.textbookOwners[index].courseId)));
|
36460
36493
|
};
|
36461
36494
|
|
36462
|
-
var _$
|
36495
|
+
var _$7 = _$8;
|
36463
36496
|
var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
36464
36497
|
var errors = _ref.errors,
|
36465
36498
|
values = _ref.values,
|
@@ -36532,12 +36565,12 @@ var TextbookOwnersTab = function TextbookOwnersTab(_ref) {
|
|
36532
36565
|
disabled: disabled || !!val.academyId && val.academyId !== (academy === null || academy === void 0 ? void 0 : academy.id)
|
36533
36566
|
}));
|
36534
36567
|
}
|
36535
|
-
}), _$
|
36568
|
+
}), _$7.get(errors, "textbookOwners[" + index + "].email") && React__default.createElement(material.Typography, {
|
36536
36569
|
fontWeight: 500,
|
36537
36570
|
fontSize: "10px",
|
36538
36571
|
lineHeight: "11.93px",
|
36539
36572
|
color: "#F34B4B"
|
36540
|
-
}, _$
|
36573
|
+
}, _$7.get(errors, "textbookOwners[" + index + "].email"))), !!(values !== null && values !== void 0 && (_values$textbookOwner = values.textbookOwners) !== null && _values$textbookOwner !== void 0 && _values$textbookOwner[index].email) && React__default.createElement(OwnerSelector, {
|
36541
36574
|
values: values,
|
36542
36575
|
errors: errors,
|
36543
36576
|
index: index,
|
@@ -36715,7 +36748,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
36715
36748
|
variant: "contained",
|
36716
36749
|
disabled: disabled,
|
36717
36750
|
onClick: function onClick() {
|
36718
|
-
if (!_$
|
36751
|
+
if (!_$8.isEmpty(errors)) {
|
36719
36752
|
reactToastify.toast.error(i18n.t("please_fill_in_the_blank_fields"));
|
36720
36753
|
}
|
36721
36754
|
},
|