touchstudy-core 0.1.178 → 0.1.180

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.
Files changed (71) hide show
  1. package/dist/components/Filters/QuestionTypeFilterComponent.d.ts +11 -0
  2. package/dist/components/Filters/configs/constants.d.ts +25 -0
  3. package/dist/components/Questions/ArticleBlock.d.ts +20 -0
  4. package/dist/components/Questions/QuestionBlock.d.ts +19 -0
  5. package/dist/components/Questions/QuestionCompareType.d.ts +13 -0
  6. package/dist/components/Questions/QuestionGroupBlock.d.ts +28 -0
  7. package/dist/components/Questions/QuestionGroupBlockBody.d.ts +23 -0
  8. package/dist/components/Questions/QuestionOrderName.d.ts +9 -0
  9. package/dist/components/Questions/QuestionShortInput.d.ts +13 -0
  10. package/dist/components/Questions/configs/constants.d.ts +12 -0
  11. package/dist/components/Questions/configs/fns.d.ts +7 -0
  12. package/dist/components/Questions/configs/types.d.ts +6 -0
  13. package/dist/components/Questions/index.d.ts +13 -0
  14. package/dist/components/Questions/styles/styles.d.ts +6 -0
  15. package/dist/components/Selectors/configs/constants.d.ts +5 -0
  16. package/dist/components/index.d.ts +1 -0
  17. package/dist/containers/ExamResult/components/MonthGroupedExamSessions/ExamSessionItem.d.ts +12 -0
  18. package/dist/containers/ExamResult/components/MonthGroupedExamSessions/GeneralExamItem.d.ts +9 -0
  19. package/dist/containers/ExamResult/components/MonthGroupedExamSessions/MonthGroupedExamSessionItem.d.ts +19 -0
  20. package/dist/containers/ExamResult/components/MonthGroupedExamSessions/index.d.ts +3 -0
  21. package/dist/containers/ExamResult/configs/constants.d.ts +0 -14
  22. package/dist/containers/ExamResult/configs/functions.d.ts +2 -0
  23. package/dist/containers/ExamResult/configs/types.d.ts +22 -2
  24. package/dist/containers/ExamResult/index.d.ts +5 -0
  25. package/dist/containers/Exams/components/ArticleBlock.d.ts +20 -0
  26. package/dist/containers/Exams/components/ExamDetailForm.d.ts +10 -0
  27. package/dist/containers/Exams/components/QuestionBlock.d.ts +13 -5
  28. package/dist/containers/Exams/components/QuestionCompareType.d.ts +9 -0
  29. package/dist/containers/Exams/components/QuestionGroupBlock.d.ts +17 -8
  30. package/dist/containers/Exams/components/QuestionGroupBlockBody.d.ts +2 -3
  31. package/dist/containers/Exams/components/QuestionOrderName.d.ts +9 -0
  32. package/dist/containers/Exams/components/QuestionShortInput.d.ts +6 -3
  33. package/dist/containers/Exams/configs/constants.d.ts +21 -3
  34. package/dist/containers/Exams/configs/enums.d.ts +4 -0
  35. package/dist/containers/Exams/configs/functions.d.ts +3 -1
  36. package/dist/containers/Exams/configs/interfaces.d.ts +6 -5
  37. package/dist/containers/Exams/hooks/useExamDetailView.d.ts +7 -25
  38. package/dist/containers/Exams/index.d.ts +1 -2
  39. package/dist/containers/Exams/views/ExamDetailView.d.ts +1 -1
  40. package/dist/containers/PreparedTextbook/configs/constants.d.ts +1 -58
  41. package/dist/containers/PreparedTextbook/configs/enums.d.ts +0 -16
  42. package/dist/containers/PreparedTextbook/configs/functions.d.ts +1 -5
  43. package/dist/containers/PreparedTextbook/configs/types.d.ts +0 -13
  44. package/dist/containers/Select/Subject/hook/useSubjectSelect.d.ts +2 -6
  45. package/dist/containers/Textbooks/apiClient/examSessionService.d.ts +1 -2
  46. package/dist/containers/Textbooks/configs/constants.d.ts +0 -2
  47. package/dist/containers/Textbooks/views/index.d.ts +1 -2
  48. package/dist/index.css +29 -156
  49. package/dist/index.js +21863 -24840
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.modern.js +21832 -24831
  52. package/dist/index.modern.js.map +1 -1
  53. package/dist/layouts/Header.d.ts +1 -1
  54. package/dist/layouts/TimerCountItem.d.ts +1 -0
  55. package/dist/services/categoryService.d.ts +4 -0
  56. package/dist/services/questionTypeService.d.ts +2 -0
  57. package/dist/services/subjectService.d.ts +0 -4
  58. package/dist/theme/palette.d.ts +0 -1
  59. package/dist/utils/enums/index.d.ts +2 -2
  60. package/dist/utils/enums/schoolType.d.ts +16 -0
  61. package/dist/utils/functions/common.d.ts +3 -0
  62. package/dist/utils/functions/timeSpanToMinutes.d.ts +1 -0
  63. package/dist/utils/functions/times.d.ts +0 -1
  64. package/dist/utils/hooks/useCategoryOptions.d.ts +15 -0
  65. package/dist/utils/index.d.ts +1 -1
  66. package/dist/utils/types/QuestionTypeFilter.d.ts +7 -0
  67. package/dist/utils/types/examResults.d.ts +1 -0
  68. package/dist/utils/types/exams.d.ts +82 -18
  69. package/dist/utils/types/index.d.ts +2 -1
  70. package/dist/utils/types/subjects.d.ts +2 -0
  71. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ import React, { Dispatch, FC, RefObject } from "react";
2
+ import { QuestionTypeFilter } from "../../utils/types";
3
+ interface Props {
4
+ inputRef: RefObject<HTMLInputElement>;
5
+ fixedRef: RefObject<HTMLInputElement>;
6
+ filter: QuestionTypeFilter;
7
+ setFilter: Dispatch<React.SetStateAction<QuestionTypeFilter>>;
8
+ fixLabel: string;
9
+ }
10
+ declare const QuestionTypeFilterComponent: FC<Props>;
11
+ export default QuestionTypeFilterComponent;
@@ -0,0 +1,25 @@
1
+ import { HighSchoolGrade } from "../../../utils/enums/schoolType";
2
+ export declare const SCHOOL_OPTIONS: {
3
+ label: string;
4
+ value: number;
5
+ }[];
6
+ export declare const SEMESTER_OPTIONS: {
7
+ label: string | number;
8
+ value: number;
9
+ }[];
10
+ export declare const CHAPTERS_OPTIONS: {
11
+ label: string | number;
12
+ value: number;
13
+ }[];
14
+ export declare const ELEMANTARY_GRADES: {
15
+ label: string | number;
16
+ value: number;
17
+ }[];
18
+ export declare const MIDDLE_GRADES: {
19
+ label: string | number;
20
+ value: number;
21
+ }[];
22
+ export declare const HIGH_GRADES: {
23
+ label: string;
24
+ value: HighSchoolGrade;
25
+ }[];
@@ -0,0 +1,20 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ import { FormikProps } from "formik";
3
+ import { ArticleRequest } from "../../utils/types";
4
+ interface Props<T> extends PropsWithChildren, FormikProps<T> {
5
+ isMath: boolean;
6
+ expandedIndex: number;
7
+ data: ArticleRequest;
8
+ path: string;
9
+ categories: any[];
10
+ isLoadingCategories: boolean;
11
+ optionKey: string;
12
+ disabled?: boolean;
13
+ onDuplicate: (data: ArticleRequest) => void;
14
+ onDelete: (text: string, confirmText: string, path: string, index: number) => void;
15
+ onOpenSubCategoryMenu: (path: string, id?: number) => void;
16
+ onOpenCategoryMenu: (path: string) => void;
17
+ onCloseCategoryMenu: () => void;
18
+ }
19
+ declare const _default: React.NamedExoticComponent<Props<any>>;
20
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ import { SxProps, Theme } from "@mui/material";
3
+ import { FormikProps } from "formik";
4
+ import { QuestionRequest } from "../../utils/types";
5
+ interface Props<T> extends PropsWithChildren, FormikProps<T> {
6
+ data: QuestionRequest;
7
+ answerCount: number;
8
+ path: string;
9
+ isMath: boolean;
10
+ disabled?: boolean;
11
+ questionTitleStyle?: SxProps<Theme>;
12
+ optionKey: string;
13
+ isLoadingQuestionTypes: boolean;
14
+ questionTypes: any[];
15
+ onOpenQuestionTypeMenu: (key: string) => void;
16
+ onCloseQuestionTypeMenu: () => void;
17
+ }
18
+ declare const _default: React.NamedExoticComponent<Props<any>>;
19
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import React, { CSSProperties, FC } from "react";
2
+ import { SxProps, Theme } from "@mui/material";
3
+ import { QuestionAnswerType } from "../../utils";
4
+ interface Props {
5
+ value: QuestionAnswerType;
6
+ disabled?: boolean;
7
+ sx?: SxProps<Theme>;
8
+ itemSx?: SxProps<Theme>;
9
+ labelStyles?: CSSProperties;
10
+ onChange: (e: React.ChangeEvent<HTMLInputElement>, value: any) => void;
11
+ }
12
+ declare const QuestionCompareType: FC<Props>;
13
+ export default QuestionCompareType;
@@ -0,0 +1,28 @@
1
+ import { FC } from "react";
2
+ import { FormikProps } from "formik";
3
+ import { QuestionGroupRequest } from "../../utils/types";
4
+ interface Props<T> extends FormikProps<T> {
5
+ data: QuestionGroupRequest;
6
+ expandedIndex: number;
7
+ open: boolean;
8
+ paths: number[];
9
+ path: string;
10
+ isMath: boolean;
11
+ categories: any[];
12
+ isLoadingCategories: boolean;
13
+ isLoadingQuestionTypes: boolean;
14
+ questionTypes: any[];
15
+ optionKey: string;
16
+ disabled?: boolean;
17
+ onToggle: (index: number) => void;
18
+ onQuestionCountChange: (count: number, index: number) => void;
19
+ onDelete: (text: string, confirmText: string, path: string, index: number) => void;
20
+ onOpenSubCategoryMenu: (path: string, id?: number) => void;
21
+ onOpenCategoryMenu: (path: string) => void;
22
+ onCloseCategoryMenu: () => void;
23
+ onCopiedPrevQuestionGroup: (path: string, paths: number[]) => QuestionGroupRequest | undefined;
24
+ onOpenQuestionTypeMenu: (path: string, categoryId?: number, subCategoryId?: number) => void;
25
+ onCloseQuestionTypeMenu: () => void;
26
+ }
27
+ declare const QuestionGroupBlock: FC<Props<any>>;
28
+ export default QuestionGroupBlock;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { FormikProps } from "formik";
3
+ import { QuestionGroupRequest } from "../../utils/types";
4
+ interface Props<T> extends FormikProps<T> {
5
+ path: string;
6
+ isMath: boolean;
7
+ open: boolean;
8
+ data: QuestionGroupRequest;
9
+ isLoadingCategories: boolean;
10
+ optionKey: string;
11
+ categories: any[];
12
+ isLoadingQuestionTypes: boolean;
13
+ questionTypes: any[];
14
+ disabled?: boolean;
15
+ onDelete: (text: string, confirmText: string, path: string, index: number) => void;
16
+ onOpenSubCategoryMenu: (path: string, id?: number) => void;
17
+ onOpenCategoryMenu: (path: string) => void;
18
+ onCloseCategoryMenu: () => void;
19
+ onOpenQuestionTypeMenu: (path: string, categoryId?: number, subCategoryId?: number) => void;
20
+ onCloseQuestionTypeMenu: () => void;
21
+ }
22
+ declare const _default: React.NamedExoticComponent<Props<any>>;
23
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { SxProps, Theme } from "@mui/material";
3
+ interface Props {
4
+ questionOrder: number;
5
+ isMath: boolean;
6
+ questionTitleStyle?: SxProps<Theme>;
7
+ }
8
+ declare const QuestionOrderName: FC<Props>;
9
+ export default QuestionOrderName;
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { FormikErrors } from "formik";
3
+ import { ExamFormRequest } from "../../utils";
4
+ interface Props {
5
+ name: string;
6
+ value: string;
7
+ disabled?: boolean;
8
+ deletable?: boolean;
9
+ errors: FormikErrors<ExamFormRequest>;
10
+ onDelete: () => void;
11
+ }
12
+ declare const _default: React.NamedExoticComponent<Props>;
13
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import { QuestionAnswerType } from "../../../utils";
2
+ import { ArticleRequest, QuestionGroupRequest, QuestionRequest } from "../../../utils/types";
3
+ export declare const CompareTypeOptions: {
4
+ label: string;
5
+ value: QuestionAnswerType;
6
+ }[];
7
+ export declare const DEFAULT_ANSWER_COUNT = 5;
8
+ export declare const DEFAULT_SCORE = 2;
9
+ export declare const DEFAULT_QUESTION: QuestionRequest;
10
+ export declare const DEFAULT_QUESTION_GROUP: QuestionGroupRequest;
11
+ export declare const DEFAULT_ARTICLE: ArticleRequest;
12
+ export declare const DEFAULT_MATH_QUESTION_GROUP: QuestionGroupRequest;
@@ -0,0 +1,7 @@
1
+ import { QuestionGroupRequest } from "../../../utils/types";
2
+ export declare const isSequentialQuestionGroups: (questionGroups: QuestionGroupRequest[]) => boolean;
3
+ export declare const getQuestionGroupsAfterQuestionCountChanged: (questionGroups: QuestionGroupRequest[], questionCount: number, index: number, checkSequential?: boolean | undefined) => QuestionGroupRequest[] | undefined;
4
+ export declare const getPreviousQuestinGroupCategory: (values: any, key: string, paths: number[]) => any;
5
+ export declare const generateNewQuestionGroup: (questionGroups: QuestionGroupRequest[], isMath: boolean) => QuestionGroupRequest;
6
+ export declare const reduceToMathArticles: (data: any, isMath?: number | undefined) => any;
7
+ export declare const resetAllCategoriesAndQuestionTypesBySubject: (data: any, subject?: any) => any;
@@ -0,0 +1,6 @@
1
+ export declare type DeleteDialogData = {
2
+ confirmText: string;
3
+ text: string;
4
+ path: string;
5
+ itemIndex: number;
6
+ };
@@ -0,0 +1,13 @@
1
+ import ArticleBlock from "./ArticleBlock";
2
+ import { DeleteDialogData } from "./configs/types";
3
+ import QuestionBlock from "./QuestionBlock";
4
+ import QuestionCompareType from "./QuestionCompareType";
5
+ import QuestionGroupBlock from "./QuestionGroupBlock";
6
+ import QuestionGroupBlockBody from "./QuestionGroupBlockBody";
7
+ import QuestionOrderName from "./QuestionOrderName";
8
+ import QuestionShortInput from "./QuestionShortInput";
9
+ import { labelStyle } from "./styles/styles";
10
+ export { labelStyle, QuestionCompareType, QuestionOrderName, QuestionGroupBlock, QuestionShortInput, QuestionBlock, ArticleBlock, QuestionGroupBlockBody };
11
+ export type { DeleteDialogData };
12
+ export * from "./configs/constants";
13
+ export * from "./configs/fns";
@@ -0,0 +1,6 @@
1
+ export declare const labelStyle: {
2
+ textOverflow: string;
3
+ overflowX: string;
4
+ width: string;
5
+ whiteSpace: string;
6
+ };
@@ -1,4 +1,9 @@
1
+ import { QuestionAnswerType } from "../../../utils";
1
2
  export declare const SCORE_OPTIONS: number[];
2
3
  export declare const QUESTION_OPTIONS: number[];
3
4
  export declare const ANSWER_OPTIONS: number[];
4
5
  export declare const DEFAULT_SCORE = 2;
6
+ export declare const answerTypeOptions: (t: any) => {
7
+ label: any;
8
+ value: QuestionAnswerType;
9
+ }[];
@@ -16,4 +16,5 @@ export * from "./Chats";
16
16
  export * from "./List";
17
17
  export * from "./Tables";
18
18
  export * from "./TinyMCE";
19
+ export * from "./Questions";
19
20
  export { AdapterMoment, DateCalendar, MathJaxContainer, DayCalendarSkeleton, DemoContainer, LocalizationProvider, PickersDay, DatePicker, TimePicker, PrintExamView2 };
@@ -0,0 +1,12 @@
1
+ import { MouseEvent } from "react";
2
+ import { FC } from "react";
3
+ import { ExamSessionResponse } from "../../configs/types";
4
+ interface Props {
5
+ isSelected: boolean;
6
+ isPrintSelected?: (code: string) => boolean;
7
+ session: ExamSessionResponse;
8
+ onViewResult: (code: string) => void;
9
+ onSelectPrint?: (e: MouseEvent<any>, code: string) => void;
10
+ }
11
+ declare const ExamSessionItem: FC<Props>;
12
+ export default ExamSessionItem;
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { ExamSessionResponse } from "../../configs/types";
3
+ interface Props {
4
+ isSelected: boolean;
5
+ session: ExamSessionResponse;
6
+ onViewResult: (code: string) => void;
7
+ }
8
+ declare const GeneralExamItem: FC<Props>;
9
+ export default GeneralExamItem;
@@ -0,0 +1,19 @@
1
+ import { MouseEvent } from "react";
2
+ import { FC } from "react";
3
+ import { ExamSessionResponse } from "../../configs/types";
4
+ import { Role } from "../../../../utils";
5
+ interface Props {
6
+ role: Role;
7
+ activeCode?: string;
8
+ examSessions: ExamSessionResponse[];
9
+ date: string;
10
+ index: number;
11
+ open: boolean;
12
+ itemActive: boolean;
13
+ isPrintSelected?: (code: string) => boolean;
14
+ onSelectPrint?: (e: MouseEvent<any>, code: string) => void;
15
+ onToggle: (index: number) => void;
16
+ onViewResult: (code: string) => void;
17
+ }
18
+ declare const MonthGroupedExamSessionItem: FC<Props>;
19
+ export default MonthGroupedExamSessionItem;
@@ -0,0 +1,3 @@
1
+ import ExamSessionItem from "./ExamSessionItem";
2
+ import MonthGroupedExamSessionItem from "./MonthGroupedExamSessionItem";
3
+ export { ExamSessionItem, MonthGroupedExamSessionItem };
@@ -1,6 +1,4 @@
1
- import { ExamResult } from "../../../utils/types/examResults";
2
1
  import { NoteSearchQuery } from "../../Notes/configs/types";
3
- import { EffectSize, LongTimeSpendQuestion, TimelyOrderQuestion } from "./types";
4
2
  export declare const DEFAULT_NOTE_FILTER: NoteSearchQuery;
5
3
  export declare const ORDER_NUMBERS: any;
6
4
  export declare const TabList: {
@@ -12,18 +10,6 @@ export declare enum Roles {
12
10
  Teacher = "Teacher",
13
11
  Admin = "Admin"
14
12
  }
15
- export declare const EXAM_RESULT: ExamResult;
16
- export declare const LONGTIME_SPEND_QUESTIONS: LongTimeSpendQuestion[];
17
- export declare const EFFECT_SIZE_QUESTIONS: EffectSize[];
18
- export declare const TIMELY_ORDER_QUESTIONS: TimelyOrderQuestion[];
19
- export declare const CATEGORY_RESPONSES: {
20
- id: number;
21
- name: string;
22
- totalQuestions: number;
23
- totalCorrectQuestions: number;
24
- totalAnsweredQuestions: number;
25
- percentageAmongStudents: number;
26
- }[];
27
13
  export declare const DEFAULT_LINE_CHART_OPTIONS: {
28
14
  colors: string[];
29
15
  chart: {
@@ -1,3 +1,5 @@
1
+ import { ExamSessionResponse } from "./types";
1
2
  export declare const toNumberOrder: (value: number) => string;
2
3
  export declare const formatDuration: (t: any, duration: number) => any;
3
4
  export declare const formatQuestionOrder: (index: number, t: any, language?: string | undefined) => any;
5
+ export declare const groupMonth: (exams: ExamSessionResponse[]) => {} | undefined;
@@ -9,8 +9,8 @@ export declare type EffectSize = {
9
9
  questionOrder: number;
10
10
  article: number;
11
11
  isCorrect: boolean;
12
- selectedAnswers?: number[] | string;
13
- correctAnswers?: number[] | string;
12
+ selectedAnswers?: number[];
13
+ correctAnswers?: number[];
14
14
  correctTextualAnswers?: string[];
15
15
  textualAnswers?: string[];
16
16
  answerResponseSignal: number | null;
@@ -105,3 +105,23 @@ export declare type ExamResultV2Props = {
105
105
  onLoadingChange?: (isLoading: boolean) => void;
106
106
  onViewQA?: (studentId: number, sessionId?: number, questionId?: number, isTextbook?: boolean) => void;
107
107
  };
108
+ export declare type ExamSessionResponse = {
109
+ code: string;
110
+ createdAt: string;
111
+ id: number;
112
+ duration: number;
113
+ examCreatedAt: string;
114
+ examId: number;
115
+ questionCount: number;
116
+ score: number;
117
+ startTime: string;
118
+ status: number;
119
+ teacher: any;
120
+ title: string;
121
+ totalStudentsJoined: number;
122
+ type: string;
123
+ courseName: string;
124
+ };
125
+ export declare type GroupedExamSession = {
126
+ [key: string]: ExamSessionResponse[];
127
+ };
@@ -1,3 +1,8 @@
1
1
  import ExamResultV2 from "./views/ExamResultV2";
2
2
  import PrintExamResultView from "./views/PrintExamResultView";
3
+ import { ExamSessionResponse, GroupedExamSession } from "./configs/types";
4
+ import { groupMonth } from "./configs/functions";
5
+ export * from "./components/MonthGroupedExamSessions";
3
6
  export { ExamResultV2, PrintExamResultView };
7
+ export type { ExamSessionResponse, GroupedExamSession };
8
+ export { groupMonth };
@@ -0,0 +1,20 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ import { FormikProps } from "formik";
3
+ import { ArticleRequest, ExamFormRequest } from "../../../utils/types";
4
+ interface Props extends PropsWithChildren, FormikProps<ExamFormRequest> {
5
+ isMath: boolean;
6
+ expandedIndex: number;
7
+ data: ArticleRequest;
8
+ path: string;
9
+ categories: any[];
10
+ isLoadingCategories: boolean;
11
+ optionKey: string;
12
+ disabled?: boolean;
13
+ onDuplicate: (data: ArticleRequest) => void;
14
+ onDelete: (text: string, confirmText: string, path: string, index: number) => void;
15
+ onOpenSubCategoryMenu: (path: string, id?: number) => void;
16
+ onOpenCategoryMenu: (path: string) => void;
17
+ onCloseCategoryMenu: () => void;
18
+ }
19
+ declare const _default: React.NamedExoticComponent<Props>;
20
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { FormikProps } from "formik";
2
+ import { FC } from "react";
3
+ import { ExamFormRequest, ExamResponse } from "../../../utils/types";
4
+ interface Props extends FormikProps<ExamFormRequest> {
5
+ className?: string;
6
+ disabled?: boolean;
7
+ exam?: ExamResponse;
8
+ }
9
+ declare const ExamDetailForm: FC<Props>;
10
+ export default ExamDetailForm;
@@ -1,11 +1,19 @@
1
1
  import React, { PropsWithChildren } from "react";
2
- import { QuestionResponse } from "../../../utils";
3
- interface Props extends PropsWithChildren {
4
- data: QuestionResponse;
2
+ import { SxProps, Theme } from "@mui/material";
3
+ import { FormikProps } from "formik";
4
+ import { ExamFormRequest, QuestionRequest } from "../../../utils/types";
5
+ interface Props extends PropsWithChildren, FormikProps<ExamFormRequest> {
6
+ data: QuestionRequest;
5
7
  answerCount: number;
8
+ path: string;
9
+ isMath: boolean;
6
10
  disabled?: boolean;
7
- index: number;
8
- onChangeQuestion: (questionIndex: number, question: QuestionResponse) => void;
11
+ questionTitleStyle?: SxProps<Theme>;
12
+ optionKey: string;
13
+ isLoadingQuestionTypes: boolean;
14
+ questionTypes: any[];
15
+ onOpenQuestionTypeMenu: (key: string) => void;
16
+ onCloseQuestionTypeMenu: () => void;
9
17
  }
10
18
  declare const _default: React.NamedExoticComponent<Props>;
11
19
  export default _default;
@@ -0,0 +1,9 @@
1
+ import React, { FC } from "react";
2
+ import { QuestionAnswerType } from "../../../utils";
3
+ interface Props {
4
+ value: QuestionAnswerType;
5
+ disabled?: boolean;
6
+ onChange: (e: React.ChangeEvent<HTMLInputElement>, value: any) => void;
7
+ }
8
+ declare const QuestionCompareType: FC<Props>;
9
+ export default QuestionCompareType;
@@ -1,19 +1,28 @@
1
1
  import { FC } from "react";
2
- import { ArticleGroup, QuestionResponse } from "../../../utils/types";
3
- interface Props {
4
- data: ArticleGroup;
2
+ import { FormikProps } from "formik";
3
+ import { ExamFormRequest, QuestionGroupRequest } from "../../../utils/types";
4
+ interface Props extends FormikProps<ExamFormRequest> {
5
+ data: QuestionGroupRequest;
5
6
  expandedIndex: number;
6
7
  open: boolean;
8
+ paths: number[];
9
+ path: string;
10
+ isMath: boolean;
7
11
  categories: any[];
8
12
  isLoadingCategories: boolean;
9
- optionKeyIndex?: number;
13
+ isLoadingQuestionTypes: boolean;
14
+ questionTypes: any[];
15
+ optionKey: string;
10
16
  disabled?: boolean;
11
- deletable?: boolean;
12
17
  onToggle: (index: number) => void;
13
- onDelete: (article: number) => void;
14
- onOpenCategoryMenu: (index: number) => void;
18
+ onQuestionCountChange: (count: number, index: number) => void;
19
+ onDelete: (text: string, confirmText: string, path: string, index: number) => void;
20
+ onOpenSubCategoryMenu: (path: string, id?: number) => void;
21
+ onOpenCategoryMenu: (path: string) => void;
15
22
  onCloseCategoryMenu: () => void;
16
- onChangeQuestions: (articleNumber: number, questions: QuestionResponse[]) => void;
23
+ onCopiedPrevQuestionGroup: (path: string, paths: number[]) => QuestionGroupRequest | undefined;
24
+ onOpenQuestionTypeMenu: (path: string, categoryId?: number, subCategoryId?: number) => void;
25
+ onCloseQuestionTypeMenu: () => void;
17
26
  }
18
27
  declare const QuestionGroupBlock: FC<Props>;
19
28
  export default QuestionGroupBlock;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { FormikProps } from "formik";
3
- import { QuestionGroupRequest, TextbookRequest } from "../configs/types";
4
- interface Props extends FormikProps<TextbookRequest> {
3
+ import { ExamFormRequest, QuestionGroupRequest } from "../../../utils/types";
4
+ interface Props extends FormikProps<ExamFormRequest> {
5
5
  path: string;
6
6
  isMath: boolean;
7
7
  open: boolean;
@@ -12,7 +12,6 @@ interface Props extends FormikProps<TextbookRequest> {
12
12
  isLoadingQuestionTypes: boolean;
13
13
  questionTypes: any[];
14
14
  disabled?: boolean;
15
- onQuestioStartOrderChange: (order: number) => void;
16
15
  onDelete: (text: string, confirmText: string, path: string, index: number) => void;
17
16
  onOpenSubCategoryMenu: (path: string, id?: number) => void;
18
17
  onOpenCategoryMenu: (path: string) => void;
@@ -0,0 +1,9 @@
1
+ import { FC } from "react";
2
+ import { SxProps, Theme } from "@mui/material";
3
+ interface Props {
4
+ questionOrder: number;
5
+ isMath: boolean;
6
+ questionTitleStyle?: SxProps<Theme>;
7
+ }
8
+ declare const QuestionOrderName: FC<Props>;
9
+ export default QuestionOrderName;
@@ -1,9 +1,12 @@
1
- import React, { ChangeEvent } from "react";
1
+ import React from "react";
2
+ import { FormikErrors } from "formik";
3
+ import { ExamFormRequest } from "../../../utils/types";
2
4
  interface Props {
3
- index: number;
5
+ name: string;
4
6
  value: string;
7
+ disabled?: boolean;
5
8
  deletable?: boolean;
6
- onChange: (e: ChangeEvent<HTMLInputElement>, index: number) => void;
9
+ errors: FormikErrors<ExamFormRequest>;
7
10
  onDelete: () => void;
8
11
  }
9
12
  declare const _default: React.NamedExoticComponent<Props>;
@@ -1,4 +1,22 @@
1
- import { Exam } from "../../../utils/types";
1
+ import { ExamFormRequest } from "../../../utils/types";
2
+ import * as yup from "yup";
2
3
  export declare const DURATION_OPTIONS: number[];
3
- export declare const DEFAULT_ANSWER_COUNT = 5;
4
- export declare const DEFAULT_EXAM: Exam;
4
+ export declare const DEFAULT_EXAM: ExamFormRequest;
5
+ export declare const examSchema: (t: any) => yup.ObjectSchema<{
6
+ title: string;
7
+ subjectId: number;
8
+ duration: number | undefined;
9
+ type: number | undefined;
10
+ questionGroups: {
11
+ questions: any;
12
+ articles: any;
13
+ pageFrom: any;
14
+ pageTo: any;
15
+ }[] | undefined;
16
+ }, yup.AnyObject, {
17
+ title: undefined;
18
+ subjectId: undefined;
19
+ duration: undefined;
20
+ type: undefined;
21
+ questionGroups: "";
22
+ }, "">;
@@ -0,0 +1,4 @@
1
+ export declare enum ExamEditorType {
2
+ Korea = 0,
3
+ Math = 1
4
+ }
@@ -1 +1,3 @@
1
- export declare const handleKeyDown: (e: any) => void;
1
+ import { ExamResponse } from "../../../utils";
2
+ import { ExamFormRequest } from "../../../utils/types";
3
+ export declare const convertResponseToRequest: (selectedExam?: ExamResponse | undefined) => ExamFormRequest;
@@ -1,8 +1,9 @@
1
- import { Exam } from "../../../utils/types";
1
+ import { RefObject } from "react";
2
+ import { ExamFormRequest, ExamRequest, ExamResponse } from "../../../utils/types";
3
+ import { FormikProps } from "formik";
2
4
  export interface ExamDetailViewProps {
5
+ formRef: RefObject<FormikProps<ExamFormRequest>>;
3
6
  className?: string;
4
- exam: Exam;
5
- isDisabled?: boolean;
6
- isEdit?: boolean;
7
- onChangeExam: (value: Exam) => void;
7
+ exam?: ExamResponse;
8
+ onSave?: (val: ExamRequest) => void;
8
9
  }
@@ -1,28 +1,10 @@
1
- import { ChangeEvent } from "react";
2
- import { Category } from "../../Select/Category/configs/types";
3
- import { ArticleGroup, Exam } from "../../../utils";
4
- interface Props {
5
- exam: Exam;
6
- onChangeExam: (value: Exam) => void;
7
- }
8
- declare const useExamDetailView: (props: Props) => {
1
+ import { ExamFormRequest, ExamRequest, ExamResponse } from "../../../utils/types";
2
+ import { FormikHelpers } from "formik";
3
+ declare const useExamDetailView: (onSave?: ((val: ExamRequest) => void) | undefined, exam?: ExamResponse | undefined) => {
9
4
  t: any;
10
- categoryList: Category[];
11
- durationOptions: {
12
- label: any;
13
- value: number;
14
- }[];
15
- examGroupByArticle: ArticleGroup[];
16
- handleAddArticle: () => void;
17
- handleChangeScoreAnswer: (article: number, index: number, score: number) => void;
18
- handleChangeTitle: (e: ChangeEvent<HTMLInputElement>) => void;
19
- handleChangeTextualAnswer: (article: number, index: number, value: string) => void;
20
- handleChangeQuestionAnswerType: (article: number, index: number, value: number) => void;
21
- handleChangeDuration: (value: any) => void;
22
- handleChangeCorrectAnswers: (article: number, index: number, answer: number[]) => void;
23
- handleChangeAnswerCount: (article: number, newAnswerCount: number, answerCount: number) => void;
24
- handleChangeQuestionCount: (article: number, questionCount: number, answerCount: number) => void;
25
- handleChangeCategory: (article: number, categoryId: number) => void;
26
- handleDeleteArticle: (article: number) => void;
5
+ isReadonly: boolean;
6
+ isEditable: any;
7
+ open: typeof open;
8
+ handleSubmit: (values: ExamFormRequest, _formikHelpers: FormikHelpers<ExamFormRequest>) => Promise<void>;
27
9
  };
28
10
  export default useExamDetailView;
@@ -1,4 +1,3 @@
1
1
  import ExamDetailView from "./views/ExamDetailView";
2
2
  import { ExamDetailViewProps } from "./configs/interfaces";
3
- import ArticleGroupView from "./components/ArticleGroupView";
4
- export { ArticleGroupView, ExamDetailView, ExamDetailViewProps };
3
+ export { ExamDetailView, ExamDetailViewProps };
@@ -1,4 +1,4 @@
1
1
  import { FC } from "react";
2
- import { ExamDetailViewProps } from '../configs/interfaces';
2
+ import { ExamDetailViewProps } from "../configs/interfaces";
3
3
  declare const ExamDetailView: FC<ExamDetailViewProps>;
4
4
  export default ExamDetailView;