touchstudy-core 0.1.147 → 0.1.149
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/QuestionCompareType.d.ts +8 -0
- package/dist/containers/PreparedTextbook/components/QuestionOrderName.d.ts +9 -0
- package/dist/containers/PreparedTextbook/components/QuestionScore.d.ts +9 -0
- package/dist/containers/PreparedTextbook/components/QuestionShortInput.d.ts +9 -0
- package/dist/containers/PreparedTextbook/configs/constants.d.ts +6 -4
- package/dist/containers/PreparedTextbook/configs/functions.d.ts +4 -5
- package/dist/containers/PreparedTextbook/configs/types.d.ts +2 -2
- package/dist/index.js +415 -153
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +416 -155
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/enums/examStatus.d.ts +4 -1
- package/dist/utils/enums/index.d.ts +2 -2
- package/dist/utils/functions/index.d.ts +1 -0
- package/dist/utils/functions/questions.d.ts +2 -0
- package/dist/utils/types/examResults.d.ts +4 -2
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -41,7 +41,7 @@ import CardActions from '@mui/material/CardActions';
|
|
41
41
|
import CardContent from '@mui/material/CardContent';
|
42
42
|
import CardMedia from '@mui/material/CardMedia';
|
43
43
|
import MButton from '@mui/material/Button';
|
44
|
-
import { object, string, number, date as date$2, array } from 'yup';
|
44
|
+
import { object, string, number, date as date$2, array, mixed } from 'yup';
|
45
45
|
import { blue, yellow as yellow$1 } from '@mui/material/colors';
|
46
46
|
import { GoogleReCaptcha, GoogleReCaptchaProvider } from 'react-google-recaptcha-v3';
|
47
47
|
import { MdVisibilityOff, MdVisibility, MdAutorenew, MdMoreHoriz, MdDownload, MdExpandMore } from 'react-icons/md';
|
@@ -1473,6 +1473,10 @@ var today_specific_class = "오늘의 특별 수업";
|
|
1473
1473
|
var n_lesson = "{{total}}개의 수업";
|
1474
1474
|
var exam_results = "시험 결과";
|
1475
1475
|
var textbook_results = "교과서 결과";
|
1476
|
+
var order_matters = "순서 상관 있음";
|
1477
|
+
var order_does_not_matter = "순서 상관 없음";
|
1478
|
+
var synonym_processing = "답 이음동의어 처리";
|
1479
|
+
var compare_type = "비교 유형";
|
1476
1480
|
var lang_ko = {
|
1477
1481
|
problem_solving: problem_solving,
|
1478
1482
|
my_story: my_story,
|
@@ -2579,7 +2583,11 @@ var lang_ko = {
|
|
2579
2583
|
today_specific_class: today_specific_class,
|
2580
2584
|
n_lesson: n_lesson,
|
2581
2585
|
exam_results: exam_results,
|
2582
|
-
textbook_results: textbook_results
|
2586
|
+
textbook_results: textbook_results,
|
2587
|
+
order_matters: order_matters,
|
2588
|
+
order_does_not_matter: order_does_not_matter,
|
2589
|
+
synonym_processing: synonym_processing,
|
2590
|
+
compare_type: compare_type
|
2583
2591
|
};
|
2584
2592
|
|
2585
2593
|
var problem_solving$1 = "Problem Solving";
|
@@ -3709,6 +3717,10 @@ var today_specific_class$1 = "Today's specific class";
|
|
3709
3717
|
var n_lesson$1 = "{{total}} lesson(s)";
|
3710
3718
|
var exam_results$1 = "Exam results";
|
3711
3719
|
var textbook_results$1 = "Textbook results";
|
3720
|
+
var order_matters$1 = "Order matters";
|
3721
|
+
var order_does_not_matter$1 = "Order doesn't matter";
|
3722
|
+
var synonym_processing$1 = "Answer Synonym processing";
|
3723
|
+
var compare_type$1 = "Compare Type";
|
3712
3724
|
var lang_en = {
|
3713
3725
|
problem_solving: problem_solving$1,
|
3714
3726
|
my_story: my_story$1,
|
@@ -4817,7 +4829,11 @@ var lang_en = {
|
|
4817
4829
|
today_specific_class: today_specific_class$1,
|
4818
4830
|
n_lesson: n_lesson$1,
|
4819
4831
|
exam_results: exam_results$1,
|
4820
|
-
textbook_results: textbook_results$1
|
4832
|
+
textbook_results: textbook_results$1,
|
4833
|
+
order_matters: order_matters$1,
|
4834
|
+
order_does_not_matter: order_does_not_matter$1,
|
4835
|
+
synonym_processing: synonym_processing$1,
|
4836
|
+
compare_type: compare_type$1
|
4821
4837
|
};
|
4822
4838
|
|
4823
4839
|
i18n.use(initReactI18next).init({
|
@@ -6166,6 +6182,9 @@ var QuestionAnswerType;
|
|
6166
6182
|
QuestionAnswerType[QuestionAnswerType["SingleChoice"] = 0] = "SingleChoice";
|
6167
6183
|
QuestionAnswerType[QuestionAnswerType["MultipleChoice"] = 1] = "MultipleChoice";
|
6168
6184
|
QuestionAnswerType[QuestionAnswerType["ShortAnswer"] = 2] = "ShortAnswer";
|
6185
|
+
QuestionAnswerType[QuestionAnswerType["OrderMatters"] = 3] = "OrderMatters";
|
6186
|
+
QuestionAnswerType[QuestionAnswerType["OrderDoesNotMatters"] = 4] = "OrderDoesNotMatters";
|
6187
|
+
QuestionAnswerType[QuestionAnswerType["SynonymProcessing"] = 5] = "SynonymProcessing";
|
6169
6188
|
})(QuestionAnswerType || (QuestionAnswerType = {}));
|
6170
6189
|
|
6171
6190
|
var OrderType;
|
@@ -6592,6 +6611,10 @@ var getRole = function getRole(roles) {
|
|
6592
6611
|
return null;
|
6593
6612
|
};
|
6594
6613
|
|
6614
|
+
var isTextType = function isTextType(type) {
|
6615
|
+
return type === QuestionAnswerType.ShortAnswer || type === QuestionAnswerType.OrderMatters || type === QuestionAnswerType.OrderDoesNotMatters || type === QuestionAnswerType.SynonymProcessing;
|
6616
|
+
};
|
6617
|
+
|
6595
6618
|
var useAutoAcademyDomain = function useAutoAcademyDomain(_, history, superUrls, homeUrl, homeAcademyUrl, isAuthPage) {
|
6596
6619
|
if (isAuthPage === void 0) {
|
6597
6620
|
isAuthPage = true;
|
@@ -17435,6 +17458,24 @@ var CompareGrass = function CompareGrass(_ref2) {
|
|
17435
17458
|
var effectSize = _ref2.effectSize;
|
17436
17459
|
var _useTranslation = useTranslation(),
|
17437
17460
|
t = _useTranslation.t;
|
17461
|
+
var renderTextbookAnswer = function renderTextbookAnswer(type, answers, textualAnswers, isCorrect) {
|
17462
|
+
var _textualAnswers$;
|
17463
|
+
switch (type) {
|
17464
|
+
case QuestionAnswerType.ShortAnswer:
|
17465
|
+
case QuestionAnswerType.SynonymProcessing:
|
17466
|
+
return isCorrect ? textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(" | ") : (_textualAnswers$ = textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers[0]) != null ? _textualAnswers$ : "";
|
17467
|
+
case QuestionAnswerType.SingleChoice:
|
17468
|
+
case QuestionAnswerType.MultipleChoice:
|
17469
|
+
if (!(answers !== null && answers !== void 0 && answers.length)) return "";
|
17470
|
+
return answers.map(function (i) {
|
17471
|
+
return t("number_question", {
|
17472
|
+
number: i
|
17473
|
+
});
|
17474
|
+
}).join(",");
|
17475
|
+
default:
|
17476
|
+
return textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(", ");
|
17477
|
+
}
|
17478
|
+
};
|
17438
17479
|
var renderAnswer = function renderAnswer(type, content) {
|
17439
17480
|
var _content$split, _content$split$map;
|
17440
17481
|
if (!content) return "";
|
@@ -17472,19 +17513,21 @@ var CompareGrass = function CompareGrass(_ref2) {
|
|
17472
17513
|
}, t("problem"), " ", item.questionOrder + 1), React__default.createElement("td", {
|
17473
17514
|
style: {
|
17474
17515
|
textAlign: "center",
|
17475
|
-
color: "#202B37"
|
17516
|
+
color: "#202B37",
|
17517
|
+
maxWidth: "30%"
|
17476
17518
|
}
|
17477
|
-
},
|
17519
|
+
}, typeof item.correctAnswers === "string" ? renderAnswer(item.questionAnswerType, item.correctAnswers) : renderTextbookAnswer(item.questionAnswerType, item.correctAnswers, item.correctTextualAnswers, true)), React__default.createElement("td", {
|
17478
17520
|
className: styles$4["tdcolumn3"],
|
17479
17521
|
style: {
|
17480
|
-
color: item.isCorrect ? styles$4.green_support_900 : styles$4.red_900
|
17522
|
+
color: item.isCorrect ? styles$4.green_support_900 : styles$4.red_900,
|
17523
|
+
maxWidth: "30%"
|
17481
17524
|
}
|
17482
|
-
},
|
17525
|
+
}, typeof item.selectedAnswers === "string" ? renderAnswer(item.questionAnswerType, item.selectedAnswers) : renderTextbookAnswer(item.questionAnswerType, item.selectedAnswers, item.textualAnswers)), React__default.createElement("td", {
|
17483
17526
|
style: {
|
17484
17527
|
textAlign: "center",
|
17485
17528
|
color: "#414E62"
|
17486
17529
|
}
|
17487
|
-
}, renderAnswer(item
|
17530
|
+
}, renderAnswer(item.questionAnswerType, item.mostSelectedAnswers)), React__default.createElement("td", {
|
17488
17531
|
className: "" + printStyles["avoid-break-inside"]
|
17489
17532
|
}, React__default.createElement("div", {
|
17490
17533
|
className: styles$4["classification"] + " " + printStyles["avoid-break-inside"]
|
@@ -17851,6 +17894,24 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
17851
17894
|
return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
|
17852
17895
|
}).slice(0, limitQuestions);
|
17853
17896
|
}, [JSON.stringify(data.questions)]);
|
17897
|
+
var renderTextbookAnswer = function renderTextbookAnswer(type, answers, textualAnswers, isCorrect) {
|
17898
|
+
var _textualAnswers$;
|
17899
|
+
switch (type) {
|
17900
|
+
case QuestionAnswerType.ShortAnswer:
|
17901
|
+
case QuestionAnswerType.SynonymProcessing:
|
17902
|
+
return isCorrect ? textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(" | ") : (_textualAnswers$ = textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers[0]) != null ? _textualAnswers$ : "";
|
17903
|
+
case QuestionAnswerType.SingleChoice:
|
17904
|
+
case QuestionAnswerType.MultipleChoice:
|
17905
|
+
if (!(answers !== null && answers !== void 0 && answers.length)) return "";
|
17906
|
+
return answers.map(function (i) {
|
17907
|
+
return t("number_question", {
|
17908
|
+
number: i
|
17909
|
+
});
|
17910
|
+
}).join(",");
|
17911
|
+
default:
|
17912
|
+
return textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(", ");
|
17913
|
+
}
|
17914
|
+
};
|
17854
17915
|
var renderAnswer = function renderAnswer(type, content) {
|
17855
17916
|
var _content$split, _content$split$map;
|
17856
17917
|
if (!content) return "";
|
@@ -17907,12 +17968,12 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
17907
17968
|
fontSize: "13px",
|
17908
17969
|
fontWeight: 500
|
17909
17970
|
}
|
17910
|
-
},
|
17971
|
+
}, typeof item.selectedAnswers === "string" ? renderAnswer(item.questionAnswerType, item.selectedAnswers) : renderTextbookAnswer(item.questionAnswerType, item.selectedAnswers, item.textualAnswers)), React__default.createElement("td", {
|
17911
17972
|
style: {
|
17912
17973
|
textAlign: "center",
|
17913
17974
|
color: styles$4.gray_700
|
17914
17975
|
}
|
17915
|
-
},
|
17976
|
+
}, typeof item.correctAnswers === "string" ? renderAnswer(item.questionAnswerType, item.correctAnswers) : renderTextbookAnswer(item.questionAnswerType, item.correctAnswers, item.correctTextualAnswers, true)), React__default.createElement("td", {
|
17916
17977
|
style: {
|
17917
17978
|
textAlign: "center",
|
17918
17979
|
color: styles$4.gray_700
|
@@ -17922,7 +17983,7 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
17922
17983
|
};
|
17923
17984
|
var renderQuestions = function renderQuestions(questions) {
|
17924
17985
|
return questions.map(function (question) {
|
17925
|
-
var _question$category
|
17986
|
+
var _question$category;
|
17926
17987
|
return React__default.createElement(Stack, {
|
17927
17988
|
direction: "row",
|
17928
17989
|
flexWrap: "nowrap",
|
@@ -17958,29 +18019,9 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
17958
18019
|
className: styles$4["span2"]
|
17959
18020
|
}, t("my_wrong_answer"))), React__default.createElement("div", null, React__default.createElement("span", {
|
17960
18021
|
className: styles$4["overallCorrectRate"]
|
17961
|
-
}, question.overallCorrectRate.toFixed(2), "%"),
|
17962
|
-
className: styles$4["answer"]
|
17963
|
-
}, React__default.createElement(MathJaxContainer, {
|
17964
|
-
content: question.selectedAnswers
|
17965
|
-
}), " ", t("answer"), " ", React__default.createElement(MathJaxContainer, {
|
17966
|
-
content: question.correctAnswers
|
17967
|
-
})) : question.questionAnswerType === QuestionAnswerType.MultipleChoice ? React__default.createElement("span", {
|
17968
|
-
className: styles$4["answer"]
|
17969
|
-
}, (_question$selectedAns = question.selectedAnswers.split("|")) === null || _question$selectedAns === void 0 ? void 0 : (_question$selectedAns2 = _question$selectedAns.map(function (i) {
|
17970
|
-
return t("number_question", {
|
17971
|
-
number: i
|
17972
|
-
});
|
17973
|
-
})) === 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) {
|
17974
|
-
return t("number_question", {
|
17975
|
-
number: i
|
17976
|
-
});
|
17977
|
-
})) === null || _question$correctAnsw3 === void 0 ? void 0 : _question$correctAnsw3.join(","), ")") : React__default.createElement("span", {
|
18022
|
+
}, question.overallCorrectRate.toFixed(2), "%"), React__default.createElement("span", {
|
17978
18023
|
className: styles$4["answer"]
|
17979
|
-
}, t("
|
17980
|
-
number: question.selectedAnswers
|
17981
|
-
}), " (", t("answer"), " ", t("number_question", {
|
17982
|
-
number: question.correctAnswers
|
17983
|
-
}), ")"))));
|
18024
|
+
}, 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)))));
|
17984
18025
|
});
|
17985
18026
|
};
|
17986
18027
|
var handleToggle = function handleToggle() {
|
@@ -28733,6 +28774,16 @@ var QuestionView = function QuestionView(_ref2) {
|
|
28733
28774
|
return null;
|
28734
28775
|
}
|
28735
28776
|
};
|
28777
|
+
var answerTypeOptions = [{
|
28778
|
+
label: t("singlechoice"),
|
28779
|
+
value: QuestionAnswerType.SingleChoice
|
28780
|
+
}, {
|
28781
|
+
label: t("multiplechoice"),
|
28782
|
+
value: QuestionAnswerType.MultipleChoice
|
28783
|
+
}, {
|
28784
|
+
label: t("shortanswer"),
|
28785
|
+
value: QuestionAnswerType.ShortAnswer
|
28786
|
+
}];
|
28736
28787
|
return React__default.createElement(Grid, {
|
28737
28788
|
container: true,
|
28738
28789
|
spacing: "16px"
|
@@ -28824,14 +28875,7 @@ var QuestionView = function QuestionView(_ref2) {
|
|
28824
28875
|
}, t("question_answer_type")), React__default.createElement(CustomSelect, {
|
28825
28876
|
isDisabled: isDisabled,
|
28826
28877
|
value: question.questionAnswerType,
|
28827
|
-
options:
|
28828
|
-
return Number.isNaN(+key);
|
28829
|
-
}).map(function (label, index) {
|
28830
|
-
return {
|
28831
|
-
label: t(label.toLowerCase()),
|
28832
|
-
value: index
|
28833
|
-
};
|
28834
|
-
}),
|
28878
|
+
options: answerTypeOptions,
|
28835
28879
|
onChange: function onChange(value) {
|
28836
28880
|
return onChangeQuestionAnswerType === null || onChangeQuestionAnswerType === void 0 ? void 0 : onChangeQuestionAnswerType(value === null || value === void 0 ? void 0 : value.value, index);
|
28837
28881
|
}
|
@@ -28864,14 +28908,7 @@ var QuestionView = function QuestionView(_ref2) {
|
|
28864
28908
|
}, t("question_answer_type")), React__default.createElement(CustomSelect, {
|
28865
28909
|
isDisabled: isDisabled,
|
28866
28910
|
value: question.questionAnswerType,
|
28867
|
-
options:
|
28868
|
-
return Number.isNaN(+key);
|
28869
|
-
}).map(function (label, index) {
|
28870
|
-
return {
|
28871
|
-
label: t(label.toLowerCase()),
|
28872
|
-
value: index
|
28873
|
-
};
|
28874
|
-
}),
|
28911
|
+
options: answerTypeOptions,
|
28875
28912
|
onChange: function onChange(value) {
|
28876
28913
|
return onChangeQuestionAnswerType === null || onChangeQuestionAnswerType === void 0 ? void 0 : onChangeQuestionAnswerType(value === null || value === void 0 ? void 0 : value.value, index);
|
28877
28914
|
}
|
@@ -33263,6 +33300,67 @@ var DefaultTextbookOwner = {
|
|
33263
33300
|
var DEFAULT_ANSWER_COUNT$2 = 5;
|
33264
33301
|
var DEFAULT_SCORE$1 = 2;
|
33265
33302
|
var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
33303
|
+
var quesitonSchema = object({
|
33304
|
+
questionAnswerType: mixed().oneOf(Object.values(QuestionAnswerType), "invalid question answer type").required(t("question_answer_type_required")),
|
33305
|
+
numerOfAnswers: array().of(number()),
|
33306
|
+
correctAnswers: array().of(number()).when("questionAnswerType", {
|
33307
|
+
is: function is(answerType) {
|
33308
|
+
return !isTextType(answerType);
|
33309
|
+
},
|
33310
|
+
then: function then(schema) {
|
33311
|
+
return schema.min(2, t("question_answer_required"));
|
33312
|
+
},
|
33313
|
+
otherwise: function otherwise(schema) {
|
33314
|
+
return schema.notRequired();
|
33315
|
+
}
|
33316
|
+
}),
|
33317
|
+
score: number().required(),
|
33318
|
+
questionOrder: number().required(),
|
33319
|
+
questionTypeId: number().notRequired(),
|
33320
|
+
correctTextualAnswers: array().of(string().trim().required(t("short_string_answer_cannot_be_empty"))).when("questionAnswerType", {
|
33321
|
+
is: function is(answerType) {
|
33322
|
+
return isTextType(answerType);
|
33323
|
+
},
|
33324
|
+
then: function then(schema) {
|
33325
|
+
return schema.min(1, t("question_answer_required"));
|
33326
|
+
},
|
33327
|
+
otherwise: function otherwise(schema) {
|
33328
|
+
return schema.notRequired();
|
33329
|
+
}
|
33330
|
+
}).when("questionAnswerType", {
|
33331
|
+
is: function is(answerType) {
|
33332
|
+
return isTextType(answerType) && answerType !== QuestionAnswerType.ShortAnswer;
|
33333
|
+
},
|
33334
|
+
then: function then(schema) {
|
33335
|
+
return schema.min(2, t("question_answer_required"));
|
33336
|
+
}
|
33337
|
+
})
|
33338
|
+
});
|
33339
|
+
var questionGroupsSchema = array().of(object().shape({
|
33340
|
+
pageFrom: number().notRequired().integer().notRequired().min(1, t("min_is_1")),
|
33341
|
+
pageTo: number().notRequired().integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
|
33342
|
+
var _this$parent = this === null || this === void 0 ? void 0 : this.parent,
|
33343
|
+
pageFrom = _this$parent.pageFrom;
|
33344
|
+
return !value || !pageFrom || value >= pageFrom;
|
33345
|
+
}),
|
33346
|
+
articles: array().of(object().shape({
|
33347
|
+
categories: array().of(number()).min(1, t("category_required")),
|
33348
|
+
title: string().notRequired(),
|
33349
|
+
author: string().notRequired(),
|
33350
|
+
subject: string().notRequired()
|
33351
|
+
})).when("$type", {
|
33352
|
+
is: function is(type) {
|
33353
|
+
return type === 2;
|
33354
|
+
},
|
33355
|
+
then: function then(schema) {
|
33356
|
+
return schema.min(1, t("category_required"));
|
33357
|
+
},
|
33358
|
+
otherwise: function otherwise(schema) {
|
33359
|
+
return schema.min(1, t("article_required"));
|
33360
|
+
}
|
33361
|
+
}),
|
33362
|
+
questions: array().of(quesitonSchema)
|
33363
|
+
}));
|
33266
33364
|
return object({
|
33267
33365
|
name: string().required(t("name_required")),
|
33268
33366
|
subjectId: number().required(t("subject_required")).notOneOf([0], t("subject_required")),
|
@@ -33280,36 +33378,12 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
|
33280
33378
|
chapters: array().of(object().shape({
|
33281
33379
|
pageFrom: number().required(t("page_from_required")).integer().typeError(t("must_be_number")).min(1, t("min_is_1")),
|
33282
33380
|
pageTo: number().required(t("page_to_required")).integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
|
33283
|
-
var _this$
|
33284
|
-
pageFrom = _this$
|
33381
|
+
var _this$parent2 = this === null || this === void 0 ? void 0 : this.parent,
|
33382
|
+
pageFrom = _this$parent2.pageFrom;
|
33285
33383
|
return value >= pageFrom;
|
33286
33384
|
}),
|
33287
33385
|
name: string().required(t("name_required")),
|
33288
|
-
questionGroups:
|
33289
|
-
pageFrom: number().notRequired().integer().notRequired().min(1, t("min_is_1")),
|
33290
|
-
pageTo: number().notRequired().integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
|
33291
|
-
var _this$parent2 = this === null || this === void 0 ? void 0 : this.parent,
|
33292
|
-
pageFrom = _this$parent2.pageFrom;
|
33293
|
-
return !value || !pageFrom || value >= pageFrom;
|
33294
|
-
}),
|
33295
|
-
articles: array().of(object().shape({
|
33296
|
-
categories: array().of(number()).min(1, t("category_required")),
|
33297
|
-
title: string().notRequired(),
|
33298
|
-
author: string().notRequired(),
|
33299
|
-
subject: string().notRequired()
|
33300
|
-
})).when("$type", {
|
33301
|
-
is: function is(type) {
|
33302
|
-
return type === 2;
|
33303
|
-
},
|
33304
|
-
then: function then(schema) {
|
33305
|
-
return schema.min(1, t("category_required"));
|
33306
|
-
},
|
33307
|
-
otherwise: function otherwise(schema) {
|
33308
|
-
return schema.min(1, t("article_required"));
|
33309
|
-
}
|
33310
|
-
}),
|
33311
|
-
questions: array().of(object())
|
33312
|
-
})),
|
33386
|
+
questionGroups: questionGroupsSchema,
|
33313
33387
|
subChapters: array().of(object().shape({
|
33314
33388
|
pageFrom: number().required(t("page_from_required")).integer().typeError(t("must_be_number")).min(1, t("min_is_1")),
|
33315
33389
|
pageTo: number().required(t("page_to_required")).integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
|
@@ -33318,31 +33392,7 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
|
33318
33392
|
return value >= pageFrom;
|
33319
33393
|
}),
|
33320
33394
|
name: string().required(t("name_required")),
|
33321
|
-
questionGroups:
|
33322
|
-
pageFrom: number().notRequired().integer().notRequired().min(1, t("min_is_1")),
|
33323
|
-
pageTo: number().notRequired().integer().typeError(t("must_be_number")).test("is-greater", t("page_to_must_be_greater_than_or_equal_to_page_from"), function (value) {
|
33324
|
-
var _this$parent4 = this === null || this === void 0 ? void 0 : this.parent,
|
33325
|
-
pageFrom = _this$parent4.pageFrom;
|
33326
|
-
return !value || !pageFrom || value >= pageFrom;
|
33327
|
-
}),
|
33328
|
-
articles: array().of(object().shape({
|
33329
|
-
categories: array().of(number()).min(1, t("category_required")),
|
33330
|
-
title: string().notRequired(),
|
33331
|
-
author: string().notRequired(),
|
33332
|
-
subject: string().notRequired()
|
33333
|
-
})).when("$type", {
|
33334
|
-
is: function is(type) {
|
33335
|
-
return type === 2;
|
33336
|
-
},
|
33337
|
-
then: function then(schema) {
|
33338
|
-
return schema.min(1, t("category_required"));
|
33339
|
-
},
|
33340
|
-
otherwise: function otherwise(schema) {
|
33341
|
-
return schema.min(1, t("article_required"));
|
33342
|
-
}
|
33343
|
-
}),
|
33344
|
-
questions: array().of(object())
|
33345
|
-
}))
|
33395
|
+
questionGroups: questionGroupsSchema
|
33346
33396
|
}))
|
33347
33397
|
})).required("chapter_required")
|
33348
33398
|
});
|
@@ -33376,7 +33426,7 @@ var DEFAULT_QUESTION = {
|
|
33376
33426
|
questionAnswerType: QuestionAnswerType.SingleChoice,
|
33377
33427
|
questionOrder: 0,
|
33378
33428
|
score: DEFAULT_SCORE$1,
|
33379
|
-
|
33429
|
+
correctTextualAnswers: [""]
|
33380
33430
|
};
|
33381
33431
|
var DEFAULT_QUESTION_GROUP = {
|
33382
33432
|
answerCount: DEFAULT_ANSWER_COUNT$2,
|
@@ -33394,6 +33444,16 @@ var DEFAULT_ARTICLE = {
|
|
33394
33444
|
var DEFAULT_MATH_QUESTION_GROUP = _extends({}, DEFAULT_QUESTION_GROUP, {
|
33395
33445
|
articles: [DEFAULT_ARTICLE]
|
33396
33446
|
});
|
33447
|
+
var CompareTypeOptions = [{
|
33448
|
+
label: "order_matters",
|
33449
|
+
value: QuestionAnswerType.OrderMatters
|
33450
|
+
}, {
|
33451
|
+
label: "order_does_not_matter",
|
33452
|
+
value: QuestionAnswerType.OrderDoesNotMatters
|
33453
|
+
}, {
|
33454
|
+
label: "synonym_processing",
|
33455
|
+
value: QuestionAnswerType.SynonymProcessing
|
33456
|
+
}];
|
33397
33457
|
|
33398
33458
|
var CustomTextbookTab = function CustomTextbookTab(props) {
|
33399
33459
|
var children = props.children,
|
@@ -33518,7 +33578,7 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
|
|
33518
33578
|
}),
|
33519
33579
|
questionCount: g.questions.length,
|
33520
33580
|
answerCount: ((_g$questions = g.questions) === null || _g$questions === void 0 ? void 0 : (_g$questions$find = _g$questions.find(function (q) {
|
33521
|
-
return q.questionAnswerType
|
33581
|
+
return !isTextType(q.questionAnswerType);
|
33522
33582
|
})) === null || _g$questions$find === void 0 ? void 0 : _g$questions$find.numberOfAnswers) || DEFAULT_ANSWER_COUNT$2
|
33523
33583
|
};
|
33524
33584
|
})) || [],
|
@@ -33563,7 +33623,7 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
|
|
33563
33623
|
}),
|
33564
33624
|
questionCount: g.questions.length,
|
33565
33625
|
answerCount: ((_g$questions2 = g.questions) === null || _g$questions2 === void 0 ? void 0 : (_g$questions2$find = _g$questions2.find(function (q) {
|
33566
|
-
return q.questionAnswerType
|
33626
|
+
return !isTextType(q.questionAnswerType);
|
33567
33627
|
})) === null || _g$questions2$find === void 0 ? void 0 : _g$questions2$find.numberOfAnswers) || DEFAULT_ANSWER_COUNT$2
|
33568
33628
|
};
|
33569
33629
|
})) || [],
|
@@ -33865,6 +33925,128 @@ var labelStyle = {
|
|
33865
33925
|
whiteSpace: "nowrap"
|
33866
33926
|
};
|
33867
33927
|
|
33928
|
+
var QuestionCompareType = function QuestionCompareType(_ref) {
|
33929
|
+
var value = _ref.value,
|
33930
|
+
onChange = _ref.onChange;
|
33931
|
+
var _useTranslation = useTranslation(),
|
33932
|
+
t = _useTranslation.t;
|
33933
|
+
return React__default.createElement(FormControl, {
|
33934
|
+
sx: {
|
33935
|
+
display: "flex",
|
33936
|
+
alignItems: "center",
|
33937
|
+
pl: "24px",
|
33938
|
+
mt: 1,
|
33939
|
+
gap: 1,
|
33940
|
+
flexDirection: "row",
|
33941
|
+
width: "100%"
|
33942
|
+
}
|
33943
|
+
}, React__default.createElement(FormLabel, {
|
33944
|
+
htmlFor: "compare-type",
|
33945
|
+
className: "" + styles$a["question-label"],
|
33946
|
+
sx: _extends({}, labelStyle, {
|
33947
|
+
width: "unset"
|
33948
|
+
})
|
33949
|
+
}, t("compare_type"), ":"), React__default.createElement(RadioGroup, {
|
33950
|
+
row: true,
|
33951
|
+
sx: {
|
33952
|
+
flexGrow: 1
|
33953
|
+
},
|
33954
|
+
"aria-labelledby": "compare-type",
|
33955
|
+
name: "row-radio-buttons-group",
|
33956
|
+
value: value,
|
33957
|
+
onChange: onChange
|
33958
|
+
}, React__default.createElement(ListView, {
|
33959
|
+
data: CompareTypeOptions,
|
33960
|
+
render: function render(_ref2) {
|
33961
|
+
var value = _ref2.value,
|
33962
|
+
label = _ref2.label;
|
33963
|
+
return React__default.createElement(FormControlLabel, {
|
33964
|
+
key: value,
|
33965
|
+
value: value,
|
33966
|
+
control: React__default.createElement(Radio, {
|
33967
|
+
size: "small",
|
33968
|
+
color: "success"
|
33969
|
+
}),
|
33970
|
+
label: React__default.createElement(Typography, {
|
33971
|
+
sx: {
|
33972
|
+
fontSize: "14px",
|
33973
|
+
fontWeight: 500
|
33974
|
+
},
|
33975
|
+
className: "truncate"
|
33976
|
+
}, t(label))
|
33977
|
+
});
|
33978
|
+
}
|
33979
|
+
})));
|
33980
|
+
};
|
33981
|
+
|
33982
|
+
var QuestionOrderName = function QuestionOrderName(_ref) {
|
33983
|
+
var questionTitleStyle = _ref.questionTitleStyle,
|
33984
|
+
isMath = _ref.isMath,
|
33985
|
+
questionOrder = _ref.questionOrder;
|
33986
|
+
var _useTranslation = useTranslation(),
|
33987
|
+
t = _useTranslation.t;
|
33988
|
+
return React__default.createElement(Box, {
|
33989
|
+
className: styles$a["question-title"] + " me-2 text-nowrap",
|
33990
|
+
sx: questionTitleStyle
|
33991
|
+
}, isMath ? t("problem_number_question", {
|
33992
|
+
number: questionOrder + 1
|
33993
|
+
}) : t("text_detail_n", {
|
33994
|
+
n: questionOrder + 1
|
33995
|
+
}));
|
33996
|
+
};
|
33997
|
+
|
33998
|
+
var QuestionShortInput = function QuestionShortInput(_ref) {
|
33999
|
+
var name = _ref.name,
|
34000
|
+
deletable = _ref.deletable,
|
34001
|
+
onDelete = _ref.onDelete;
|
34002
|
+
var _useTranslation = useTranslation(),
|
34003
|
+
t = _useTranslation.t;
|
34004
|
+
return React__default.createElement(Field, {
|
34005
|
+
name: name,
|
34006
|
+
render: function render(_ref2) {
|
34007
|
+
var field = _ref2.field;
|
34008
|
+
return React__default.createElement(Box, {
|
34009
|
+
sx: {
|
34010
|
+
position: "relative"
|
34011
|
+
}
|
34012
|
+
}, React__default.createElement(TextField, Object.assign({}, field, {
|
34013
|
+
size: "small",
|
34014
|
+
fullWidth: true,
|
34015
|
+
placeholder: t("textual_answer"),
|
34016
|
+
onKeyDown: handleKeyDown,
|
34017
|
+
sx: {
|
34018
|
+
"& input": {
|
34019
|
+
paddingRight: deletable ? "40px" : undefined
|
34020
|
+
}
|
34021
|
+
}
|
34022
|
+
})), deletable && React__default.createElement(Stack, {
|
34023
|
+
justifyContent: "center",
|
34024
|
+
alignItems: "center",
|
34025
|
+
sx: {
|
34026
|
+
position: "absolute",
|
34027
|
+
top: "50%",
|
34028
|
+
right: 0,
|
34029
|
+
width: "40px",
|
34030
|
+
transform: "translateY(-50%)"
|
34031
|
+
}
|
34032
|
+
}, React__default.createElement(Box, {
|
34033
|
+
width: "fit-content"
|
34034
|
+
}, React__default.createElement(IconButton, {
|
34035
|
+
color: "default",
|
34036
|
+
size: "small",
|
34037
|
+
className: "bg-danger text-white",
|
34038
|
+
onClick: onDelete
|
34039
|
+
}, React__default.createElement(FaTrashCan, {
|
34040
|
+
size: 12
|
34041
|
+
})))));
|
34042
|
+
}
|
34043
|
+
});
|
34044
|
+
};
|
34045
|
+
var isEqual$1 = function isEqual(prev, next) {
|
34046
|
+
return prev.value === next.value && prev.name == next.name && prev.deletable == next.deletable;
|
34047
|
+
};
|
34048
|
+
var QuestionShortInput$1 = memo(QuestionShortInput, isEqual$1);
|
34049
|
+
|
33868
34050
|
var _excluded$h = ["onChange"];
|
33869
34051
|
var BpIcon$1 = styled("span")(function (_ref) {
|
33870
34052
|
var theme = _ref.theme;
|
@@ -33908,6 +34090,10 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
33908
34090
|
setFieldValue = _ref2.setFieldValue,
|
33909
34091
|
onCloseQuestionTypeMenu = _ref2.onCloseQuestionTypeMenu,
|
33910
34092
|
onOpenQuestionTypeMenu = _ref2.onOpenQuestionTypeMenu;
|
34093
|
+
var _useTranslation = useTranslation(),
|
34094
|
+
t = _useTranslation.t;
|
34095
|
+
var theme = useTheme();
|
34096
|
+
var isTabletUp = useMediaQuery(theme.breakpoints.up("lg"));
|
33911
34097
|
var handleCheckMultiChoice = function handleCheckMultiChoice(choice) {
|
33912
34098
|
var updatedAnswers = data.correctAnswers;
|
33913
34099
|
if (updatedAnswers.includes(choice)) {
|
@@ -33919,35 +34105,74 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
33919
34105
|
}
|
33920
34106
|
setFieldValue(path + ".correctAnswers", updatedAnswers);
|
33921
34107
|
};
|
34108
|
+
var handleAddTextualAnswer = function handleAddTextualAnswer() {
|
34109
|
+
data.correctTextualAnswers.length === 1 && setFieldValue(path + ".questionAnswerType", QuestionAnswerType.OrderMatters);
|
34110
|
+
setFieldValue(path + ".correctTextualAnswers", [].concat(data.correctTextualAnswers, [""]));
|
34111
|
+
};
|
34112
|
+
var handleRemoveTextualAnswer = function handleRemoveTextualAnswer(remove, index) {
|
34113
|
+
data.correctTextualAnswers.length === 2 && setFieldValue(path + ".questionAnswerType", QuestionAnswerType.ShortAnswer);
|
34114
|
+
remove(index);
|
34115
|
+
};
|
33922
34116
|
var handleChangeQuestionAnswerType = function handleChangeQuestionAnswerType(value) {
|
34117
|
+
switch (value === null || value === void 0 ? void 0 : value.value) {
|
34118
|
+
case QuestionAnswerType.SingleChoice:
|
34119
|
+
case QuestionAnswerType.MultipleChoice:
|
34120
|
+
setFieldValue(path + ".correctTextualAnswers", []);
|
34121
|
+
break;
|
34122
|
+
default:
|
34123
|
+
if (data.correctTextualAnswers.length === 0) setFieldValue(path + ".correctTextualAnswers", [""]);
|
34124
|
+
break;
|
34125
|
+
}
|
33923
34126
|
setFieldValue(path + ".questionAnswerType", (value === null || value === void 0 ? void 0 : value.value) || 0);
|
33924
34127
|
};
|
34128
|
+
var handleChangeCompareType = function handleChangeCompareType(_, value) {
|
34129
|
+
setFieldValue(path + ".questionAnswerType", Number(value) || 0);
|
34130
|
+
};
|
33925
34131
|
var handleOpenQuestionTypeMenu = function handleOpenQuestionTypeMenu() {
|
33926
34132
|
onOpenQuestionTypeMenu(path + ".questionTypeId");
|
33927
34133
|
};
|
34134
|
+
var isIncomplatedTextualAnswers = data.correctTextualAnswers.some(function (i) {
|
34135
|
+
return !i.trim();
|
34136
|
+
});
|
34137
|
+
var isTextAnswerType = isTextType(data.questionAnswerType);
|
33928
34138
|
var renderAnswer = function renderAnswer() {
|
33929
34139
|
switch (data.questionAnswerType) {
|
33930
34140
|
case QuestionAnswerType.ShortAnswer:
|
33931
|
-
|
33932
|
-
|
33933
|
-
|
33934
|
-
|
33935
|
-
|
33936
|
-
|
33937
|
-
|
33938
|
-
|
33939
|
-
|
33940
|
-
|
33941
|
-
|
33942
|
-
|
33943
|
-
|
33944
|
-
|
33945
|
-
|
33946
|
-
|
33947
|
-
|
33948
|
-
|
33949
|
-
}
|
33950
|
-
|
34141
|
+
case QuestionAnswerType.SynonymProcessing:
|
34142
|
+
case QuestionAnswerType.OrderMatters:
|
34143
|
+
case QuestionAnswerType.OrderDoesNotMatters:
|
34144
|
+
return React__default.createElement(FieldArray, {
|
34145
|
+
name: path + ".correctTextualAnswers"
|
34146
|
+
}, function (_ref3) {
|
34147
|
+
var remove = _ref3.remove;
|
34148
|
+
return React__default.createElement(Stack, {
|
34149
|
+
sx: {
|
34150
|
+
pl: "24px",
|
34151
|
+
flexDirection: "row",
|
34152
|
+
gap: "8px",
|
34153
|
+
alignItems: "center"
|
34154
|
+
}
|
34155
|
+
}, React__default.createElement(Stack, {
|
34156
|
+
direction: "row",
|
34157
|
+
gap: "12px",
|
34158
|
+
flexWrap: "wrap"
|
34159
|
+
}, React__default.createElement(ListView, {
|
34160
|
+
data: data.correctTextualAnswers,
|
34161
|
+
render: function render(_, index) {
|
34162
|
+
return React__default.createElement(Box, {
|
34163
|
+
key: index,
|
34164
|
+
minWidth: "200px"
|
34165
|
+
}, React__default.createElement(QuestionShortInput$1, {
|
34166
|
+
value: data.correctTextualAnswers[index],
|
34167
|
+
name: path + ".correctTextualAnswers[" + index + "]",
|
34168
|
+
onDelete: function onDelete() {
|
34169
|
+
return handleRemoveTextualAnswer(remove, index);
|
34170
|
+
},
|
34171
|
+
deletable: data.correctTextualAnswers.length > 1
|
34172
|
+
}));
|
34173
|
+
}
|
34174
|
+
})));
|
34175
|
+
});
|
33951
34176
|
case QuestionAnswerType.MultipleChoice:
|
33952
34177
|
return React__default.createElement(Grid, {
|
33953
34178
|
container: true
|
@@ -34024,18 +34249,16 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34024
34249
|
}
|
34025
34250
|
setFieldValue(path + ".questionType", val);
|
34026
34251
|
};
|
34027
|
-
var
|
34028
|
-
|
34029
|
-
|
34030
|
-
|
34031
|
-
|
34032
|
-
|
34033
|
-
|
34034
|
-
|
34035
|
-
|
34036
|
-
}
|
34037
|
-
var theme = useTheme();
|
34038
|
-
var isTabletUp = useMediaQuery(theme.breakpoints.up("lg"));
|
34252
|
+
var answerTypeOptions = [{
|
34253
|
+
label: t("singlechoice"),
|
34254
|
+
value: QuestionAnswerType.SingleChoice
|
34255
|
+
}, {
|
34256
|
+
label: t("multiplechoice"),
|
34257
|
+
value: QuestionAnswerType.MultipleChoice
|
34258
|
+
}, {
|
34259
|
+
label: t("shortanswer"),
|
34260
|
+
value: QuestionAnswerType.ShortAnswer
|
34261
|
+
}];
|
34039
34262
|
return React__default.createElement(Stack, {
|
34040
34263
|
direction: "row",
|
34041
34264
|
alignItems: "center",
|
@@ -34046,19 +34269,50 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34046
34269
|
alignItems: "center",
|
34047
34270
|
minWidth: "50%",
|
34048
34271
|
flexGrow: 1
|
34049
|
-
}, React__default.createElement(Box, null, React__default.createElement(
|
34050
|
-
|
34051
|
-
|
34052
|
-
|
34053
|
-
|
34054
|
-
}) : t("text_detail_n", {
|
34055
|
-
n: data.questionOrder + 1
|
34056
|
-
}))), React__default.createElement(Box, {
|
34272
|
+
}, React__default.createElement(Box, null, React__default.createElement(QuestionOrderName, {
|
34273
|
+
questionOrder: data.questionOrder,
|
34274
|
+
isMath: isMath,
|
34275
|
+
questionTitleStyle: questionTitleStyle
|
34276
|
+
})), React__default.createElement(Box, {
|
34057
34277
|
flexGrow: 1
|
34058
|
-
},
|
34278
|
+
}, data.correctTextualAnswers.length > 1 && React__default.createElement(Box, null, React__default.createElement(QuestionCompareType, {
|
34279
|
+
value: data.questionAnswerType,
|
34280
|
+
onChange: handleChangeCompareType
|
34281
|
+
})), renderAnswer())), React__default.createElement(Stack, {
|
34282
|
+
gap: 1
|
34283
|
+
}, React__default.createElement(Stack, {
|
34059
34284
|
direction: "row",
|
34060
34285
|
gap: 2
|
34061
|
-
}, React__default.createElement(
|
34286
|
+
}, isTextAnswerType && React__default.createElement(FormGroup, null, React__default.createElement(FormLabel, {
|
34287
|
+
className: styles$a["question-label"] + " form-label",
|
34288
|
+
sx: _extends({}, labelStyle, {
|
34289
|
+
visibility: "hidden"
|
34290
|
+
})
|
34291
|
+
}, "hidden"), React__default.createElement(Stack, {
|
34292
|
+
flexGrow: 1,
|
34293
|
+
alignItems: "center",
|
34294
|
+
justifyContent: "center"
|
34295
|
+
}, React__default.createElement(IconButton, {
|
34296
|
+
disabled: isIncomplatedTextualAnswers,
|
34297
|
+
color: "default",
|
34298
|
+
size: "small",
|
34299
|
+
sx: {
|
34300
|
+
height: "fit-content",
|
34301
|
+
background: theme.palette.success.dark,
|
34302
|
+
color: '#fff',
|
34303
|
+
"&.Mui-disabled": {
|
34304
|
+
background: theme.palette.success.dark,
|
34305
|
+
opacity: "0.6"
|
34306
|
+
},
|
34307
|
+
"&:hover": {
|
34308
|
+
background: theme.palette.success.dark,
|
34309
|
+
opacity: "0.8"
|
34310
|
+
}
|
34311
|
+
},
|
34312
|
+
onClick: handleAddTextualAnswer
|
34313
|
+
}, React__default.createElement(IoIosAdd, {
|
34314
|
+
size: 20
|
34315
|
+
})))), React__default.createElement(FormGroup, {
|
34062
34316
|
sx: {
|
34063
34317
|
flexGrow: 1,
|
34064
34318
|
width: isTabletUp ? "120px" : "100px"
|
@@ -34117,15 +34371,15 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34117
34371
|
render: function render(_ref6) {
|
34118
34372
|
var field = _ref6.field;
|
34119
34373
|
return React__default.createElement(CustomSelect, Object.assign({}, field, {
|
34120
|
-
value: data.questionAnswerType,
|
34374
|
+
value: data.questionAnswerType !== QuestionAnswerType.SingleChoice && data.questionAnswerType !== QuestionAnswerType.MultipleChoice ? QuestionAnswerType.ShortAnswer : data.questionAnswerType,
|
34121
34375
|
isDisabled: disabled,
|
34122
34376
|
options: answerTypeOptions,
|
34123
34377
|
onChange: handleChangeQuestionAnswerType
|
34124
34378
|
}));
|
34125
34379
|
}
|
34126
|
-
}))));
|
34380
|
+
})))));
|
34127
34381
|
};
|
34128
|
-
var isEqual$
|
34382
|
+
var isEqual$2 = function isEqual(prev, next) {
|
34129
34383
|
var isPrevMatched = prev.optionKey === prev.path + ".questionTypeId";
|
34130
34384
|
var isNextMatched = next.optionKey === next.path + ".questionTypeId";
|
34131
34385
|
var prevOptionKey = isPrevMatched ? prev.optionKey : undefined;
|
@@ -34136,7 +34390,7 @@ var isEqual$1 = function isEqual(prev, next) {
|
|
34136
34390
|
var nextQuestionTypes = isNextMatched ? next.questionTypes : undefined;
|
34137
34391
|
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;
|
34138
34392
|
};
|
34139
|
-
var QuestionBlock$1 = memo(QuestionBlock, isEqual$
|
34393
|
+
var QuestionBlock$1 = memo(QuestionBlock, isEqual$2);
|
34140
34394
|
|
34141
34395
|
var _excluded$i = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
34142
34396
|
var _$1 = _$6;
|
@@ -34165,6 +34419,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
34165
34419
|
var articles = data.articles,
|
34166
34420
|
questions = data.questions;
|
34167
34421
|
var blockErrors = _$1.get(errors, path);
|
34422
|
+
console.log(path + ": ", blockErrors);
|
34168
34423
|
var handleOpenQuestionTypeMenu = useCallback(function (key) {
|
34169
34424
|
var _data$articles$, _data$articles$$categ, _data$articles$2, _data$articles$2$cate;
|
34170
34425
|
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]);
|
@@ -34243,7 +34498,13 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
34243
34498
|
alignItems: "center",
|
34244
34499
|
gap: 1
|
34245
34500
|
}
|
34246
|
-
}, React__default.createElement(FormLabel,
|
34501
|
+
}, React__default.createElement(FormLabel, {
|
34502
|
+
sx: {
|
34503
|
+
fontWeight: 600
|
34504
|
+
},
|
34505
|
+
htmlFor: "start_order"
|
34506
|
+
}, t$1("start_order")), React__default.createElement(TextField, {
|
34507
|
+
id: "start_order",
|
34247
34508
|
inputRef: startOrderRef,
|
34248
34509
|
onChange: handleChangeStartQuestionOrder,
|
34249
34510
|
type: "number",
|
@@ -34270,7 +34531,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
34270
34531
|
}
|
34271
34532
|
});
|
34272
34533
|
};
|
34273
|
-
var isEqual$
|
34534
|
+
var isEqual$3 = function isEqual(prev, next) {
|
34274
34535
|
var isPrevMatched = prev.optionKey.startsWith(prev.path);
|
34275
34536
|
var isNextMatched = next.optionKey.startsWith(next.path);
|
34276
34537
|
var prevOptionKey = isPrevMatched ? prev.optionKey : undefined;
|
@@ -34293,7 +34554,7 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
34293
34554
|
var nextOnOpenQuestionTypeMenu = next.onOpenQuestionTypeMenu;
|
34294
34555
|
return prevOptionKey === nextOptionKey && prevIsLoadingCategories === nextIsLoadingCategories && JSON.stringify(prevCategories) === JSON.stringify(nextCategories) && prevIsLoadingQuestionTypes === nextIsLoadingQuestionTypes && JSON.stringify(prevQuestionTypes) === JSON.stringify(nextQuestionTypes) && prev.path === next.path && prev.isMath === next.isMath && prev.open === next.open && prev.disabled === next.disabled && JSON.stringify(prev.data) === JSON.stringify(next.data) && JSON.stringify(prevBlockErrors) === JSON.stringify(nextBlockErrors) && prevOnOpenCategoryMenu === nextOnOpenCategoryMenu && prevOnOpenSubCategoryMenu === nextOnOpenSubCategoryMenu && prevOnOpenQuestionTypeMenu === nextOnOpenQuestionTypeMenu;
|
34295
34556
|
};
|
34296
|
-
var QuestionGroupBlockBody$1 = memo(QuestionGroupBlockBody, isEqual$
|
34557
|
+
var QuestionGroupBlockBody$1 = memo(QuestionGroupBlockBody, isEqual$3);
|
34297
34558
|
|
34298
34559
|
var _excluded$j = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "disabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
34299
34560
|
var _$2 = _$6;
|
@@ -34429,7 +34690,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
34429
34690
|
expanded: open,
|
34430
34691
|
onChange: handleToggle,
|
34431
34692
|
sx: {
|
34432
|
-
border: (open ? "5px" : "1.5px") + " solid " + (blockErrors ? open ? error.main : error.light : open ? yellow$1[900] : yellow$1[
|
34693
|
+
border: (open ? "5px" : "1.5px") + " solid " + (blockErrors ? open ? error.main : error.light : open ? yellow$1[900] : yellow$1[700])
|
34433
34694
|
}
|
34434
34695
|
}, React__default.createElement(AccordionSummary, {
|
34435
34696
|
expandIcon: React__default.createElement(MdExpandMore, {
|
@@ -37976,5 +38237,5 @@ var LayoutContext = function LayoutContext(_ref) {
|
|
37976
38237
|
});else return React__default.createElement(Fragment$1, null, children);
|
37977
38238
|
};
|
37978
38239
|
|
37979
|
-
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnswerCountSelector, ArticleCategorySelector, ArticleDialog, ArticleGroupView, BASE_URL, BRIEF_GRADE_OPTIONS, _ChapterBox as ChapterBox, ChatContainer, types as ChatTypes, ClassDetail, ClassList, ClassNoteDialog, ClassSelector, CommonDialog, ConfirmDeleteDialog, ConfirmDialog, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_NOTE_FILTER, DEFAULT_PAGING_RESPONSE, DefaultErrorMessage, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEvent, ExamNoteDialog, ExamResultV2, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, GRADE_OPTIONS, Header, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, MathJaxContainer, MathTinyEditor, NewNoteButton, NoAcademyHeaders, NotFound, NoteType, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbookList, PreparedTextbookView, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionAnswerType, QuestionCountSelector, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SUPER_ADMIN_BASE_URL, SchoolType$1 as SchoolType, ScoreSelector, SearchInput, ShareToTeacherDialog, StudentInfoDrawer, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookViewDetail as TextbookDetail, TextbookDrawer, TextbookEditorType, TextbookList, TheAcademyDropdown, TheLanguageDropdown, TinyEditor, UserList, UserSortColumn, VirtualListView, VirtualTableView, api, apiUpload, canAccess as canAccessRoute, convertHHMMSStoSeconds, createRecentUserActionListApi, diffFromNow, ellipsisText, encodeParams, formatDataMyAnswer, formatDateTime, formatPhoneNumber, formatRole, formatTextbookDataMyAnswer, formatTime, formatTimeSecond, getAcademyDomain, getAccessToken, getErrorMessage, getLanguage, getLearningSpace, getLocalDayOfWeek, getOrdinalSuffix, getRecentUserActionListApi, getRedirectUrl, getRemainTime, getRole, getUtcDayOfWeek, i18n, includePathname, isLocalHost, minutesToTimeSpan, pushTo, reset, setAcademies, setAcademy, setAlert, setConcurrentConnectionPusher, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, timAgo, timeSpanToLocalMoment, toISOString, toLocalTime, totalSolveTimeCategories, totalTextbookSolveTimeCategories, useAutoAcademyDomain, useChatContainer, useCountDownTimer, useGoogleSignOut, useLanguage, useList, useLoadMore, useLogin, useNotes, usePusherConversation, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
|
38240
|
+
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnswerCountSelector, ArticleCategorySelector, ArticleDialog, ArticleGroupView, BASE_URL, BRIEF_GRADE_OPTIONS, _ChapterBox as ChapterBox, ChatContainer, types as ChatTypes, ClassDetail, ClassList, ClassNoteDialog, ClassSelector, CommonDialog, ConfirmDeleteDialog, ConfirmDialog, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_NOTE_FILTER, DEFAULT_PAGING_RESPONSE, DefaultErrorMessage, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEvent, ExamNoteDialog, ExamResultV2, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, GRADE_OPTIONS, Header, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, MathJaxContainer, MathTinyEditor, NewNoteButton, NoAcademyHeaders, NotFound, NoteType, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbookList, PreparedTextbookView, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionAnswerType, QuestionCountSelector, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SUPER_ADMIN_BASE_URL, SchoolType$1 as SchoolType, ScoreSelector, SearchInput, ShareToTeacherDialog, StudentInfoDrawer, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookViewDetail as TextbookDetail, TextbookDrawer, TextbookEditorType, TextbookList, TheAcademyDropdown, TheLanguageDropdown, TinyEditor, UserList, UserSortColumn, VirtualListView, VirtualTableView, api, apiUpload, canAccess as canAccessRoute, convertHHMMSStoSeconds, createRecentUserActionListApi, diffFromNow, ellipsisText, encodeParams, formatDataMyAnswer, formatDateTime, formatPhoneNumber, formatRole, formatTextbookDataMyAnswer, formatTime, formatTimeSecond, getAcademyDomain, getAccessToken, getErrorMessage, getLanguage, getLearningSpace, getLocalDayOfWeek, getOrdinalSuffix, getRecentUserActionListApi, getRedirectUrl, getRemainTime, getRole, getUtcDayOfWeek, i18n, includePathname, isLocalHost, isTextType, minutesToTimeSpan, pushTo, reset, setAcademies, setAcademy, setAlert, setConcurrentConnectionPusher, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, timAgo, timeSpanToLocalMoment, toISOString, toLocalTime, totalSolveTimeCategories, totalTextbookSolveTimeCategories, useAutoAcademyDomain, useChatContainer, useCountDownTimer, useGoogleSignOut, useLanguage, useList, useLoadMore, useLogin, useNotes, usePusherConversation, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
|
37980
38241
|
//# sourceMappingURL=index.modern.js.map
|