touchstudy-core 0.1.34 → 0.1.36

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.
@@ -0,0 +1,6 @@
1
+ import { ExamRequestBody } from "../configs/types";
2
+ export declare const createExam: (data: ExamRequestBody) => Promise<import("axios").AxiosResponse<any, any>>;
3
+ export declare const updateExam: (data: ExamRequestBody, examId: number) => Promise<import("axios").AxiosResponse<any, any>>;
4
+ export declare const apiCreateExamSession: (examId: number) => Promise<import("axios").AxiosResponse<any, any>>;
5
+ export declare const apiDeleteExam: (examId: number) => Promise<import("axios").AxiosResponse<any, any>>;
6
+ export declare const apiDeleteExamSession: (examId: number, examSessionId: number) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -0,0 +1,10 @@
1
+ import { Exam } from "../../Exams/configs/types";
2
+ export declare const increaseDuration: (id: number, data: string) => Promise<import("axios").AxiosResponse<any, any>>;
3
+ export declare const terminateExam: (id: number) => Promise<import("axios").AxiosResponse<any, any>>;
4
+ export declare const getListExamSession: (query: Exam) => Promise<import("axios").AxiosResponse<any, any>>;
5
+ export declare const startExam: (examId: number) => Promise<import("axios").AxiosResponse<any, any>>;
6
+ export declare const checkStatusExamApi: (code: string) => Promise<import("axios").AxiosResponse<any, any>>;
7
+ export declare const apiDeleteExam: (examId: number) => Promise<import("axios").AxiosResponse<any, any>>;
8
+ export declare const apiActivePendingExam: (id: number) => Promise<import("axios").AxiosResponse<any, any>>;
9
+ export declare const apiKickOutStudent: (studentId: number, examCode: string) => Promise<import("axios").AxiosResponse<any, any>>;
10
+ export declare const apiGetJoinedStudents: (examCode: string) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -0,0 +1,10 @@
1
+ import { FC } from "react";
2
+ import { ChapterOption } from "../../configs/types";
3
+ interface Props {
4
+ open: boolean;
5
+ chapter?: ChapterOption;
6
+ onClose: () => void;
7
+ onSubmitForm: (name: string) => void;
8
+ }
9
+ declare const ChapterNameDialog: FC<Props>;
10
+ export default ChapterNameDialog;
@@ -0,0 +1,11 @@
1
+ import { FC, MouseEventHandler } from "react";
2
+ import { ExamDetailViewProps } from "../../../Exams/configs/interfaces";
3
+ interface Props extends ExamDetailViewProps {
4
+ isOpen: boolean;
5
+ onClose: Function;
6
+ isEdit?: boolean;
7
+ onSubmit: Function;
8
+ handleSaveExam: MouseEventHandler<HTMLDivElement>;
9
+ }
10
+ declare const CreateExamDrawer: FC<Props>;
11
+ export default CreateExamDrawer;
@@ -1,5 +1,9 @@
1
+ import { Exam } from "../../Exams/configs/types";
1
2
  import { ArticleCreateRequest, TextbookDetailResponse, TextbookHeaderTable, TextbookSearchQuery } from "./types";
2
3
  export declare const TEXTBOOK_HEADERS: TextbookHeaderTable[];
4
+ export declare const DEFAULT_ANSWER_COUNT = 5;
5
+ export declare const ANSWERS_COUNT: number[];
6
+ export declare const DEFAULT_EXAM_REQUEST: Exam;
3
7
  export declare const TEXTBOOK_PAGE_TITLE: string;
4
8
  export declare const TEXT_BOOK_SEARCH_PLACEHOLDER: string;
5
9
  export declare const TextbookDefaultQuery: TextbookSearchQuery;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ChapterResponse, SubjectResponse, ChapterOption, ArticleResponse } from "./types";
2
3
  export interface ChapterBoxProps {
3
4
  parentChapterId?: number;
@@ -10,6 +11,7 @@ export interface ChapterBoxProps {
10
11
  onChangePageFrom?: (value: number, chapterId: number, parentChapterId?: number) => void;
11
12
  onChangePageTo?: (value: number, chapterId: number, parentChapterId?: number) => void;
12
13
  onAddArticle?: (chapter: ChapterResponse, callback?: Function) => void;
14
+ handleCheckArticle: (e: React.ChangeEvent<HTMLInputElement>, article: ArticleResponse) => void;
13
15
  onRemoveArticle?: (articleNumber: number, chapterName: string, articles: ArticleResponse[], chapterId: number, parentChapterId?: number, callback?: Function) => void;
14
16
  onUpdateArticleQuestionCount?: (articleNumber: number, questionCount: number, answerCount: number, articles: ArticleResponse[], chapterId: number, parentChapterId?: number, callback?: Function) => void;
15
17
  onUpdateArticleCategory?: (articleNumber: number, categoryId: number, articles: ArticleResponse[], chapterId: number, parentChapterId?: number, callback?: Function) => void;
@@ -120,3 +120,39 @@ export declare type DeleteItem = {
120
120
  value?: ArticleResponse[];
121
121
  confirmText: string;
122
122
  };
123
+ export declare type ExamRequestBody = {
124
+ id?: number | string;
125
+ title: string;
126
+ duration: string;
127
+ };
128
+ export declare type ExamSession = {
129
+ id?: number;
130
+ examId?: number;
131
+ title: string;
132
+ duration: string;
133
+ type: ExamType;
134
+ numberOfQuestion: number;
135
+ code: string;
136
+ createdAt: string;
137
+ examCreatedAt: string;
138
+ startTime: string;
139
+ status?: ExamStatusNumber;
140
+ totalStudentsJoined?: number;
141
+ teacher?: any;
142
+ };
143
+ export declare enum ExamType {
144
+ Normal = "Normal",
145
+ Standard = "Standard"
146
+ }
147
+ export declare enum ExamStatus {
148
+ Default = "Default",
149
+ Pending = "Pending",
150
+ InProgress = "InProgress",
151
+ Completed = "Completed"
152
+ }
153
+ export declare enum ExamStatusNumber {
154
+ Default = 0,
155
+ Pending = 1,
156
+ InProgress = 2,
157
+ Completed = 3
158
+ }
@@ -0,0 +1,16 @@
1
+ import { Exam } from "../../Exams/configs/types";
2
+ interface Props {
3
+ keep?: boolean;
4
+ callback?: () => Promise<void>;
5
+ navigate?: any;
6
+ }
7
+ declare const useExam: (props: Props) => {
8
+ isOpenDialog: boolean;
9
+ examRequest: Exam;
10
+ handleChangeExamRequest: (value: Exam) => void;
11
+ handleOpenCreateExamDialog: () => void;
12
+ handleSaveExam: () => Promise<void>;
13
+ handleCloseDialog: () => void;
14
+ handleCreateExam: () => Promise<void>;
15
+ };
16
+ export default useExam;
@@ -17,6 +17,15 @@ declare const useTextbookDetail: (props: TextbookDetailProps) => {
17
17
  selectedDeleteItem: DeleteItem | undefined;
18
18
  isEditedTitle: boolean;
19
19
  isReadonlyParam: boolean | undefined;
20
+ articlesSelected: number[];
21
+ isOpenDialog: boolean;
22
+ examRequest: import("../../..").Exam;
23
+ handleChangeExamRequest: (value: import("../../..").Exam) => void;
24
+ handleCheckArticle: (e: React.ChangeEvent<HTMLInputElement>, article: ArticleResponse) => void;
25
+ handleOpenCreateExamDialog: () => void;
26
+ handleSaveExam: () => Promise<void>;
27
+ handleCloseDialog: () => void;
28
+ handleCreateExam: () => Promise<void>;
20
29
  handleChangeTextbookTitle: (e: ChangeEvent<HTMLInputElement>) => void;
21
30
  handleCreateOrUpdateTextbook: () => Promise<void>;
22
31
  handleChangeTextbookSubject: (val: any) => void;
package/dist/index.css CHANGED
@@ -27,6 +27,34 @@
27
27
  border-radius: 5px !important;
28
28
  box-shadow: unset !important; }
29
29
 
30
+ ._rd4Uy {
31
+ display: inline-block;
32
+ padding: 0.375rem 0.75rem;
33
+ font-size: 1rem;
34
+ font-weight: 400;
35
+ line-height: 1.5;
36
+ color: #fff;
37
+ text-align: center;
38
+ text-decoration: none;
39
+ vertical-align: middle;
40
+ cursor: pointer;
41
+ -webkit-user-select: none;
42
+ -moz-user-select: none;
43
+ user-select: none;
44
+ border: 1px solid #0d6efd;
45
+ border-radius: 0.375rem;
46
+ background-color: #0d6efd;
47
+ transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out; }
48
+ ._rd4Uy:hover {
49
+ color: #fff;
50
+ background-color: #0b5ed7;
51
+ border-color: #0a58ca; }
52
+ ._rd4Uy:disabled {
53
+ color: #fff;
54
+ background-color: #0d6efd;
55
+ border-color: #0d6efd;
56
+ opacity: 0.65; }
57
+
30
58
  ._1krbH ._RQaHE {
31
59
  border: none;
32
60
  background-color: transparent;
@@ -703,6 +731,125 @@
703
731
  color: #FFF;
704
732
  background: #5458D5; }
705
733
 
734
+ ._11aYm {
735
+ width: 70vw;
736
+ height: calc(100vh - 78px);
737
+ position: fixed;
738
+ right: -100%;
739
+ bottom: 0;
740
+ z-index: 99;
741
+ transition: right 0.3s ease-in-out; }
742
+ ._11aYm._3Ydwm {
743
+ right: 0; }
744
+
745
+ ._3SQDf {
746
+ width: 100vw;
747
+ height: 100vh;
748
+ background-color: rgba(0, 0, 0, 0);
749
+ position: fixed;
750
+ right: 0;
751
+ bottom: 0;
752
+ transition: background-color 0.1s 0.2s ease-in-out;
753
+ z-index: -1; }
754
+ ._3SQDf._3Ydwm {
755
+ background-color: rgba(0, 0, 0, 0.3);
756
+ z-index: 98; }
757
+
758
+ ._2BwOx {
759
+ background: #F9FAFB;
760
+ border-bottom: 1px solid #E4E7EC;
761
+ padding: 1rem 1.5rem; }
762
+ ._2BwOx button {
763
+ background-color: #5458D5;
764
+ padding: 0.5rem 1rem; }
765
+ ._2BwOx button:hover {
766
+ background-color: #5457af; }
767
+ ._2BwOx button span {
768
+ font-size: 13px;
769
+ font-weight: 700; }
770
+
771
+ ._2Zo7R {
772
+ height: calc(100% - 70.5px);
773
+ padding: 1rem 1.5rem 2rem;
774
+ overflow-y: auto; }
775
+
776
+ ._1lzjD {
777
+ width: 100%;
778
+ top: calc(100% + 4px) !important;
779
+ left: unset !important;
780
+ right: 0 !important;
781
+ transform: none !important;
782
+ border-radius: 6px;
783
+ box-shadow: 0px 8px 15px #989898;
784
+ border: none;
785
+ padding: 0 8px; }
786
+ ._1lzjD:after {
787
+ display: none; }
788
+ ._1lzjD ._1y7K9 {
789
+ background: transparent; }
790
+
791
+ ._1Y-55 {
792
+ font-size: 14px;
793
+ line-height: 1; }
794
+ ._1Y-55:active {
795
+ background-color: transparent !important; }
796
+
797
+ ._1fBXY {
798
+ width: 210px;
799
+ top: 40px !important;
800
+ left: -80px !important;
801
+ transform: none !important;
802
+ border-radius: 6px;
803
+ box-shadow: 0px 8px 15px #989898;
804
+ border: none;
805
+ padding: 0 8px; }
806
+ ._1fBXY:after {
807
+ display: none; }
808
+ ._1fBXY ._1y7K9 {
809
+ background: transparent; }
810
+
811
+ ._3Szun {
812
+ color: #242424;
813
+ display: flex;
814
+ padding: 8px;
815
+ border-radius: 6px; }
816
+ ._3Szun:hover {
817
+ background-color: #f1faff;
818
+ color: #009ef7; }
819
+
820
+ ._2HhLb {
821
+ background-color: #f1faff;
822
+ color: #009ef7; }
823
+
824
+ ._3WYHC {
825
+ font-weight: 600;
826
+ border-top: 1px solid #27347d29;
827
+ padding-top: 10px; }
828
+ ._3WYHC._2-9ix {
829
+ color: #8b0000; }
830
+ ._3WYHC ._1r4pn {
831
+ margin-right: 12px; }
832
+
833
+ ._2ZozT {
834
+ width: 40px;
835
+ height: 40px;
836
+ border-radius: 50%;
837
+ margin-right: 12px;
838
+ display: flex;
839
+ justify-content: center;
840
+ align-items: center;
841
+ font-size: 20px;
842
+ font-weight: 600;
843
+ line-height: 1;
844
+ background-color: #5458D5;
845
+ color: #FFF; }
846
+ ._2ZozT img {
847
+ width: 100%;
848
+ height: 100%;
849
+ border-radius: 50%;
850
+ -o-object-fit: cover;
851
+ object-fit: cover; }
852
+
706
853
  ._1dveO ._mxRxf:nth-child(1) {
707
854
  font-family: "Pretendard";
708
855
  font-size: 20px;