touchstudy-core 0.1.135 → 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
3
  export declare const resetAllCategoriesAndQuestionTypesBySubject: (textbook: any, subject?: any) => any;
4
- export declare const convertResponseToRequest: (selectedTextbook?: TextbookDetailResponse | undefined) => import("./types").TextbookRequest;
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
@@ -29951,7 +29951,7 @@ var useSelect = function useSelect(_ref) {
29951
29951
  };
29952
29952
 
29953
29953
  var OwnerSelector = function OwnerSelector(_ref) {
29954
- var _errors$textbookOwner, _errors$textbookOwner2, _errors$textbookOwner3, _errors$textbookOwner4, _errors$textbookOwner5, _errors$textbookOwner6, _values$textbookOwner, _errors$textbookOwner7, _errors$textbookOwner8, _values$textbookOwner2, _errors$textbookOwner9, _errors$textbookOwner10;
29954
+ var _values$textbookOwner, _errors$textbookOwner, _errors$textbookOwner2, _values$textbookOwner2, _errors$textbookOwner3, _errors$textbookOwner4;
29955
29955
  var values = _ref.values,
29956
29956
  errors = _ref.errors,
29957
29957
  index = _ref.index,
@@ -29965,30 +29965,10 @@ var OwnerSelector = function OwnerSelector(_ref) {
29965
29965
  handleChangeEmail: handleChangeEmail
29966
29966
  }),
29967
29967
  t = _useSelect.t,
29968
- loadData = _useSelect.loadData,
29969
29968
  isLoading = _useSelect.isLoading,
29970
29969
  academyOptions = _useSelect.academyOptions,
29971
29970
  courseOptions = _useSelect.courseOptions;
29972
- return React__default.createElement(React__default.Fragment, null, React__default.createElement(material.Stack, {
29973
- flexDirection: "column",
29974
- gap: 1,
29975
- width: 1
29976
- }, React__default.createElement("label", {
29977
- htmlFor: "email"
29978
- }, t("email")), React__default.createElement(formik.Field, {
29979
- name: "textbookOwners[" + index + "].email",
29980
- render: function render() {
29981
- return React__default.createElement(material.TextField, {
29982
- fullWidth: true,
29983
- onChange: loadData
29984
- });
29985
- }
29986
- }), !!(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, {
29987
- fontWeight: 500,
29988
- fontSize: "10px",
29989
- lineHeight: "11.93px",
29990
- 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"
29991
- }, 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, {
29992
29972
  flexDirection: "column",
29993
29973
  gap: 1,
29994
29974
  width: 1
@@ -30007,7 +29987,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
30007
29987
  }
30008
29988
  }));
30009
29989
  }
30010
- }), !!(errors !== null && errors !== void 0 && (_errors$textbookOwner7 = errors.textbookOwners) !== null && _errors$textbookOwner7 !== void 0 && (_errors$textbookOwner8 = _errors$textbookOwner7[index]) !== null && _errors$textbookOwner8 !== void 0 && _errors$textbookOwner8.academyId) && React__default.createElement(material.Typography, {
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, {
30011
29991
  fontWeight: 500,
30012
29992
  fontSize: "10px",
30013
29993
  lineHeight: "11.93px",
@@ -30031,7 +30011,7 @@ var OwnerSelector = function OwnerSelector(_ref) {
30031
30011
  }
30032
30012
  }));
30033
30013
  }
30034
- }), !!(errors !== null && errors !== void 0 && (_errors$textbookOwner9 = errors.textbookOwners) !== null && _errors$textbookOwner9 !== void 0 && (_errors$textbookOwner10 = _errors$textbookOwner9[index]) !== null && _errors$textbookOwner10 !== void 0 && _errors$textbookOwner10.courseId) && React__default.createElement(material.Typography, {
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, {
30035
30015
  fontWeight: 500,
30036
30016
  fontSize: "10px",
30037
30017
  lineHeight: "11.93px",
@@ -30209,7 +30189,7 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
30209
30189
  questions: g.questions.map(function (q) {
30210
30190
  var _q$questionType;
30211
30191
  return _extends({}, q, {
30212
- questionTypeId: q.questionTypeId,
30192
+ questionTypeId: q.questionTypeId || q.questionType.id,
30213
30193
  questionType: (_q$questionType = q.questionType) !== null && _q$questionType !== void 0 && _q$questionType.id ? {
30214
30194
  label: q.questionType.name,
30215
30195
  value: q.questionType.id