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.js
CHANGED
@@ -1469,6 +1469,10 @@ var today_specific_class = "오늘의 특별 수업";
|
|
1469
1469
|
var n_lesson = "{{total}}개의 수업";
|
1470
1470
|
var exam_results = "시험 결과";
|
1471
1471
|
var textbook_results = "교과서 결과";
|
1472
|
+
var order_matters = "순서 상관 있음";
|
1473
|
+
var order_does_not_matter = "순서 상관 없음";
|
1474
|
+
var synonym_processing = "답 이음동의어 처리";
|
1475
|
+
var compare_type = "비교 유형";
|
1472
1476
|
var lang_ko = {
|
1473
1477
|
problem_solving: problem_solving,
|
1474
1478
|
my_story: my_story,
|
@@ -2575,7 +2579,11 @@ var lang_ko = {
|
|
2575
2579
|
today_specific_class: today_specific_class,
|
2576
2580
|
n_lesson: n_lesson,
|
2577
2581
|
exam_results: exam_results,
|
2578
|
-
textbook_results: textbook_results
|
2582
|
+
textbook_results: textbook_results,
|
2583
|
+
order_matters: order_matters,
|
2584
|
+
order_does_not_matter: order_does_not_matter,
|
2585
|
+
synonym_processing: synonym_processing,
|
2586
|
+
compare_type: compare_type
|
2579
2587
|
};
|
2580
2588
|
|
2581
2589
|
var problem_solving$1 = "Problem Solving";
|
@@ -3705,6 +3713,10 @@ var today_specific_class$1 = "Today's specific class";
|
|
3705
3713
|
var n_lesson$1 = "{{total}} lesson(s)";
|
3706
3714
|
var exam_results$1 = "Exam results";
|
3707
3715
|
var textbook_results$1 = "Textbook results";
|
3716
|
+
var order_matters$1 = "Order matters";
|
3717
|
+
var order_does_not_matter$1 = "Order doesn't matter";
|
3718
|
+
var synonym_processing$1 = "Answer Synonym processing";
|
3719
|
+
var compare_type$1 = "Compare Type";
|
3708
3720
|
var lang_en = {
|
3709
3721
|
problem_solving: problem_solving$1,
|
3710
3722
|
my_story: my_story$1,
|
@@ -4813,7 +4825,11 @@ var lang_en = {
|
|
4813
4825
|
today_specific_class: today_specific_class$1,
|
4814
4826
|
n_lesson: n_lesson$1,
|
4815
4827
|
exam_results: exam_results$1,
|
4816
|
-
textbook_results: textbook_results$1
|
4828
|
+
textbook_results: textbook_results$1,
|
4829
|
+
order_matters: order_matters$1,
|
4830
|
+
order_does_not_matter: order_does_not_matter$1,
|
4831
|
+
synonym_processing: synonym_processing$1,
|
4832
|
+
compare_type: compare_type$1
|
4817
4833
|
};
|
4818
4834
|
|
4819
4835
|
i18n__default.use(reactI18next.initReactI18next).init({
|
@@ -6156,6 +6172,9 @@ function _finally(body, finalizer) {
|
|
6156
6172
|
QuestionAnswerType[QuestionAnswerType["SingleChoice"] = 0] = "SingleChoice";
|
6157
6173
|
QuestionAnswerType[QuestionAnswerType["MultipleChoice"] = 1] = "MultipleChoice";
|
6158
6174
|
QuestionAnswerType[QuestionAnswerType["ShortAnswer"] = 2] = "ShortAnswer";
|
6175
|
+
QuestionAnswerType[QuestionAnswerType["OrderMatters"] = 3] = "OrderMatters";
|
6176
|
+
QuestionAnswerType[QuestionAnswerType["OrderDoesNotMatters"] = 4] = "OrderDoesNotMatters";
|
6177
|
+
QuestionAnswerType[QuestionAnswerType["SynonymProcessing"] = 5] = "SynonymProcessing";
|
6159
6178
|
})(exports.QuestionAnswerType || (exports.QuestionAnswerType = {}));
|
6160
6179
|
|
6161
6180
|
(function (OrderType) {
|
@@ -6576,6 +6595,10 @@ var getRole = function getRole(roles) {
|
|
6576
6595
|
return null;
|
6577
6596
|
};
|
6578
6597
|
|
6598
|
+
var isTextType = function isTextType(type) {
|
6599
|
+
return type === exports.QuestionAnswerType.ShortAnswer || type === exports.QuestionAnswerType.OrderMatters || type === exports.QuestionAnswerType.OrderDoesNotMatters || type === exports.QuestionAnswerType.SynonymProcessing;
|
6600
|
+
};
|
6601
|
+
|
6579
6602
|
var useAutoAcademyDomain = function useAutoAcademyDomain(_, history, superUrls, homeUrl, homeAcademyUrl, isAuthPage) {
|
6580
6603
|
if (isAuthPage === void 0) {
|
6581
6604
|
isAuthPage = true;
|
@@ -17417,6 +17440,24 @@ var CompareGrass = function CompareGrass(_ref2) {
|
|
17417
17440
|
var effectSize = _ref2.effectSize;
|
17418
17441
|
var _useTranslation = reactI18next.useTranslation(),
|
17419
17442
|
t = _useTranslation.t;
|
17443
|
+
var renderTextbookAnswer = function renderTextbookAnswer(type, answers, textualAnswers, isCorrect) {
|
17444
|
+
var _textualAnswers$;
|
17445
|
+
switch (type) {
|
17446
|
+
case exports.QuestionAnswerType.ShortAnswer:
|
17447
|
+
case exports.QuestionAnswerType.SynonymProcessing:
|
17448
|
+
return isCorrect ? textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(" | ") : (_textualAnswers$ = textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers[0]) != null ? _textualAnswers$ : "";
|
17449
|
+
case exports.QuestionAnswerType.SingleChoice:
|
17450
|
+
case exports.QuestionAnswerType.MultipleChoice:
|
17451
|
+
if (!(answers !== null && answers !== void 0 && answers.length)) return "";
|
17452
|
+
return answers.map(function (i) {
|
17453
|
+
return t("number_question", {
|
17454
|
+
number: i
|
17455
|
+
});
|
17456
|
+
}).join(",");
|
17457
|
+
default:
|
17458
|
+
return textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(", ");
|
17459
|
+
}
|
17460
|
+
};
|
17420
17461
|
var renderAnswer = function renderAnswer(type, content) {
|
17421
17462
|
var _content$split, _content$split$map;
|
17422
17463
|
if (!content) return "";
|
@@ -17454,19 +17495,21 @@ var CompareGrass = function CompareGrass(_ref2) {
|
|
17454
17495
|
}, t("problem"), " ", item.questionOrder + 1), React__default.createElement("td", {
|
17455
17496
|
style: {
|
17456
17497
|
textAlign: "center",
|
17457
|
-
color: "#202B37"
|
17498
|
+
color: "#202B37",
|
17499
|
+
maxWidth: "30%"
|
17458
17500
|
}
|
17459
|
-
},
|
17501
|
+
}, typeof item.correctAnswers === "string" ? renderAnswer(item.questionAnswerType, item.correctAnswers) : renderTextbookAnswer(item.questionAnswerType, item.correctAnswers, item.correctTextualAnswers, true)), React__default.createElement("td", {
|
17460
17502
|
className: styles$4["tdcolumn3"],
|
17461
17503
|
style: {
|
17462
|
-
color: item.isCorrect ? styles$4.green_support_900 : styles$4.red_900
|
17504
|
+
color: item.isCorrect ? styles$4.green_support_900 : styles$4.red_900,
|
17505
|
+
maxWidth: "30%"
|
17463
17506
|
}
|
17464
|
-
},
|
17507
|
+
}, typeof item.selectedAnswers === "string" ? renderAnswer(item.questionAnswerType, item.selectedAnswers) : renderTextbookAnswer(item.questionAnswerType, item.selectedAnswers, item.textualAnswers)), React__default.createElement("td", {
|
17465
17508
|
style: {
|
17466
17509
|
textAlign: "center",
|
17467
17510
|
color: "#414E62"
|
17468
17511
|
}
|
17469
|
-
}, renderAnswer(item
|
17512
|
+
}, renderAnswer(item.questionAnswerType, item.mostSelectedAnswers)), React__default.createElement("td", {
|
17470
17513
|
className: "" + printStyles["avoid-break-inside"]
|
17471
17514
|
}, React__default.createElement("div", {
|
17472
17515
|
className: styles$4["classification"] + " " + printStyles["avoid-break-inside"]
|
@@ -17833,6 +17876,24 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
17833
17876
|
return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
|
17834
17877
|
}).slice(0, limitQuestions);
|
17835
17878
|
}, [JSON.stringify(data.questions)]);
|
17879
|
+
var renderTextbookAnswer = function renderTextbookAnswer(type, answers, textualAnswers, isCorrect) {
|
17880
|
+
var _textualAnswers$;
|
17881
|
+
switch (type) {
|
17882
|
+
case exports.QuestionAnswerType.ShortAnswer:
|
17883
|
+
case exports.QuestionAnswerType.SynonymProcessing:
|
17884
|
+
return isCorrect ? textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(" | ") : (_textualAnswers$ = textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers[0]) != null ? _textualAnswers$ : "";
|
17885
|
+
case exports.QuestionAnswerType.SingleChoice:
|
17886
|
+
case exports.QuestionAnswerType.MultipleChoice:
|
17887
|
+
if (!(answers !== null && answers !== void 0 && answers.length)) return "";
|
17888
|
+
return answers.map(function (i) {
|
17889
|
+
return t("number_question", {
|
17890
|
+
number: i
|
17891
|
+
});
|
17892
|
+
}).join(",");
|
17893
|
+
default:
|
17894
|
+
return textualAnswers === null || textualAnswers === void 0 ? void 0 : textualAnswers.join(", ");
|
17895
|
+
}
|
17896
|
+
};
|
17836
17897
|
var renderAnswer = function renderAnswer(type, content) {
|
17837
17898
|
var _content$split, _content$split$map;
|
17838
17899
|
if (!content) return "";
|
@@ -17889,12 +17950,12 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
17889
17950
|
fontSize: "13px",
|
17890
17951
|
fontWeight: 500
|
17891
17952
|
}
|
17892
|
-
},
|
17953
|
+
}, typeof item.selectedAnswers === "string" ? renderAnswer(item.questionAnswerType, item.selectedAnswers) : renderTextbookAnswer(item.questionAnswerType, item.selectedAnswers, item.textualAnswers)), React__default.createElement("td", {
|
17893
17954
|
style: {
|
17894
17955
|
textAlign: "center",
|
17895
17956
|
color: styles$4.gray_700
|
17896
17957
|
}
|
17897
|
-
},
|
17958
|
+
}, typeof item.correctAnswers === "string" ? renderAnswer(item.questionAnswerType, item.correctAnswers) : renderTextbookAnswer(item.questionAnswerType, item.correctAnswers, item.correctTextualAnswers, true)), React__default.createElement("td", {
|
17898
17959
|
style: {
|
17899
17960
|
textAlign: "center",
|
17900
17961
|
color: styles$4.gray_700
|
@@ -17904,7 +17965,7 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
17904
17965
|
};
|
17905
17966
|
var renderQuestions = function renderQuestions(questions) {
|
17906
17967
|
return questions.map(function (question) {
|
17907
|
-
var _question$category
|
17968
|
+
var _question$category;
|
17908
17969
|
return React__default.createElement(material.Stack, {
|
17909
17970
|
direction: "row",
|
17910
17971
|
flexWrap: "nowrap",
|
@@ -17940,29 +18001,9 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
17940
18001
|
className: styles$4["span2"]
|
17941
18002
|
}, t("my_wrong_answer"))), React__default.createElement("div", null, React__default.createElement("span", {
|
17942
18003
|
className: styles$4["overallCorrectRate"]
|
17943
|
-
}, question.overallCorrectRate.toFixed(2), "%"),
|
17944
|
-
className: styles$4["answer"]
|
17945
|
-
}, React__default.createElement(MathJaxContainer, {
|
17946
|
-
content: question.selectedAnswers
|
17947
|
-
}), " ", t("answer"), " ", React__default.createElement(MathJaxContainer, {
|
17948
|
-
content: question.correctAnswers
|
17949
|
-
})) : question.questionAnswerType === exports.QuestionAnswerType.MultipleChoice ? React__default.createElement("span", {
|
17950
|
-
className: styles$4["answer"]
|
17951
|
-
}, (_question$selectedAns = question.selectedAnswers.split("|")) === null || _question$selectedAns === void 0 ? void 0 : (_question$selectedAns2 = _question$selectedAns.map(function (i) {
|
17952
|
-
return t("number_question", {
|
17953
|
-
number: i
|
17954
|
-
});
|
17955
|
-
})) === 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) {
|
17956
|
-
return t("number_question", {
|
17957
|
-
number: i
|
17958
|
-
});
|
17959
|
-
})) === null || _question$correctAnsw3 === void 0 ? void 0 : _question$correctAnsw3.join(","), ")") : React__default.createElement("span", {
|
18004
|
+
}, question.overallCorrectRate.toFixed(2), "%"), React__default.createElement("span", {
|
17960
18005
|
className: styles$4["answer"]
|
17961
|
-
}, t("
|
17962
|
-
number: question.selectedAnswers
|
17963
|
-
}), " (", t("answer"), " ", t("number_question", {
|
17964
|
-
number: question.correctAnswers
|
17965
|
-
}), ")"))));
|
18006
|
+
}, 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)))));
|
17966
18007
|
});
|
17967
18008
|
};
|
17968
18009
|
var handleToggle = function handleToggle() {
|
@@ -28715,6 +28756,16 @@ var QuestionView = function QuestionView(_ref2) {
|
|
28715
28756
|
return null;
|
28716
28757
|
}
|
28717
28758
|
};
|
28759
|
+
var answerTypeOptions = [{
|
28760
|
+
label: t("singlechoice"),
|
28761
|
+
value: exports.QuestionAnswerType.SingleChoice
|
28762
|
+
}, {
|
28763
|
+
label: t("multiplechoice"),
|
28764
|
+
value: exports.QuestionAnswerType.MultipleChoice
|
28765
|
+
}, {
|
28766
|
+
label: t("shortanswer"),
|
28767
|
+
value: exports.QuestionAnswerType.ShortAnswer
|
28768
|
+
}];
|
28718
28769
|
return React__default.createElement(material.Grid, {
|
28719
28770
|
container: true,
|
28720
28771
|
spacing: "16px"
|
@@ -28806,14 +28857,7 @@ var QuestionView = function QuestionView(_ref2) {
|
|
28806
28857
|
}, t("question_answer_type")), React__default.createElement(CustomSelect, {
|
28807
28858
|
isDisabled: isDisabled,
|
28808
28859
|
value: question.questionAnswerType,
|
28809
|
-
options:
|
28810
|
-
return Number.isNaN(+key);
|
28811
|
-
}).map(function (label, index) {
|
28812
|
-
return {
|
28813
|
-
label: t(label.toLowerCase()),
|
28814
|
-
value: index
|
28815
|
-
};
|
28816
|
-
}),
|
28860
|
+
options: answerTypeOptions,
|
28817
28861
|
onChange: function onChange(value) {
|
28818
28862
|
return onChangeQuestionAnswerType === null || onChangeQuestionAnswerType === void 0 ? void 0 : onChangeQuestionAnswerType(value === null || value === void 0 ? void 0 : value.value, index);
|
28819
28863
|
}
|
@@ -28846,14 +28890,7 @@ var QuestionView = function QuestionView(_ref2) {
|
|
28846
28890
|
}, t("question_answer_type")), React__default.createElement(CustomSelect, {
|
28847
28891
|
isDisabled: isDisabled,
|
28848
28892
|
value: question.questionAnswerType,
|
28849
|
-
options:
|
28850
|
-
return Number.isNaN(+key);
|
28851
|
-
}).map(function (label, index) {
|
28852
|
-
return {
|
28853
|
-
label: t(label.toLowerCase()),
|
28854
|
-
value: index
|
28855
|
-
};
|
28856
|
-
}),
|
28893
|
+
options: answerTypeOptions,
|
28857
28894
|
onChange: function onChange(value) {
|
28858
28895
|
return onChangeQuestionAnswerType === null || onChangeQuestionAnswerType === void 0 ? void 0 : onChangeQuestionAnswerType(value === null || value === void 0 ? void 0 : value.value, index);
|
28859
28896
|
}
|
@@ -33245,6 +33282,67 @@ var DefaultTextbookOwner = {
|
|
33245
33282
|
var DEFAULT_ANSWER_COUNT$2 = 5;
|
33246
33283
|
var DEFAULT_SCORE$1 = 2;
|
33247
33284
|
var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
33285
|
+
var quesitonSchema = yup.object({
|
33286
|
+
questionAnswerType: yup.mixed().oneOf(Object.values(exports.QuestionAnswerType), "invalid question answer type").required(t("question_answer_type_required")),
|
33287
|
+
numerOfAnswers: yup.array().of(yup.number()),
|
33288
|
+
correctAnswers: yup.array().of(yup.number()).when("questionAnswerType", {
|
33289
|
+
is: function is(answerType) {
|
33290
|
+
return !isTextType(answerType);
|
33291
|
+
},
|
33292
|
+
then: function then(schema) {
|
33293
|
+
return schema.min(2, t("question_answer_required"));
|
33294
|
+
},
|
33295
|
+
otherwise: function otherwise(schema) {
|
33296
|
+
return schema.notRequired();
|
33297
|
+
}
|
33298
|
+
}),
|
33299
|
+
score: yup.number().required(),
|
33300
|
+
questionOrder: yup.number().required(),
|
33301
|
+
questionTypeId: yup.number().notRequired(),
|
33302
|
+
correctTextualAnswers: yup.array().of(yup.string().trim().required(t("short_string_answer_cannot_be_empty"))).when("questionAnswerType", {
|
33303
|
+
is: function is(answerType) {
|
33304
|
+
return isTextType(answerType);
|
33305
|
+
},
|
33306
|
+
then: function then(schema) {
|
33307
|
+
return schema.min(1, t("question_answer_required"));
|
33308
|
+
},
|
33309
|
+
otherwise: function otherwise(schema) {
|
33310
|
+
return schema.notRequired();
|
33311
|
+
}
|
33312
|
+
}).when("questionAnswerType", {
|
33313
|
+
is: function is(answerType) {
|
33314
|
+
return isTextType(answerType) && answerType !== exports.QuestionAnswerType.ShortAnswer;
|
33315
|
+
},
|
33316
|
+
then: function then(schema) {
|
33317
|
+
return schema.min(2, t("question_answer_required"));
|
33318
|
+
}
|
33319
|
+
})
|
33320
|
+
});
|
33321
|
+
var questionGroupsSchema = yup.array().of(yup.object().shape({
|
33322
|
+
pageFrom: yup.number().notRequired().integer().notRequired().min(1, t("min_is_1")),
|
33323
|
+
pageTo: yup.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$parent = this === null || this === void 0 ? void 0 : this.parent,
|
33325
|
+
pageFrom = _this$parent.pageFrom;
|
33326
|
+
return !value || !pageFrom || value >= pageFrom;
|
33327
|
+
}),
|
33328
|
+
articles: yup.array().of(yup.object().shape({
|
33329
|
+
categories: yup.array().of(yup.number()).min(1, t("category_required")),
|
33330
|
+
title: yup.string().notRequired(),
|
33331
|
+
author: yup.string().notRequired(),
|
33332
|
+
subject: yup.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: yup.array().of(quesitonSchema)
|
33345
|
+
}));
|
33248
33346
|
return yup.object({
|
33249
33347
|
name: yup.string().required(t("name_required")),
|
33250
33348
|
subjectId: yup.number().required(t("subject_required")).notOneOf([0], t("subject_required")),
|
@@ -33262,36 +33360,12 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
|
33262
33360
|
chapters: yup.array().of(yup.object().shape({
|
33263
33361
|
pageFrom: yup.number().required(t("page_from_required")).integer().typeError(t("must_be_number")).min(1, t("min_is_1")),
|
33264
33362
|
pageTo: yup.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) {
|
33265
|
-
var _this$
|
33266
|
-
pageFrom = _this$
|
33363
|
+
var _this$parent2 = this === null || this === void 0 ? void 0 : this.parent,
|
33364
|
+
pageFrom = _this$parent2.pageFrom;
|
33267
33365
|
return value >= pageFrom;
|
33268
33366
|
}),
|
33269
33367
|
name: yup.string().required(t("name_required")),
|
33270
|
-
questionGroups:
|
33271
|
-
pageFrom: yup.number().notRequired().integer().notRequired().min(1, t("min_is_1")),
|
33272
|
-
pageTo: yup.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) {
|
33273
|
-
var _this$parent2 = this === null || this === void 0 ? void 0 : this.parent,
|
33274
|
-
pageFrom = _this$parent2.pageFrom;
|
33275
|
-
return !value || !pageFrom || value >= pageFrom;
|
33276
|
-
}),
|
33277
|
-
articles: yup.array().of(yup.object().shape({
|
33278
|
-
categories: yup.array().of(yup.number()).min(1, t("category_required")),
|
33279
|
-
title: yup.string().notRequired(),
|
33280
|
-
author: yup.string().notRequired(),
|
33281
|
-
subject: yup.string().notRequired()
|
33282
|
-
})).when("$type", {
|
33283
|
-
is: function is(type) {
|
33284
|
-
return type === 2;
|
33285
|
-
},
|
33286
|
-
then: function then(schema) {
|
33287
|
-
return schema.min(1, t("category_required"));
|
33288
|
-
},
|
33289
|
-
otherwise: function otherwise(schema) {
|
33290
|
-
return schema.min(1, t("article_required"));
|
33291
|
-
}
|
33292
|
-
}),
|
33293
|
-
questions: yup.array().of(yup.object())
|
33294
|
-
})),
|
33368
|
+
questionGroups: questionGroupsSchema,
|
33295
33369
|
subChapters: yup.array().of(yup.object().shape({
|
33296
33370
|
pageFrom: yup.number().required(t("page_from_required")).integer().typeError(t("must_be_number")).min(1, t("min_is_1")),
|
33297
33371
|
pageTo: yup.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) {
|
@@ -33300,31 +33374,7 @@ var preparedTextbookSchema = function preparedTextbookSchema(t) {
|
|
33300
33374
|
return value >= pageFrom;
|
33301
33375
|
}),
|
33302
33376
|
name: yup.string().required(t("name_required")),
|
33303
|
-
questionGroups:
|
33304
|
-
pageFrom: yup.number().notRequired().integer().notRequired().min(1, t("min_is_1")),
|
33305
|
-
pageTo: yup.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) {
|
33306
|
-
var _this$parent4 = this === null || this === void 0 ? void 0 : this.parent,
|
33307
|
-
pageFrom = _this$parent4.pageFrom;
|
33308
|
-
return !value || !pageFrom || value >= pageFrom;
|
33309
|
-
}),
|
33310
|
-
articles: yup.array().of(yup.object().shape({
|
33311
|
-
categories: yup.array().of(yup.number()).min(1, t("category_required")),
|
33312
|
-
title: yup.string().notRequired(),
|
33313
|
-
author: yup.string().notRequired(),
|
33314
|
-
subject: yup.string().notRequired()
|
33315
|
-
})).when("$type", {
|
33316
|
-
is: function is(type) {
|
33317
|
-
return type === 2;
|
33318
|
-
},
|
33319
|
-
then: function then(schema) {
|
33320
|
-
return schema.min(1, t("category_required"));
|
33321
|
-
},
|
33322
|
-
otherwise: function otherwise(schema) {
|
33323
|
-
return schema.min(1, t("article_required"));
|
33324
|
-
}
|
33325
|
-
}),
|
33326
|
-
questions: yup.array().of(yup.object())
|
33327
|
-
}))
|
33377
|
+
questionGroups: questionGroupsSchema
|
33328
33378
|
}))
|
33329
33379
|
})).required("chapter_required")
|
33330
33380
|
});
|
@@ -33358,7 +33408,7 @@ var DEFAULT_QUESTION = {
|
|
33358
33408
|
questionAnswerType: exports.QuestionAnswerType.SingleChoice,
|
33359
33409
|
questionOrder: 0,
|
33360
33410
|
score: DEFAULT_SCORE$1,
|
33361
|
-
|
33411
|
+
correctTextualAnswers: [""]
|
33362
33412
|
};
|
33363
33413
|
var DEFAULT_QUESTION_GROUP = {
|
33364
33414
|
answerCount: DEFAULT_ANSWER_COUNT$2,
|
@@ -33376,6 +33426,16 @@ var DEFAULT_ARTICLE = {
|
|
33376
33426
|
var DEFAULT_MATH_QUESTION_GROUP = _extends({}, DEFAULT_QUESTION_GROUP, {
|
33377
33427
|
articles: [DEFAULT_ARTICLE]
|
33378
33428
|
});
|
33429
|
+
var CompareTypeOptions = [{
|
33430
|
+
label: "order_matters",
|
33431
|
+
value: exports.QuestionAnswerType.OrderMatters
|
33432
|
+
}, {
|
33433
|
+
label: "order_does_not_matter",
|
33434
|
+
value: exports.QuestionAnswerType.OrderDoesNotMatters
|
33435
|
+
}, {
|
33436
|
+
label: "synonym_processing",
|
33437
|
+
value: exports.QuestionAnswerType.SynonymProcessing
|
33438
|
+
}];
|
33379
33439
|
|
33380
33440
|
var CustomTextbookTab = function CustomTextbookTab(props) {
|
33381
33441
|
var children = props.children,
|
@@ -33500,7 +33560,7 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
|
|
33500
33560
|
}),
|
33501
33561
|
questionCount: g.questions.length,
|
33502
33562
|
answerCount: ((_g$questions = g.questions) === null || _g$questions === void 0 ? void 0 : (_g$questions$find = _g$questions.find(function (q) {
|
33503
|
-
return q.questionAnswerType
|
33563
|
+
return !isTextType(q.questionAnswerType);
|
33504
33564
|
})) === null || _g$questions$find === void 0 ? void 0 : _g$questions$find.numberOfAnswers) || DEFAULT_ANSWER_COUNT$2
|
33505
33565
|
};
|
33506
33566
|
})) || [],
|
@@ -33545,7 +33605,7 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
|
|
33545
33605
|
}),
|
33546
33606
|
questionCount: g.questions.length,
|
33547
33607
|
answerCount: ((_g$questions2 = g.questions) === null || _g$questions2 === void 0 ? void 0 : (_g$questions2$find = _g$questions2.find(function (q) {
|
33548
|
-
return q.questionAnswerType
|
33608
|
+
return !isTextType(q.questionAnswerType);
|
33549
33609
|
})) === null || _g$questions2$find === void 0 ? void 0 : _g$questions2$find.numberOfAnswers) || DEFAULT_ANSWER_COUNT$2
|
33550
33610
|
};
|
33551
33611
|
})) || [],
|
@@ -33847,6 +33907,128 @@ var labelStyle = {
|
|
33847
33907
|
whiteSpace: "nowrap"
|
33848
33908
|
};
|
33849
33909
|
|
33910
|
+
var QuestionCompareType = function QuestionCompareType(_ref) {
|
33911
|
+
var value = _ref.value,
|
33912
|
+
onChange = _ref.onChange;
|
33913
|
+
var _useTranslation = reactI18next.useTranslation(),
|
33914
|
+
t = _useTranslation.t;
|
33915
|
+
return React__default.createElement(material.FormControl, {
|
33916
|
+
sx: {
|
33917
|
+
display: "flex",
|
33918
|
+
alignItems: "center",
|
33919
|
+
pl: "24px",
|
33920
|
+
mt: 1,
|
33921
|
+
gap: 1,
|
33922
|
+
flexDirection: "row",
|
33923
|
+
width: "100%"
|
33924
|
+
}
|
33925
|
+
}, React__default.createElement(material.FormLabel, {
|
33926
|
+
htmlFor: "compare-type",
|
33927
|
+
className: "" + styles$a["question-label"],
|
33928
|
+
sx: _extends({}, labelStyle, {
|
33929
|
+
width: "unset"
|
33930
|
+
})
|
33931
|
+
}, t("compare_type"), ":"), React__default.createElement(material.RadioGroup, {
|
33932
|
+
row: true,
|
33933
|
+
sx: {
|
33934
|
+
flexGrow: 1
|
33935
|
+
},
|
33936
|
+
"aria-labelledby": "compare-type",
|
33937
|
+
name: "row-radio-buttons-group",
|
33938
|
+
value: value,
|
33939
|
+
onChange: onChange
|
33940
|
+
}, React__default.createElement(ListView, {
|
33941
|
+
data: CompareTypeOptions,
|
33942
|
+
render: function render(_ref2) {
|
33943
|
+
var value = _ref2.value,
|
33944
|
+
label = _ref2.label;
|
33945
|
+
return React__default.createElement(material.FormControlLabel, {
|
33946
|
+
key: value,
|
33947
|
+
value: value,
|
33948
|
+
control: React__default.createElement(material.Radio, {
|
33949
|
+
size: "small",
|
33950
|
+
color: "success"
|
33951
|
+
}),
|
33952
|
+
label: React__default.createElement(material.Typography, {
|
33953
|
+
sx: {
|
33954
|
+
fontSize: "14px",
|
33955
|
+
fontWeight: 500
|
33956
|
+
},
|
33957
|
+
className: "truncate"
|
33958
|
+
}, t(label))
|
33959
|
+
});
|
33960
|
+
}
|
33961
|
+
})));
|
33962
|
+
};
|
33963
|
+
|
33964
|
+
var QuestionOrderName = function QuestionOrderName(_ref) {
|
33965
|
+
var questionTitleStyle = _ref.questionTitleStyle,
|
33966
|
+
isMath = _ref.isMath,
|
33967
|
+
questionOrder = _ref.questionOrder;
|
33968
|
+
var _useTranslation = reactI18next.useTranslation(),
|
33969
|
+
t = _useTranslation.t;
|
33970
|
+
return React__default.createElement(material.Box, {
|
33971
|
+
className: styles$a["question-title"] + " me-2 text-nowrap",
|
33972
|
+
sx: questionTitleStyle
|
33973
|
+
}, isMath ? t("problem_number_question", {
|
33974
|
+
number: questionOrder + 1
|
33975
|
+
}) : t("text_detail_n", {
|
33976
|
+
n: questionOrder + 1
|
33977
|
+
}));
|
33978
|
+
};
|
33979
|
+
|
33980
|
+
var QuestionShortInput = function QuestionShortInput(_ref) {
|
33981
|
+
var name = _ref.name,
|
33982
|
+
deletable = _ref.deletable,
|
33983
|
+
onDelete = _ref.onDelete;
|
33984
|
+
var _useTranslation = reactI18next.useTranslation(),
|
33985
|
+
t = _useTranslation.t;
|
33986
|
+
return React__default.createElement(formik.Field, {
|
33987
|
+
name: name,
|
33988
|
+
render: function render(_ref2) {
|
33989
|
+
var field = _ref2.field;
|
33990
|
+
return React__default.createElement(material.Box, {
|
33991
|
+
sx: {
|
33992
|
+
position: "relative"
|
33993
|
+
}
|
33994
|
+
}, React__default.createElement(material.TextField, Object.assign({}, field, {
|
33995
|
+
size: "small",
|
33996
|
+
fullWidth: true,
|
33997
|
+
placeholder: t("textual_answer"),
|
33998
|
+
onKeyDown: handleKeyDown,
|
33999
|
+
sx: {
|
34000
|
+
"& input": {
|
34001
|
+
paddingRight: deletable ? "40px" : undefined
|
34002
|
+
}
|
34003
|
+
}
|
34004
|
+
})), deletable && React__default.createElement(material.Stack, {
|
34005
|
+
justifyContent: "center",
|
34006
|
+
alignItems: "center",
|
34007
|
+
sx: {
|
34008
|
+
position: "absolute",
|
34009
|
+
top: "50%",
|
34010
|
+
right: 0,
|
34011
|
+
width: "40px",
|
34012
|
+
transform: "translateY(-50%)"
|
34013
|
+
}
|
34014
|
+
}, React__default.createElement(material.Box, {
|
34015
|
+
width: "fit-content"
|
34016
|
+
}, React__default.createElement(material.IconButton, {
|
34017
|
+
color: "default",
|
34018
|
+
size: "small",
|
34019
|
+
className: "bg-danger text-white",
|
34020
|
+
onClick: onDelete
|
34021
|
+
}, React__default.createElement(fa6.FaTrashCan, {
|
34022
|
+
size: 12
|
34023
|
+
})))));
|
34024
|
+
}
|
34025
|
+
});
|
34026
|
+
};
|
34027
|
+
var isEqual$1 = function isEqual(prev, next) {
|
34028
|
+
return prev.value === next.value && prev.name == next.name && prev.deletable == next.deletable;
|
34029
|
+
};
|
34030
|
+
var QuestionShortInput$1 = React.memo(QuestionShortInput, isEqual$1);
|
34031
|
+
|
33850
34032
|
var _excluded$h = ["onChange"];
|
33851
34033
|
var BpIcon$1 = material.styled("span")(function (_ref) {
|
33852
34034
|
var theme = _ref.theme;
|
@@ -33890,6 +34072,10 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
33890
34072
|
setFieldValue = _ref2.setFieldValue,
|
33891
34073
|
onCloseQuestionTypeMenu = _ref2.onCloseQuestionTypeMenu,
|
33892
34074
|
onOpenQuestionTypeMenu = _ref2.onOpenQuestionTypeMenu;
|
34075
|
+
var _useTranslation = reactI18next.useTranslation(),
|
34076
|
+
t = _useTranslation.t;
|
34077
|
+
var theme = material.useTheme();
|
34078
|
+
var isTabletUp = material.useMediaQuery(theme.breakpoints.up("lg"));
|
33893
34079
|
var handleCheckMultiChoice = function handleCheckMultiChoice(choice) {
|
33894
34080
|
var updatedAnswers = data.correctAnswers;
|
33895
34081
|
if (updatedAnswers.includes(choice)) {
|
@@ -33901,35 +34087,74 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
33901
34087
|
}
|
33902
34088
|
setFieldValue(path + ".correctAnswers", updatedAnswers);
|
33903
34089
|
};
|
34090
|
+
var handleAddTextualAnswer = function handleAddTextualAnswer() {
|
34091
|
+
data.correctTextualAnswers.length === 1 && setFieldValue(path + ".questionAnswerType", exports.QuestionAnswerType.OrderMatters);
|
34092
|
+
setFieldValue(path + ".correctTextualAnswers", [].concat(data.correctTextualAnswers, [""]));
|
34093
|
+
};
|
34094
|
+
var handleRemoveTextualAnswer = function handleRemoveTextualAnswer(remove, index) {
|
34095
|
+
data.correctTextualAnswers.length === 2 && setFieldValue(path + ".questionAnswerType", exports.QuestionAnswerType.ShortAnswer);
|
34096
|
+
remove(index);
|
34097
|
+
};
|
33904
34098
|
var handleChangeQuestionAnswerType = function handleChangeQuestionAnswerType(value) {
|
34099
|
+
switch (value === null || value === void 0 ? void 0 : value.value) {
|
34100
|
+
case exports.QuestionAnswerType.SingleChoice:
|
34101
|
+
case exports.QuestionAnswerType.MultipleChoice:
|
34102
|
+
setFieldValue(path + ".correctTextualAnswers", []);
|
34103
|
+
break;
|
34104
|
+
default:
|
34105
|
+
if (data.correctTextualAnswers.length === 0) setFieldValue(path + ".correctTextualAnswers", [""]);
|
34106
|
+
break;
|
34107
|
+
}
|
33905
34108
|
setFieldValue(path + ".questionAnswerType", (value === null || value === void 0 ? void 0 : value.value) || 0);
|
33906
34109
|
};
|
34110
|
+
var handleChangeCompareType = function handleChangeCompareType(_, value) {
|
34111
|
+
setFieldValue(path + ".questionAnswerType", Number(value) || 0);
|
34112
|
+
};
|
33907
34113
|
var handleOpenQuestionTypeMenu = function handleOpenQuestionTypeMenu() {
|
33908
34114
|
onOpenQuestionTypeMenu(path + ".questionTypeId");
|
33909
34115
|
};
|
34116
|
+
var isIncomplatedTextualAnswers = data.correctTextualAnswers.some(function (i) {
|
34117
|
+
return !i.trim();
|
34118
|
+
});
|
34119
|
+
var isTextAnswerType = isTextType(data.questionAnswerType);
|
33910
34120
|
var renderAnswer = function renderAnswer() {
|
33911
34121
|
switch (data.questionAnswerType) {
|
33912
34122
|
case exports.QuestionAnswerType.ShortAnswer:
|
33913
|
-
|
33914
|
-
|
33915
|
-
|
33916
|
-
|
33917
|
-
|
33918
|
-
|
33919
|
-
|
33920
|
-
|
33921
|
-
|
33922
|
-
|
33923
|
-
|
33924
|
-
|
33925
|
-
|
33926
|
-
|
33927
|
-
|
33928
|
-
|
33929
|
-
|
33930
|
-
|
33931
|
-
}
|
33932
|
-
|
34123
|
+
case exports.QuestionAnswerType.SynonymProcessing:
|
34124
|
+
case exports.QuestionAnswerType.OrderMatters:
|
34125
|
+
case exports.QuestionAnswerType.OrderDoesNotMatters:
|
34126
|
+
return React__default.createElement(formik.FieldArray, {
|
34127
|
+
name: path + ".correctTextualAnswers"
|
34128
|
+
}, function (_ref3) {
|
34129
|
+
var remove = _ref3.remove;
|
34130
|
+
return React__default.createElement(material.Stack, {
|
34131
|
+
sx: {
|
34132
|
+
pl: "24px",
|
34133
|
+
flexDirection: "row",
|
34134
|
+
gap: "8px",
|
34135
|
+
alignItems: "center"
|
34136
|
+
}
|
34137
|
+
}, React__default.createElement(material.Stack, {
|
34138
|
+
direction: "row",
|
34139
|
+
gap: "12px",
|
34140
|
+
flexWrap: "wrap"
|
34141
|
+
}, React__default.createElement(ListView, {
|
34142
|
+
data: data.correctTextualAnswers,
|
34143
|
+
render: function render(_, index) {
|
34144
|
+
return React__default.createElement(material.Box, {
|
34145
|
+
key: index,
|
34146
|
+
minWidth: "200px"
|
34147
|
+
}, React__default.createElement(QuestionShortInput$1, {
|
34148
|
+
value: data.correctTextualAnswers[index],
|
34149
|
+
name: path + ".correctTextualAnswers[" + index + "]",
|
34150
|
+
onDelete: function onDelete() {
|
34151
|
+
return handleRemoveTextualAnswer(remove, index);
|
34152
|
+
},
|
34153
|
+
deletable: data.correctTextualAnswers.length > 1
|
34154
|
+
}));
|
34155
|
+
}
|
34156
|
+
})));
|
34157
|
+
});
|
33933
34158
|
case exports.QuestionAnswerType.MultipleChoice:
|
33934
34159
|
return React__default.createElement(material.Grid, {
|
33935
34160
|
container: true
|
@@ -34006,18 +34231,16 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34006
34231
|
}
|
34007
34232
|
setFieldValue(path + ".questionType", val);
|
34008
34233
|
};
|
34009
|
-
var
|
34010
|
-
|
34011
|
-
|
34012
|
-
|
34013
|
-
|
34014
|
-
|
34015
|
-
|
34016
|
-
|
34017
|
-
|
34018
|
-
}
|
34019
|
-
var theme = material.useTheme();
|
34020
|
-
var isTabletUp = material.useMediaQuery(theme.breakpoints.up("lg"));
|
34234
|
+
var answerTypeOptions = [{
|
34235
|
+
label: t("singlechoice"),
|
34236
|
+
value: exports.QuestionAnswerType.SingleChoice
|
34237
|
+
}, {
|
34238
|
+
label: t("multiplechoice"),
|
34239
|
+
value: exports.QuestionAnswerType.MultipleChoice
|
34240
|
+
}, {
|
34241
|
+
label: t("shortanswer"),
|
34242
|
+
value: exports.QuestionAnswerType.ShortAnswer
|
34243
|
+
}];
|
34021
34244
|
return React__default.createElement(material.Stack, {
|
34022
34245
|
direction: "row",
|
34023
34246
|
alignItems: "center",
|
@@ -34028,19 +34251,50 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34028
34251
|
alignItems: "center",
|
34029
34252
|
minWidth: "50%",
|
34030
34253
|
flexGrow: 1
|
34031
|
-
}, React__default.createElement(material.Box, null, React__default.createElement(
|
34032
|
-
|
34033
|
-
|
34034
|
-
|
34035
|
-
|
34036
|
-
}) : t("text_detail_n", {
|
34037
|
-
n: data.questionOrder + 1
|
34038
|
-
}))), React__default.createElement(material.Box, {
|
34254
|
+
}, React__default.createElement(material.Box, null, React__default.createElement(QuestionOrderName, {
|
34255
|
+
questionOrder: data.questionOrder,
|
34256
|
+
isMath: isMath,
|
34257
|
+
questionTitleStyle: questionTitleStyle
|
34258
|
+
})), React__default.createElement(material.Box, {
|
34039
34259
|
flexGrow: 1
|
34040
|
-
},
|
34260
|
+
}, data.correctTextualAnswers.length > 1 && React__default.createElement(material.Box, null, React__default.createElement(QuestionCompareType, {
|
34261
|
+
value: data.questionAnswerType,
|
34262
|
+
onChange: handleChangeCompareType
|
34263
|
+
})), renderAnswer())), React__default.createElement(material.Stack, {
|
34264
|
+
gap: 1
|
34265
|
+
}, React__default.createElement(material.Stack, {
|
34041
34266
|
direction: "row",
|
34042
34267
|
gap: 2
|
34043
|
-
}, React__default.createElement(material.
|
34268
|
+
}, isTextAnswerType && React__default.createElement(material.FormGroup, null, React__default.createElement(material.FormLabel, {
|
34269
|
+
className: styles$a["question-label"] + " form-label",
|
34270
|
+
sx: _extends({}, labelStyle, {
|
34271
|
+
visibility: "hidden"
|
34272
|
+
})
|
34273
|
+
}, "hidden"), React__default.createElement(material.Stack, {
|
34274
|
+
flexGrow: 1,
|
34275
|
+
alignItems: "center",
|
34276
|
+
justifyContent: "center"
|
34277
|
+
}, React__default.createElement(material.IconButton, {
|
34278
|
+
disabled: isIncomplatedTextualAnswers,
|
34279
|
+
color: "default",
|
34280
|
+
size: "small",
|
34281
|
+
sx: {
|
34282
|
+
height: "fit-content",
|
34283
|
+
background: theme.palette.success.dark,
|
34284
|
+
color: '#fff',
|
34285
|
+
"&.Mui-disabled": {
|
34286
|
+
background: theme.palette.success.dark,
|
34287
|
+
opacity: "0.6"
|
34288
|
+
},
|
34289
|
+
"&:hover": {
|
34290
|
+
background: theme.palette.success.dark,
|
34291
|
+
opacity: "0.8"
|
34292
|
+
}
|
34293
|
+
},
|
34294
|
+
onClick: handleAddTextualAnswer
|
34295
|
+
}, React__default.createElement(io.IoIosAdd, {
|
34296
|
+
size: 20
|
34297
|
+
})))), React__default.createElement(material.FormGroup, {
|
34044
34298
|
sx: {
|
34045
34299
|
flexGrow: 1,
|
34046
34300
|
width: isTabletUp ? "120px" : "100px"
|
@@ -34099,15 +34353,15 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
34099
34353
|
render: function render(_ref6) {
|
34100
34354
|
var field = _ref6.field;
|
34101
34355
|
return React__default.createElement(CustomSelect, Object.assign({}, field, {
|
34102
|
-
value: data.questionAnswerType,
|
34356
|
+
value: data.questionAnswerType !== exports.QuestionAnswerType.SingleChoice && data.questionAnswerType !== exports.QuestionAnswerType.MultipleChoice ? exports.QuestionAnswerType.ShortAnswer : data.questionAnswerType,
|
34103
34357
|
isDisabled: disabled,
|
34104
34358
|
options: answerTypeOptions,
|
34105
34359
|
onChange: handleChangeQuestionAnswerType
|
34106
34360
|
}));
|
34107
34361
|
}
|
34108
|
-
}))));
|
34362
|
+
})))));
|
34109
34363
|
};
|
34110
|
-
var isEqual$
|
34364
|
+
var isEqual$2 = function isEqual(prev, next) {
|
34111
34365
|
var isPrevMatched = prev.optionKey === prev.path + ".questionTypeId";
|
34112
34366
|
var isNextMatched = next.optionKey === next.path + ".questionTypeId";
|
34113
34367
|
var prevOptionKey = isPrevMatched ? prev.optionKey : undefined;
|
@@ -34118,7 +34372,7 @@ var isEqual$1 = function isEqual(prev, next) {
|
|
34118
34372
|
var nextQuestionTypes = isNextMatched ? next.questionTypes : undefined;
|
34119
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;
|
34120
34374
|
};
|
34121
|
-
var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$
|
34375
|
+
var QuestionBlock$1 = React.memo(QuestionBlock, isEqual$2);
|
34122
34376
|
|
34123
34377
|
var _excluded$i = ["data", "path", "isMath", "open", "isLoadingCategories", "isLoadingQuestionTypes", "optionKey", "categories", "questionTypes", "disabled", "onQuestioStartOrderChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
34124
34378
|
var _$1 = _$6;
|
@@ -34147,6 +34401,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
34147
34401
|
var articles = data.articles,
|
34148
34402
|
questions = data.questions;
|
34149
34403
|
var blockErrors = _$1.get(errors, path);
|
34404
|
+
console.log(path + ": ", blockErrors);
|
34150
34405
|
var handleOpenQuestionTypeMenu = React.useCallback(function (key) {
|
34151
34406
|
var _data$articles$, _data$articles$$categ, _data$articles$2, _data$articles$2$cate;
|
34152
34407
|
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]);
|
@@ -34225,7 +34480,13 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
34225
34480
|
alignItems: "center",
|
34226
34481
|
gap: 1
|
34227
34482
|
}
|
34228
|
-
}, React__default.createElement(material.FormLabel,
|
34483
|
+
}, React__default.createElement(material.FormLabel, {
|
34484
|
+
sx: {
|
34485
|
+
fontWeight: 600
|
34486
|
+
},
|
34487
|
+
htmlFor: "start_order"
|
34488
|
+
}, i18n.t("start_order")), React__default.createElement(material.TextField, {
|
34489
|
+
id: "start_order",
|
34229
34490
|
inputRef: startOrderRef,
|
34230
34491
|
onChange: handleChangeStartQuestionOrder,
|
34231
34492
|
type: "number",
|
@@ -34252,7 +34513,7 @@ var QuestionGroupBlockBody = function QuestionGroupBlockBody(_ref) {
|
|
34252
34513
|
}
|
34253
34514
|
});
|
34254
34515
|
};
|
34255
|
-
var isEqual$
|
34516
|
+
var isEqual$3 = function isEqual(prev, next) {
|
34256
34517
|
var isPrevMatched = prev.optionKey.startsWith(prev.path);
|
34257
34518
|
var isNextMatched = next.optionKey.startsWith(next.path);
|
34258
34519
|
var prevOptionKey = isPrevMatched ? prev.optionKey : undefined;
|
@@ -34275,7 +34536,7 @@ var isEqual$2 = function isEqual(prev, next) {
|
|
34275
34536
|
var nextOnOpenQuestionTypeMenu = next.onOpenQuestionTypeMenu;
|
34276
34537
|
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;
|
34277
34538
|
};
|
34278
|
-
var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$
|
34539
|
+
var QuestionGroupBlockBody$1 = React.memo(QuestionGroupBlockBody, isEqual$3);
|
34279
34540
|
|
34280
34541
|
var _excluded$j = ["expandedIndex", "open", "paths", "path", "isMath", "data", "categories", "isLoadingCategories", "isLoadingQuestionTypes", "questionTypes", "optionKey", "disabled", "onToggle", "onQuestionCountChange", "onDelete", "onOpenSubCategoryMenu", "onOpenCategoryMenu", "onCloseCategoryMenu", "onCopiedPrevQuestionGroup", "onCloseQuestionTypeMenu", "onOpenQuestionTypeMenu"];
|
34281
34542
|
var _$2 = _$6;
|
@@ -34411,7 +34672,7 @@ var QuestionGroupBlock = function QuestionGroupBlock(_ref) {
|
|
34411
34672
|
expanded: open,
|
34412
34673
|
onChange: handleToggle,
|
34413
34674
|
sx: {
|
34414
|
-
border: (open ? "5px" : "1.5px") + " solid " + (blockErrors ? open ? error.main : error.light : open ? colors.yellow[900] : colors.yellow[
|
34675
|
+
border: (open ? "5px" : "1.5px") + " solid " + (blockErrors ? open ? error.main : error.light : open ? colors.yellow[900] : colors.yellow[700])
|
34415
34676
|
}
|
34416
34677
|
}, React__default.createElement(material.AccordionSummary, {
|
34417
34678
|
expandIcon: React__default.createElement(md.MdExpandMore, {
|
@@ -38184,6 +38445,7 @@ exports.getUtcDayOfWeek = getUtcDayOfWeek;
|
|
38184
38445
|
exports.i18n = i18n__default;
|
38185
38446
|
exports.includePathname = includePathname;
|
38186
38447
|
exports.isLocalHost = isLocalHost;
|
38448
|
+
exports.isTextType = isTextType;
|
38187
38449
|
exports.minutesToTimeSpan = minutesToTimeSpan;
|
38188
38450
|
exports.pushTo = pushTo;
|
38189
38451
|
exports.reset = reset;
|