touchstudy-core 0.1.134 → 0.1.136
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.
@@ -1,4 +1,100 @@
|
|
1
1
|
import { TextbookDetailResponse } from "./types";
|
2
2
|
export declare const reduceToMathArticles: (textbook: any, isMath?: number | undefined) => any;
|
3
|
-
export declare const
|
4
|
-
export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetailResponse | undefined) => import("./types").TextbookRequest
|
3
|
+
export declare const resetAllCategoriesAndQuestionTypesBySubject: (textbook: any, subject?: any) => any;
|
4
|
+
export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetailResponse | undefined) => import("./types").TextbookRequest | {
|
5
|
+
name: string;
|
6
|
+
subjectId: number;
|
7
|
+
subject: {
|
8
|
+
label: string;
|
9
|
+
value: number;
|
10
|
+
} | null;
|
11
|
+
preparedType: number;
|
12
|
+
grade: string;
|
13
|
+
publicationDate: string;
|
14
|
+
publisher: string;
|
15
|
+
isbn: string;
|
16
|
+
coverImage: string;
|
17
|
+
textbookOwners: import("./types").TextbookOwner[];
|
18
|
+
isPublic: boolean;
|
19
|
+
isPrepared: boolean;
|
20
|
+
type: number;
|
21
|
+
chapters: {
|
22
|
+
name: string;
|
23
|
+
pageFrom: number;
|
24
|
+
pageTo: number;
|
25
|
+
id: number;
|
26
|
+
questionGroups: {
|
27
|
+
id: number;
|
28
|
+
chapterId: number;
|
29
|
+
questions: {
|
30
|
+
questionTypeId: any;
|
31
|
+
questionType: {
|
32
|
+
label: any;
|
33
|
+
value: any;
|
34
|
+
} | null;
|
35
|
+
id: number;
|
36
|
+
numberOfAnswers: number;
|
37
|
+
correctAnswers: number[];
|
38
|
+
score: number;
|
39
|
+
questionOrder: number;
|
40
|
+
textualAnswer: string;
|
41
|
+
questionAnswerType: import("../../..").QuestionAnswerType;
|
42
|
+
questionTypeName?: string | undefined;
|
43
|
+
}[];
|
44
|
+
articles: {
|
45
|
+
categoryOptions: {
|
46
|
+
label: string;
|
47
|
+
value: number | undefined;
|
48
|
+
}[];
|
49
|
+
categories: number[];
|
50
|
+
id: number;
|
51
|
+
title: string;
|
52
|
+
author: string;
|
53
|
+
tag: string;
|
54
|
+
category?: import("./types").Category | undefined;
|
55
|
+
}[];
|
56
|
+
questionCount: number;
|
57
|
+
answerCount: number;
|
58
|
+
}[];
|
59
|
+
subChapters: {
|
60
|
+
name: string;
|
61
|
+
pageFrom: number;
|
62
|
+
pageTo: number;
|
63
|
+
id: number;
|
64
|
+
questionGroups: {
|
65
|
+
id: number;
|
66
|
+
chapterId: number;
|
67
|
+
questions: {
|
68
|
+
questionTypeId: number | undefined;
|
69
|
+
questionType: {
|
70
|
+
label: any;
|
71
|
+
value: any;
|
72
|
+
} | null;
|
73
|
+
id: number;
|
74
|
+
numberOfAnswers: number;
|
75
|
+
correctAnswers: number[];
|
76
|
+
score: number;
|
77
|
+
questionOrder: number;
|
78
|
+
textualAnswer: string;
|
79
|
+
questionAnswerType: import("../../..").QuestionAnswerType;
|
80
|
+
questionTypeName?: string | undefined;
|
81
|
+
}[];
|
82
|
+
articles: {
|
83
|
+
categoryOptions: {
|
84
|
+
label: string;
|
85
|
+
value: number | undefined;
|
86
|
+
}[];
|
87
|
+
categories: number[];
|
88
|
+
id: number;
|
89
|
+
title: string;
|
90
|
+
author: string;
|
91
|
+
tag: string;
|
92
|
+
category?: import("./types").Category | undefined;
|
93
|
+
}[];
|
94
|
+
questionCount: number;
|
95
|
+
answerCount: number;
|
96
|
+
}[];
|
97
|
+
subChapters: never[];
|
98
|
+
}[];
|
99
|
+
}[];
|
100
|
+
};
|
package/dist/index.js
CHANGED
@@ -28030,7 +28030,8 @@ var QuestionBlock = function QuestionBlock(_ref2) {
|
|
28030
28030
|
return React__default.createElement(material.FormGroup, {
|
28031
28031
|
sx: {
|
28032
28032
|
width: "100%",
|
28033
|
-
maxWidth: "240px"
|
28033
|
+
maxWidth: "240px",
|
28034
|
+
pl: "24px"
|
28034
28035
|
}
|
28035
28036
|
}, React__default.createElement(material.FormLabel, {
|
28036
28037
|
htmlFor: "textual_answer",
|
@@ -29158,11 +29159,14 @@ var QuestionTypeFilter = function QuestionTypeFilter(_ref) {
|
|
29158
29159
|
alignItems: "center"
|
29159
29160
|
}
|
29160
29161
|
}, React__default.createElement(material.Checkbox, {
|
29162
|
+
id: "fix",
|
29161
29163
|
inputRef: fixedRef
|
29162
29164
|
})), React__default.createElement(material.FormLabel, {
|
29165
|
+
htmlFor: "fix",
|
29163
29166
|
sx: {
|
29164
29167
|
display: "flex",
|
29165
|
-
alignItems: "center"
|
29168
|
+
alignItems: "center",
|
29169
|
+
cursor: "pointer"
|
29166
29170
|
}
|
29167
29171
|
}, t("fix_this_information_for_this_book")))));
|
29168
29172
|
};
|
@@ -29947,7 +29951,7 @@ var useSelect = function useSelect(_ref) {
|
|
29947
29951
|
};
|
29948
29952
|
|
29949
29953
|
var OwnerSelector = function OwnerSelector(_ref) {
|
29950
|
-
var
|
29954
|
+
var _values$textbookOwner, _errors$textbookOwner, _errors$textbookOwner2, _values$textbookOwner2, _errors$textbookOwner3, _errors$textbookOwner4;
|
29951
29955
|
var values = _ref.values,
|
29952
29956
|
errors = _ref.errors,
|
29953
29957
|
index = _ref.index,
|
@@ -29961,30 +29965,10 @@ var OwnerSelector = function OwnerSelector(_ref) {
|
|
29961
29965
|
handleChangeEmail: handleChangeEmail
|
29962
29966
|
}),
|
29963
29967
|
t = _useSelect.t,
|
29964
|
-
loadData = _useSelect.loadData,
|
29965
29968
|
isLoading = _useSelect.isLoading,
|
29966
29969
|
academyOptions = _useSelect.academyOptions,
|
29967
29970
|
courseOptions = _useSelect.courseOptions;
|
29968
|
-
return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.Stack, {
|
29969
|
-
flexDirection: "column",
|
29970
|
-
gap: 1,
|
29971
|
-
width: 1
|
29972
|
-
}, React__default.createElement("label", {
|
29973
|
-
htmlFor: "email"
|
29974
|
-
}, t("email")), React__default.createElement(formik.Field, {
|
29975
|
-
name: "textbookOwners[" + index + "].email",
|
29976
|
-
render: function render() {
|
29977
|
-
return React__default.createElement(material.TextField, {
|
29978
|
-
fullWidth: true,
|
29979
|
-
onChange: loadData
|
29980
|
-
});
|
29981
|
-
}
|
29982
|
-
}), !!(errors !== null && errors !== void 0 && (_errors$textbookOwner = errors.textbookOwners) !== null && _errors$textbookOwner !== void 0 && (_errors$textbookOwner2 = _errors$textbookOwner[index]) !== null && _errors$textbookOwner2 !== void 0 && _errors$textbookOwner2.email) && React__default.createElement(material.Typography, {
|
29983
|
-
fontWeight: 500,
|
29984
|
-
fontSize: "10px",
|
29985
|
-
lineHeight: "11.93px",
|
29986
|
-
color: !(errors !== null && errors !== void 0 && (_errors$textbookOwner3 = errors.textbookOwners) !== null && _errors$textbookOwner3 !== void 0 && (_errors$textbookOwner4 = _errors$textbookOwner3[index]) !== null && _errors$textbookOwner4 !== void 0 && _errors$textbookOwner4.email) ? "#97A1AF" : "#F34B4B"
|
29987
|
-
}, errors === null || errors === void 0 ? void 0 : (_errors$textbookOwner5 = errors.textbookOwners) === null || _errors$textbookOwner5 === void 0 ? void 0 : (_errors$textbookOwner6 = _errors$textbookOwner5[index]) === null || _errors$textbookOwner6 === void 0 ? void 0 : _errors$textbookOwner6.email)), (values === null || values === void 0 ? void 0 : (_values$textbookOwner = values.textbookOwners) === null || _values$textbookOwner === void 0 ? void 0 : _values$textbookOwner[index].email) && React__default.createElement(material.Stack, {
|
29971
|
+
return React__default.createElement(React__default.Fragment, null, (values === null || values === void 0 ? void 0 : (_values$textbookOwner = values.textbookOwners) === null || _values$textbookOwner === void 0 ? void 0 : _values$textbookOwner[index].email) && React__default.createElement(material.Stack, {
|
29988
29972
|
flexDirection: "column",
|
29989
29973
|
gap: 1,
|
29990
29974
|
width: 1
|
@@ -30003,7 +29987,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
|
|
30003
29987
|
}
|
30004
29988
|
}));
|
30005
29989
|
}
|
30006
|
-
}), !!(errors !== null && errors !== void 0 && (_errors$
|
29990
|
+
}), !!(errors !== null && errors !== void 0 && (_errors$textbookOwner = errors.textbookOwners) !== null && _errors$textbookOwner !== void 0 && (_errors$textbookOwner2 = _errors$textbookOwner[index]) !== null && _errors$textbookOwner2 !== void 0 && _errors$textbookOwner2.academyId) && React__default.createElement(material.Typography, {
|
30007
29991
|
fontWeight: 500,
|
30008
29992
|
fontSize: "10px",
|
30009
29993
|
lineHeight: "11.93px",
|
@@ -30027,7 +30011,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
|
|
30027
30011
|
}
|
30028
30012
|
}));
|
30029
30013
|
}
|
30030
|
-
}), !!(errors !== null && errors !== void 0 && (_errors$
|
30014
|
+
}), !!(errors !== null && errors !== void 0 && (_errors$textbookOwner3 = errors.textbookOwners) !== null && _errors$textbookOwner3 !== void 0 && (_errors$textbookOwner4 = _errors$textbookOwner3[index]) !== null && _errors$textbookOwner4 !== void 0 && _errors$textbookOwner4.courseId) && React__default.createElement(material.Typography, {
|
30031
30015
|
fontWeight: 500,
|
30032
30016
|
fontSize: "10px",
|
30033
30017
|
lineHeight: "11.93px",
|
@@ -30151,7 +30135,7 @@ var _reduceToMathArticles = function reduceToMathArticles(textbook, isMath) {
|
|
30151
30135
|
}
|
30152
30136
|
return values;
|
30153
30137
|
};
|
30154
|
-
var
|
30138
|
+
var _resetAllCategoriesAndQuestionTypesBySubject = function resetAllCategoriesAndQuestionTypesBySubject(textbook, subject) {
|
30155
30139
|
var values = subject ? _$5.cloneDeep(textbook) : textbook;
|
30156
30140
|
if (subject) {
|
30157
30141
|
values.subjectId = subject === null || subject === void 0 ? void 0 : subject.value;
|
@@ -30164,7 +30148,7 @@ var _resetAllCrategoriesAndQuestionTypesBySubject = function resetAllCrategories
|
|
30164
30148
|
} else if (key === "questionType" || key === "questionTypeId") {
|
30165
30149
|
values[key] = null;
|
30166
30150
|
} else if (typeof values[key] === "object" && values[key] !== null) {
|
30167
|
-
|
30151
|
+
_resetAllCategoriesAndQuestionTypesBySubject(values[key]);
|
30168
30152
|
}
|
30169
30153
|
}
|
30170
30154
|
}
|
@@ -30205,7 +30189,7 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
|
|
30205
30189
|
questions: g.questions.map(function (q) {
|
30206
30190
|
var _q$questionType;
|
30207
30191
|
return _extends({}, q, {
|
30208
|
-
questionTypeId: q.questionTypeId,
|
30192
|
+
questionTypeId: q.questionTypeId || q.questionType.id,
|
30209
30193
|
questionType: (_q$questionType = q.questionType) !== null && _q$questionType !== void 0 && _q$questionType.id ? {
|
30210
30194
|
label: q.questionType.name,
|
30211
30195
|
value: q.questionType.id
|
@@ -30311,7 +30295,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
|
|
30311
30295
|
setValues(newValues);
|
30312
30296
|
};
|
30313
30297
|
var handleChangeSubject = function handleChangeSubject(val) {
|
30314
|
-
var newValues =
|
30298
|
+
var newValues = _resetAllCategoriesAndQuestionTypesBySubject(values, val);
|
30315
30299
|
setValues(newValues);
|
30316
30300
|
};
|
30317
30301
|
var inforErrors = errors.coverImage || errors.grade || errors.isbn || errors.preparedType || errors.publicationDate || errors.publisher;
|