touchstudy-core 0.1.10 → 0.1.11

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.
@@ -10,6 +10,7 @@ export interface IExamOption {
10
10
  export interface IChatHeaderProps {
11
11
  name: string;
12
12
  avatar?: string;
13
+ selectedOption?: number;
13
14
  options?: IExamOption[];
14
15
  onChangeOption?: (value: Option) => void;
15
16
  }
@@ -15,6 +15,7 @@ declare const useChatContainer: (props: Props) => {
15
15
  name: string;
16
16
  avatar: string;
17
17
  options: import("../configs/types").ExamResponse[] | undefined;
18
+ selectedOption: number | undefined;
18
19
  onChangeOption: (val: any) => void;
19
20
  };
20
21
  chatListProps: {
@@ -8,6 +8,7 @@ interface Props {
8
8
  toggle: () => void;
9
9
  isDelete?: boolean;
10
10
  title?: string;
11
+ confirmText?: string;
11
12
  }
12
13
  export declare const ConfirmDialog: FC<Props>;
13
14
  export {};
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const CustomAsyncSelect: ({ isDefault, defaultValue, options, isDisabled, scrollBottom, value, isMulti, ...rest }: any) => React.JSX.Element;
3
+ export default CustomAsyncSelect;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const CustomCreatable: ({ defaultValue, options, isDisabled, scrollBottom, value, isMulti, ...rest }: any) => React.JSX.Element;
3
+ export default CustomCreatable;
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- declare const CustomSelect: ({ defaultValue, options, isDisabled, scrollBottom, value, isMulti, ...rest }: any) => React.JSX.Element;
2
+ declare const CustomSelect: ({ isDefault, defaultValue, options, isDisabled, scrollBottom, value, isMulti, ...rest }: any) => React.JSX.Element;
3
3
  export default CustomSelect;
@@ -0,0 +1,19 @@
1
+ import { FC } from "react";
2
+ export interface ArticleGroupViewProps {
3
+ categoryOptions: any[];
4
+ article: number;
5
+ questionCount: number;
6
+ categoryId?: number;
7
+ answerCount: number;
8
+ questions: any;
9
+ isMultiple?: boolean;
10
+ isActive?: boolean;
11
+ isDisabled?: boolean;
12
+ onChangeQuestionCount: (article: number, questionCount: number, answerCount: number) => void;
13
+ onChangeCategory: (article: number, categoryId: number) => void;
14
+ onChangeAnswerCount: (article: number, newAnswerCount: number, answerCount: number) => void;
15
+ onChangeCorrectAnswers: (article: number, index: number, answer: number) => void;
16
+ onChangeScoreAnswer: (article: number, index: number, score: number) => void;
17
+ }
18
+ declare const ArticleGroupView: FC<ArticleGroupViewProps>;
19
+ export default ArticleGroupView;
@@ -0,0 +1,11 @@
1
+ import { FC } from 'react';
2
+ export interface QuestionViewProps {
3
+ index: number;
4
+ question: any;
5
+ answerCount: number;
6
+ isDisabled?: boolean;
7
+ onChangeCorrectAnswers: (value: any, index: number) => void;
8
+ onChangeScoreAnswer: (value: number, index: number) => void;
9
+ }
10
+ declare const QuestionView: FC<QuestionViewProps>;
11
+ export default QuestionView;
@@ -0,0 +1,8 @@
1
+ import { Exam } from "./types";
2
+ export declare const DURATION_OPTIONS: number[];
3
+ export declare const SCORE_OPTIONS: number[];
4
+ export declare const QUESTION_OPTIONS: number[];
5
+ export declare const ANSWER_OPTIONS: number[];
6
+ export declare const DEFAULT_SCORE = 2;
7
+ export declare const DEFAULT_ANSWER_COUNT = 5;
8
+ export declare const DEFAULT_EXAM: Exam;
@@ -0,0 +1,9 @@
1
+ import { Exam } from "./types";
2
+ export interface ExamDetailViewProps {
3
+ className?: string;
4
+ categoryOptions: any[];
5
+ exam: Exam;
6
+ isDisabled?: boolean;
7
+ onChangeExam: (value: Exam) => void;
8
+ isUsingMui?: boolean;
9
+ }
@@ -0,0 +1,21 @@
1
+ export declare type Question = {
2
+ id?: number;
3
+ numberOfAnswers: number;
4
+ correctAnswers: number[];
5
+ score: number;
6
+ categoryId?: number;
7
+ article: number;
8
+ questionOrder: number;
9
+ };
10
+ export declare type Exam = {
11
+ title: string;
12
+ duration: number;
13
+ questions: Question[];
14
+ };
15
+ export declare type ArticleGroup = {
16
+ article: number;
17
+ categoryId?: number;
18
+ answerCount: number;
19
+ questionCount: number;
20
+ questions: Question[];
21
+ };
@@ -0,0 +1,23 @@
1
+ import { ArticleGroup, Exam } from "../configs/types";
2
+ import { ChangeEvent } from "react";
3
+ interface Props {
4
+ exam: Exam;
5
+ onChangeExam: (value: Exam) => void;
6
+ }
7
+ declare const useExamDetailView: (props: Props) => {
8
+ t: any;
9
+ durationOptions: {
10
+ label: string;
11
+ value: number;
12
+ }[];
13
+ examGroupByArticle: ArticleGroup[];
14
+ handleAddArticle: () => void;
15
+ handleChangeScoreAnswer: (article: number, index: number, score: number) => void;
16
+ handleChangeTitle: (e: ChangeEvent<HTMLInputElement>) => void;
17
+ handleChangeDuration: (value: any) => void;
18
+ handleChangeCorrectAnswers: (article: number, index: number, answer: number) => void;
19
+ handleChangeAnswerCount: (article: number, newAnswerCount: number, answerCount: number) => void;
20
+ handleChangeQuestionCount: (article: number, questionCount: number, answerCount: number) => void;
21
+ handleChangeCategory: (article: number, categoryId: number) => void;
22
+ };
23
+ export default useExamDetailView;
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import { ExamDetailViewProps } from '../configs/interfaces';
3
+ declare const ExamDetailView: FC<ExamDetailViewProps>;
4
+ export default ExamDetailView;
@@ -2,3 +2,8 @@ export declare enum AuthenticationMessage {
2
2
  NotAllowedToRegister = "NotAllowedToRegister",
3
3
  InvalidGoogleToken = "InvalidGoogleToken"
4
4
  }
5
+ export declare enum Role {
6
+ Student = "Student",
7
+ Teacher = "Teacher",
8
+ Admin = "Admin"
9
+ }
@@ -1,7 +1,8 @@
1
1
  import { FC } from "react";
2
2
  import { INavigateProps } from "../../../utils/types";
3
+ import { Role } from "../configs/constants";
3
4
  interface Props {
4
- isTeacher?: boolean;
5
+ role?: Role;
5
6
  }
6
7
  declare const Login: FC<INavigateProps & Props>;
7
8
  export default Login;
@@ -1,8 +1,9 @@
1
1
  import { FC } from "react";
2
2
  import { INavigateProps } from "../../../../utils/types";
3
+ import { Role } from "../../configs/constants";
3
4
  interface Props {
4
5
  defaultInfo?: any;
5
- isTeacher?: boolean;
6
+ role?: Role;
6
7
  }
7
8
  declare const BlockLogin: FC<Props & INavigateProps>;
8
9
  export default BlockLogin;
package/dist/index.css CHANGED
@@ -171,3 +171,41 @@
171
171
  -webkit-line-clamp: 1;
172
172
  -webkit-box-orient: vertical;
173
173
  line-height: 42px; }
174
+
175
+ ._2uc_W {
176
+ padding: 0.5rem 1.5rem;
177
+ border-radius: 6px;
178
+ border: 1px solid #EBEBFF; }
179
+ ._2p7kY {
180
+ font-weight: 700;
181
+ font-size: 14px;
182
+ color: #5458D5; }
183
+ ._2tHmc {
184
+ font-weight: 700;
185
+ font-size: 14px;
186
+ color: #414E62; }
187
+ ._3IHYm {
188
+ border: 1px solid #5458D5; }
189
+
190
+ ._26ATj {
191
+ font-weight: 600;
192
+ font-size: 13px;
193
+ color: #202B37; }
194
+
195
+ ._3R8PR {
196
+ font-weight: 600;
197
+ font-size: 13px;
198
+ color: #5458D5;
199
+ border: 1px solid #97A1AF;
200
+ padding: 12px; }
201
+ ._3R8PR:focus {
202
+ box-shadow: none;
203
+ color: #5458D5;
204
+ border: 1px solid #5458D5; }
205
+
206
+ ._1VZac {
207
+ border-color: #5458D5;
208
+ color: #5458D5; }
209
+ ._1VZac:hover {
210
+ color: #FFF;
211
+ background: #5458D5; }
package/dist/index.d.ts CHANGED
@@ -32,4 +32,14 @@ import useChatContainer from "./components/Chats/hooks/useChatContainer";
32
32
  import useConversationList from "./components/Chats/hooks/useConversationList";
33
33
  import { ConversationResponse, ExamResponse } from "./components/Chats/configs/types";
34
34
  import usePusherConversation from "./components/Chats/hooks/usePusherConversation";
35
- export { diffFromNow, formatTime, utcToLocalTime, setLoading, BASE_URL, ACCESS_TOKEN, Login, store, historyCore, setAlert, setUser, Loading, NotFound, LayoutContext, api, ConfirmDialog, CommonDialog, CommonAlert, CustomPagination, useGoogleSignOut, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, getAccessToken, ChatContainer, IChatContainerProps, IChatItemProps, IChatHeaderProps, IInputChatProps, ChatItemType, useChatContainer, useConversationList, ConversationResponse, ExamResponse, usePusherConversation };
35
+ import { ToastContainer, toast } from "react-toastify";
36
+ import { Role } from "./containers/Login/configs/constants";
37
+ import useLanguage from "./utils/useLanguage";
38
+ import { LANGUAGES } from "./configs/constants";
39
+ import CustomCreatable from "./components/Selects/CustomCreatable";
40
+ import moment from "moment";
41
+ import CustomAsyncSelect from "./components/Selects/CustomAsyncSelect";
42
+ import ExamDetailView from "./containers/Exams/views/ExamDetailView";
43
+ import { ExamDetailViewProps } from "./containers/Exams/configs/interfaces";
44
+ import { Exam, Question, ArticleGroup } from "./containers/Exams/configs/types";
45
+ export { diffFromNow, formatTime, utcToLocalTime, setLoading, BASE_URL, ACCESS_TOKEN, Login, store, historyCore, setAlert, setUser, Loading, NotFound, LayoutContext, api, ConfirmDialog, CommonDialog, CommonAlert, CustomPagination, useGoogleSignOut, PUSHER_CONFIG, ExamEvent, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, setLanguage, i18n, TheLanguageDropdown, useTranslation, I18nextProvider, DATE_MIN_VALUE, minutesToTimeSpan, toISOString, canAccessRoute, CustomSelect, CustomAsyncSelect, getAccessToken, ChatContainer, IChatContainerProps, IChatItemProps, IChatHeaderProps, IInputChatProps, ChatItemType, useChatContainer, useConversationList, ConversationResponse, ExamResponse, usePusherConversation, ToastContainer, toast, Role, useLanguage, LANGUAGES, CustomCreatable, moment, ExamDetailView, ExamDetailViewProps, Exam, Question, ArticleGroup };