touchstudy-core 0.1.72 → 0.1.74

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 (32) hide show
  1. package/dist/components/Loading/LoadingComponent.d.ts +4 -2
  2. package/dist/containers/ExamResult/components/Charts/TimeOrderChart.d.ts +10 -0
  3. package/dist/containers/ExamResult/components/CompareGrass/index.d.ts +0 -1
  4. package/dist/containers/ExamResult/components/Dialog/PrintDialog.d.ts +6 -0
  5. package/dist/containers/ExamResult/components/GradesByTerritory/index.d.ts +3 -5
  6. package/dist/containers/ExamResult/components/LoadingDots.d.ts +6 -0
  7. package/dist/containers/ExamResult/components/MyAnswer/index.d.ts +1 -2
  8. package/dist/containers/ExamResult/components/ProtractedProblem/index.d.ts +4 -5
  9. package/dist/containers/ExamResult/components/TrickyProblem/index.d.ts +4 -5
  10. package/dist/containers/ExamResult/components/Vulnerable/index.d.ts +4 -5
  11. package/dist/containers/ExamResult/configs/functions.d.ts +1 -0
  12. package/dist/containers/ExamResult/configs/types.d.ts +13 -0
  13. package/dist/containers/ExamResult/hooks/useExamResult.d.ts +16 -6
  14. package/dist/containers/ExamResult/hooks/usePrintExamResult.d.ts +10 -0
  15. package/dist/containers/ExamResult/hooks/usePrintView.d.ts +8 -0
  16. package/dist/containers/ExamResult/views/ExamResultView.d.ts +11 -0
  17. package/dist/containers/ExamResult/views/PrintExamResult.d.ts +19 -0
  18. package/dist/containers/ExamResult/views/PrintExamResultView.d.ts +12 -0
  19. package/dist/containers/ExamResult/views/PrintPdfExamResult.d.ts +12 -0
  20. package/dist/containers/Exams/components/ArticleGroupView.d.ts +2 -0
  21. package/dist/containers/Exams/hooks/useExamDetailView.d.ts +2 -2
  22. package/dist/containers/Select/Category/hook/useCategorySelect.d.ts +2 -1
  23. package/dist/containers/Select/Subject/hook/useSubjectSelect.d.ts +6 -2
  24. package/dist/index.css +33 -0
  25. package/dist/index.d.ts +2 -1
  26. package/dist/index.js +819 -924
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.modern.js +816 -923
  29. package/dist/index.modern.js.map +1 -1
  30. package/dist/layouts/LayoutContext.d.ts +1 -0
  31. package/dist/utils/hooks/useLayoutContext.d.ts +1 -1
  32. package/package.json +2 -2
@@ -1,6 +1,8 @@
1
- import { FC } from "react";
2
- interface Props {
1
+ import { FC, PropsWithChildren } from "react";
2
+ interface Props extends PropsWithChildren {
3
3
  isLoading: boolean;
4
+ spinClassName?: string;
5
+ className?: string;
4
6
  }
5
7
  declare const LoadingComponent: FC<Props>;
6
8
  export default LoadingComponent;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ import { TimelyOrderQuestion } from "../../configs/types";
3
+ interface Props {
4
+ timelyOrderQuestion: TimelyOrderQuestion;
5
+ options: any;
6
+ series: any;
7
+ setIsRendered: (articleNumber: number) => void;
8
+ }
9
+ declare const TimeOrderChart: FC<Props>;
10
+ export default TimeOrderChart;
@@ -2,7 +2,6 @@ import { FC } from "react";
2
2
  import { EffectSize } from "../../configs/types";
3
3
  interface Props {
4
4
  effectSize: EffectSize[];
5
- isPrint?: boolean;
6
5
  }
7
6
  declare const CompareGrass: FC<Props>;
8
7
  export default CompareGrass;
@@ -0,0 +1,6 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ interface Props extends PropsWithChildren {
3
+ onPrint: any;
4
+ }
5
+ declare const PrintDialog: FC<Props>;
6
+ export default PrintDialog;
@@ -1,11 +1,9 @@
1
1
  import { FC } from "react";
2
- import { CategoryResponse, ExamResult } from "../../configs/types";
2
+ import { CategoryResponse, ExamResult, ProblemKey } from "../../configs/types";
3
3
  interface Props {
4
- keyOpen: string;
5
4
  data: CategoryResponse[];
6
- openProblem: string;
7
- changeOpen: any;
8
- isPrint?: boolean;
5
+ openProblem?: ProblemKey;
6
+ changeOpen?: (key?: ProblemKey) => void;
9
7
  resultData: ExamResult;
10
8
  isMyStoryStudent?: boolean;
11
9
  }
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ interface Props {
3
+ text: string;
4
+ }
5
+ declare const LoadingDots: FC<Props>;
6
+ export default LoadingDots;
@@ -4,7 +4,6 @@ interface Props {
4
4
  data: ExamResult;
5
5
  categories: CategoryResponse[];
6
6
  isStudent: boolean;
7
- isPrint?: boolean;
8
7
  }
9
- export default function MyAnswer({ data, categories, isStudent, isPrint }: Props): React.JSX.Element;
8
+ export default function MyAnswer({ data, categories, isStudent }: Props): React.JSX.Element;
10
9
  export {};
@@ -1,11 +1,10 @@
1
1
  import { FC } from "react";
2
- import { LongTimeSpendQuestion } from "../../configs/types";
2
+ import { LongTimeSpendQuestion, ProblemKey } from "../../configs/types";
3
3
  interface Props {
4
4
  data: LongTimeSpendQuestion[];
5
- keyOpen: string;
6
- openProblem: string;
7
- changeOpen: any;
8
- isPrint?: boolean;
5
+ keyOpen: ProblemKey;
6
+ openProblem?: ProblemKey;
7
+ changeOpen?: (key?: ProblemKey) => void;
9
8
  isMyStoryStudent?: boolean;
10
9
  }
11
10
  declare const ProtractedProblem: FC<Props>;
@@ -1,11 +1,10 @@
1
1
  import { FC } from "react";
2
- import { ExamResult } from "../../configs/types";
2
+ import { ExamResult, ProblemKey } from "../../configs/types";
3
3
  interface Props {
4
4
  data: ExamResult;
5
- keyOpen: string;
6
- openProblem: string;
7
- changeOpen: any;
8
- isPrint?: boolean;
5
+ keyOpen: ProblemKey;
6
+ openProblem?: ProblemKey;
7
+ changeOpen?: (key?: ProblemKey) => void;
9
8
  }
10
9
  declare const TrickyProblem: FC<Props>;
11
10
  export default TrickyProblem;
@@ -1,11 +1,10 @@
1
1
  import { FC } from "react";
2
- import { ExamResult } from "../../configs/types";
2
+ import { ExamResult, ProblemKey } from "../../configs/types";
3
3
  interface Props {
4
- keyOpen: string;
4
+ keyOpen: ProblemKey;
5
5
  data: ExamResult;
6
- openProblem: string;
7
- changeOpen: any;
8
- isPrint?: boolean;
6
+ openProblem?: ProblemKey;
7
+ changeOpen?: (key?: ProblemKey) => void;
9
8
  isMyStoryStudent?: boolean;
10
9
  }
11
10
  declare const Vulnerable: FC<Props>;
@@ -1,2 +1,3 @@
1
1
  export declare const toNumberOrder: (value: number) => string;
2
2
  export declare const formatDuration: (t: any, duration: number) => any;
3
+ export declare const formatQuestionOrder: (index: number, t: any, language?: string | undefined) => any;
@@ -51,6 +51,7 @@ export declare type Student = {
51
51
  phoneNumber: string;
52
52
  roles: string[];
53
53
  schoolName: string;
54
+ fullName: string;
54
55
  };
55
56
  export declare type ExamResult = {
56
57
  description: string;
@@ -104,3 +105,15 @@ export declare type LongTimeSpendQuestion = {
104
105
  duration: any;
105
106
  topDuration?: any;
106
107
  };
108
+ export declare enum ProblemKey {
109
+ TrickyProblem = 0,
110
+ ProtractedProblem = 1,
111
+ GradesByTerritory = 2,
112
+ Vulnerable = 3
113
+ }
114
+ export declare enum PrintState {
115
+ Default = 0,
116
+ Printing = 1,
117
+ Pending = 2,
118
+ Printed = 3
119
+ }
@@ -1,7 +1,17 @@
1
1
  /// <reference types="react" />
2
- import { CategoryResponse, EffectSize, ExamResult, LongTimeSpendQuestion, TimelyOrderQuestion } from "../configs/types";
3
- declare const useExamResult: (searchParam: string, history: any, examSessionId: number | undefined, studentId: number | undefined, code: string | undefined, handleChangeTab: (newValue: number) => void, selectedTab: number) => {
4
- isLoading: boolean;
2
+ import { CategoryResponse, EffectSize, ExamResult, LongTimeSpendQuestion, ProblemKey, TimelyOrderQuestion } from "../configs/types";
3
+ interface Props {
4
+ history?: any;
5
+ searchParams: string;
6
+ examSessionId: number;
7
+ studentId: number;
8
+ code?: string;
9
+ handleChangeTab?: (val: number) => void;
10
+ selectedTab?: number;
11
+ isPrint?: boolean;
12
+ }
13
+ declare const useExamResult: (props: Props) => {
14
+ isLoading: boolean | undefined;
5
15
  examTime: string;
6
16
  series: {
7
17
  name: any;
@@ -178,12 +188,12 @@ declare const useExamResult: (searchParam: string, history: any, examSessionId:
178
188
  effectSize: EffectSize[] | undefined;
179
189
  longTimeSpend: LongTimeSpendQuestion[];
180
190
  timelyOrderQuestions: TimelyOrderQuestion[];
181
- openProblem: string;
191
+ openProblem: ProblemKey | undefined;
182
192
  categoryResponses: CategoryResponse[];
183
- setOpenProblem: import("react").Dispatch<import("react").SetStateAction<string>>;
193
+ errorMessage: string | undefined;
194
+ setOpenProblem: import("react").Dispatch<import("react").SetStateAction<ProblemKey | undefined>>;
184
195
  handlePrevChart: () => void;
185
196
  handleNextChart: () => void;
186
197
  handleExit: () => void;
187
- handleExportPdf: () => Promise<void>;
188
198
  };
189
199
  export default useExamResult;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import { PrintState } from "../configs/types";
3
+ declare const usePrintExamResult: (isDataFetching: boolean | undefined, fileName: string, totalChart: number, onSuccess?: (() => void) | undefined, onError?: ((message?: string | undefined) => void) | undefined, autoPrint?: boolean) => {
4
+ contentRef: import("react").RefObject<HTMLElement>;
5
+ printState: PrintState;
6
+ setRenderedChart: (chart: number) => void;
7
+ handlePrintPdf: () => void;
8
+ reset: () => void;
9
+ };
10
+ export default usePrintExamResult;
@@ -0,0 +1,8 @@
1
+ import { ExamResult } from "../configs/types";
2
+ declare const usePrintView: (examSessionId: number, studentId: number, setNotFound?: Function | undefined, resultData?: ExamResult | undefined, isLoading?: boolean | undefined, errorMessage?: string | undefined) => {
3
+ fileName: string;
4
+ isDone: boolean;
5
+ handelPrintSuccess: () => void;
6
+ handelPrintError: (errorMessage?: string | undefined) => void;
7
+ };
8
+ export default usePrintView;
@@ -0,0 +1,11 @@
1
+ import { FC } from "react";
2
+ declare type Props = {
3
+ searchParams: string;
4
+ history: any;
5
+ examSessionId?: number;
6
+ studentId?: number;
7
+ code?: string;
8
+ isMyStoryStudent?: boolean;
9
+ };
10
+ declare const ExamResultV2: FC<Props>;
11
+ export default ExamResultV2;
@@ -0,0 +1,19 @@
1
+ import { FC, RefObject } from "react";
2
+ import { CategoryResponse, EffectSize, ExamResult, LongTimeSpendQuestion, TimelyOrderQuestion } from "../configs/types";
3
+ interface Props {
4
+ contentRef: RefObject<HTMLElement>;
5
+ resultData: ExamResult;
6
+ examTime: string;
7
+ isStudent: boolean;
8
+ categoryResponses: CategoryResponse[];
9
+ timelyOrderQuestions: TimelyOrderQuestion[];
10
+ allChartOptions: any;
11
+ allSeries: any;
12
+ effectSize: EffectSize[];
13
+ isMyStoryStudent?: boolean;
14
+ longTimeSpend: LongTimeSpendQuestion[];
15
+ fileName: string;
16
+ setRenderedChart: (articleNumber: number) => void;
17
+ }
18
+ declare const PrintExamResult: FC<Props>;
19
+ export default PrintExamResult;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ declare type Props = {
3
+ searchParams?: string;
4
+ history: any;
5
+ examSessionId?: number;
6
+ studentId?: number;
7
+ code?: string;
8
+ isMyStoryStudent?: boolean;
9
+ setNotFound?: Function;
10
+ };
11
+ declare const PrintExamResultView: FC<Props>;
12
+ export default PrintExamResultView;
@@ -0,0 +1,12 @@
1
+ import { FC } from "react";
2
+ declare type Props = {
3
+ searchParams: string;
4
+ history: any;
5
+ examSessionId?: number;
6
+ studentId?: number;
7
+ code?: string;
8
+ isMyStoryStudent?: boolean;
9
+ setNotFound?: Function;
10
+ };
11
+ declare const PrintPdfExamResult: FC<Props>;
12
+ export default PrintPdfExamResult;
@@ -1,9 +1,11 @@
1
1
  import { FC } from "react";
2
2
  import { Subject } from "../../Select/Subject/configs/types";
3
+ import { Category } from "../../Select/Category/configs/types";
3
4
  export interface ArticleGroupViewProps {
4
5
  article: number;
5
6
  questionCount: number;
6
7
  categoryId?: number;
8
+ categoryList?: Category[];
7
9
  answerCount: number;
8
10
  questions: any;
9
11
  isMultiple?: boolean;
@@ -1,13 +1,13 @@
1
1
  import { ArticleGroup, Exam } from "../configs/types";
2
2
  import { ChangeEvent } from "react";
3
- import { Subject } from "../../Select/Subject/configs/types";
3
+ import { Category } from "../../Select/Category/configs/types";
4
4
  interface Props {
5
5
  exam: Exam;
6
- selectedSubject?: Subject;
7
6
  onChangeExam: (value: Exam) => void;
8
7
  }
9
8
  declare const useExamDetailView: (props: Props) => {
10
9
  t: any;
10
+ categoryList: Category[];
11
11
  durationOptions: {
12
12
  label: any;
13
13
  value: number;
@@ -1,8 +1,9 @@
1
1
  import { Category } from "../configs/types";
2
2
  declare type Props = {
3
3
  subjectId?: number;
4
+ categoryList?: Category[];
4
5
  };
5
- declare const useCategorySelect: ({ subjectId }: Props) => {
6
+ declare const useCategorySelect: ({ categoryList }: Props) => {
6
7
  categoryOptions: {
7
8
  label: string;
8
9
  value: number | undefined;
@@ -1,5 +1,10 @@
1
1
  import { Subject } from "../configs/types";
2
- declare const useSubjectSelect: () => {
2
+ import { Exam } from "../../../Exams/configs/types";
3
+ declare type Props = {
4
+ exam: Exam;
5
+ onChangeExam: (value: Exam) => void;
6
+ };
7
+ declare const useSubjectSelect: ({ onChangeExam, exam }: Props) => {
3
8
  subjectOptions: {
4
9
  label: string;
5
10
  value: number | undefined;
@@ -7,6 +12,5 @@ declare const useSubjectSelect: () => {
7
12
  selectedSubject: Subject | undefined;
8
13
  subjectList: Subject[] | undefined;
9
14
  handleChangeSubject: (value: any) => void;
10
- handleChangeSelectedSubject: (subject: Subject | undefined) => void;
11
15
  };
12
16
  export default useSubjectSelect;
package/dist/index.css CHANGED
@@ -1392,3 +1392,36 @@
1392
1392
  border: 1px solid #dee2e6;
1393
1393
  border-radius: 0.375rem;
1394
1394
  transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out; }
1395
+
1396
+ ._2uC7T {
1397
+ display: flex;
1398
+ align-items: end; }
1399
+
1400
+ ._Xz-Mr {
1401
+ width: 6px;
1402
+ height: 6px;
1403
+ margin: 0 3px;
1404
+ border-radius: 50%;
1405
+ background-color: #ffffff;
1406
+ animation: _3THgz 0.6s infinite alternate; }
1407
+
1408
+ ._Xz-Mr:nth-child(2) {
1409
+ animation-delay: 0.2s; }
1410
+
1411
+ ._Xz-Mr:nth-child(3) {
1412
+ animation-delay: 0.4s; }
1413
+
1414
+ @keyframes _3THgz {
1415
+ 0% {
1416
+ transform: translateY(-4px); }
1417
+ 100% {
1418
+ transform: translateY(-8px); } }
1419
+
1420
+ @media print {
1421
+ ._35kyG {
1422
+ page-break-before: always; }
1423
+ ._1PFgl {
1424
+ print-color-adjust: exact; }
1425
+ ._3rPGh {
1426
+ -moz-column-break-inside: avoid;
1427
+ break-inside: avoid; } }
package/dist/index.d.ts CHANGED
@@ -75,4 +75,5 @@ import { getRecentUserActionListApi, createRecentUserActionListApi } from "./ser
75
75
  import { PassCodeCheck, PassCodeCheckProps } from "./containers/PassCodes/views/PassCodeCheck";
76
76
  import LoadingComponent from "./components/Loading/LoadingComponent";
77
77
  import { checkSuperUrl } from "./utils/types/checkSuperUrl";
78
- export { diffFromNow, formatTime, utcToLocalTime, setLoading, setReadyRegisterPusher, BASE_URL, SUPER_ADMIN_BASE_URL, ACCESS_TOKEN, Login, store, setAlert, setUser, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, CustomPagination, useGoogleSignOut, RecentUserAction, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, TheAcademyDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, ACADEMY_DOMAIN, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, CustomAsyncSelect, CustomSelectOption, LoginWithPassword, getRecentUserActionListApi, getAccessToken, ChatContainer, getOrdinalSuffix, IChatContainerProps, IChatItemProps, IChatHeaderProps, IInputChatProps, ChatItemType, useChatContainer, ConversationResponse, usePusherConversation, ExamResultV2, ToastContainer, toast, Role, useLanguage, useSwitchAcademy, LANGUAGES, CustomCreatable, moment, ExamDetailView, ExamDetailViewProps, Exam, Question, ArticleGroup, getAcademyDomain, useSubjectSelect, useLogin, useAutoAcademyDomain, createRecentUserActionListApi, LoginAccessTokenRequest, LoginRequest, setReFetchUserAcademies, ChatTypes, AcademyHeaders, Types, Enums, CoreHooks, Language, ArticleGroupView, AnswerCountSelector, QuestionCountSelector, ScoreSelector, ArticleCategorySelector, SubjectSelector, useCategorySelect, InputText, Textbook, TextbookDetail, TextbookList, timeUtils, Header, DEFAULT_PAGING_RESPONSE, PagingResponse, AcademyList, getErrorMessage, DefaultErrorMessage, useCountDownTimer, useLoadMore, useVirtualizeList, PassCodeCheck, PassCodeCheckProps, LoadingComponent, checkSuperUrl };
78
+ import PrintExamResultView from "./containers/ExamResult/views/PrintExamResultView";
79
+ export { diffFromNow, formatTime, utcToLocalTime, setLoading, setReadyRegisterPusher, BASE_URL, SUPER_ADMIN_BASE_URL, ACCESS_TOKEN, Login, store, setAlert, setUser, Loading, NotFound, LayoutContext, api, apiUpload, ConfirmDialog, CommonDialog, CustomPagination, useGoogleSignOut, RecentUserAction, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, TheAcademyDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, ACADEMY_DOMAIN, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, CustomAsyncSelect, CustomSelectOption, LoginWithPassword, getRecentUserActionListApi, getAccessToken, ChatContainer, getOrdinalSuffix, IChatContainerProps, IChatItemProps, IChatHeaderProps, IInputChatProps, ChatItemType, useChatContainer, ConversationResponse, usePusherConversation, ExamResultV2, ToastContainer, toast, Role, useLanguage, useSwitchAcademy, LANGUAGES, CustomCreatable, moment, ExamDetailView, ExamDetailViewProps, Exam, Question, ArticleGroup, getAcademyDomain, useSubjectSelect, useLogin, useAutoAcademyDomain, createRecentUserActionListApi, LoginAccessTokenRequest, LoginRequest, setReFetchUserAcademies, ChatTypes, AcademyHeaders, Types, Enums, CoreHooks, Language, ArticleGroupView, AnswerCountSelector, QuestionCountSelector, ScoreSelector, ArticleCategorySelector, SubjectSelector, useCategorySelect, InputText, Textbook, TextbookDetail, TextbookList, timeUtils, Header, DEFAULT_PAGING_RESPONSE, PagingResponse, AcademyList, getErrorMessage, DefaultErrorMessage, useCountDownTimer, useLoadMore, useVirtualizeList, PassCodeCheck, PassCodeCheckProps, LoadingComponent, PrintExamResultView, checkSuperUrl };