diff --git a/packages/shared/interfaces/request/index.ts b/packages/shared/interfaces/request/index.ts new file mode 100644 index 00000000..b8efb69b --- /dev/null +++ b/packages/shared/interfaces/request/index.ts @@ -0,0 +1,5 @@ +export * from './master-entry.request.interface'; +export * from './nickname.request.interface'; +export * from './participant-entry.request.interface'; +export * from './show-quiz.request.interface'; +export * from './start-quiz.request.interface'; diff --git a/packages/shared/interfaces/request/master-entry.request.interface.ts b/packages/shared/interfaces/request/master-entry.request.interface.ts new file mode 100644 index 00000000..ef36273a --- /dev/null +++ b/packages/shared/interfaces/request/master-entry.request.interface.ts @@ -0,0 +1,3 @@ +export interface MasterEntryRequest { + classId: number; +} diff --git a/packages/shared/interfaces/request/nickname.request.interface.ts b/packages/shared/interfaces/request/nickname.request.interface.ts new file mode 100644 index 00000000..ea452fc9 --- /dev/null +++ b/packages/shared/interfaces/request/nickname.request.interface.ts @@ -0,0 +1,3 @@ +export interface NicknameRequest { + pinCode: string; +} diff --git a/packages/shared/interfaces/request/participant-entry.request.interface.ts b/packages/shared/interfaces/request/participant-entry.request.interface.ts new file mode 100644 index 00000000..caf2b3f3 --- /dev/null +++ b/packages/shared/interfaces/request/participant-entry.request.interface.ts @@ -0,0 +1,4 @@ +export interface ParticipantEntryRequest { + pinCode: string; + nickname: string; +} diff --git a/packages/shared/interfaces/request/show-quiz.request.interface.ts b/packages/shared/interfaces/request/show-quiz.request.interface.ts new file mode 100644 index 00000000..5aeff60d --- /dev/null +++ b/packages/shared/interfaces/request/show-quiz.request.interface.ts @@ -0,0 +1,3 @@ +export interface ShowQuizRequest { + pinCode: string; +} diff --git a/packages/shared/interfaces/request/start-quiz.request.interface.ts b/packages/shared/interfaces/request/start-quiz.request.interface.ts new file mode 100644 index 00000000..3cfc4cef --- /dev/null +++ b/packages/shared/interfaces/request/start-quiz.request.interface.ts @@ -0,0 +1,4 @@ +export interface StartQuizRequest { + sid: string; + pinCode: string; +} diff --git a/packages/shared/interfaces/response/index.ts b/packages/shared/interfaces/response/index.ts new file mode 100644 index 00000000..4e5ff2e7 --- /dev/null +++ b/packages/shared/interfaces/response/index.ts @@ -0,0 +1,10 @@ +export * from './master-statistics.response.interface'; +export * from './participant-statistics.response.interface'; +export * from './time-end.response.interface'; +export * from './timer-tick.response.interface'; +export * from './pincode.response.interface'; +export * from './nickname.response.interface'; +export * from './session.response.interface'; +export * from './show-quiz.response.interface'; +export * from './start-quiz.response.interface'; +export * from './submit-answer.request.interface'; diff --git a/packages/shared/interfaces/response/master-statistics.response.interface.ts b/packages/shared/interfaces/response/master-statistics.response.interface.ts new file mode 100644 index 00000000..7b989b9c --- /dev/null +++ b/packages/shared/interfaces/response/master-statistics.response.interface.ts @@ -0,0 +1,8 @@ +export interface MasterStatisticsResponse { + totalSubmit: number; + solveRate: number; + averageTime: number; + participantRate: number; + choiceStatus: { [key: number]: number }; + submitHistory: [string, number][]; +} diff --git a/packages/shared/interfaces/response/nickname.response.interface.ts b/packages/shared/interfaces/response/nickname.response.interface.ts new file mode 100644 index 00000000..d4fa7207 --- /dev/null +++ b/packages/shared/interfaces/response/nickname.response.interface.ts @@ -0,0 +1,3 @@ +export interface NicknameResponse { + participantList: string[]; +} diff --git a/packages/shared/interfaces/response/participant-statistics.response.interface.ts b/packages/shared/interfaces/response/participant-statistics.response.interface.ts new file mode 100644 index 00000000..17791a64 --- /dev/null +++ b/packages/shared/interfaces/response/participant-statistics.response.interface.ts @@ -0,0 +1,6 @@ +export interface ParticipantStatisticsResponse { + totalSubmit: number; + solveRate: number; + averageTime: number; + participantRate: number; +} diff --git a/packages/shared/interfaces/response/pincode.response.interface.ts b/packages/shared/interfaces/response/pincode.response.interface.ts new file mode 100644 index 00000000..2a831f9e --- /dev/null +++ b/packages/shared/interfaces/response/pincode.response.interface.ts @@ -0,0 +1,3 @@ +export interface PincodeResponse { + pinCode: string; +} diff --git a/packages/shared/interfaces/response/session.response.interface.ts b/packages/shared/interfaces/response/session.response.interface.ts new file mode 100644 index 00000000..91a1c93a --- /dev/null +++ b/packages/shared/interfaces/response/session.response.interface.ts @@ -0,0 +1,3 @@ +export interface SessionResponse { + sid: string; +} diff --git a/packages/shared/interfaces/response/show-quiz.response.interface.ts b/packages/shared/interfaces/response/show-quiz.response.interface.ts new file mode 100644 index 00000000..9ac39eb6 --- /dev/null +++ b/packages/shared/interfaces/response/show-quiz.response.interface.ts @@ -0,0 +1,6 @@ +import { QuizData } from '../utils/quizdata.interface'; + +export interface ShowQuizResponse { + currentQuizData: QuizData; + isLast: boolean; +} diff --git a/packages/shared/interfaces/response/start-quiz.response.interface.ts b/packages/shared/interfaces/response/start-quiz.response.interface.ts new file mode 100644 index 00000000..eaa7938c --- /dev/null +++ b/packages/shared/interfaces/response/start-quiz.response.interface.ts @@ -0,0 +1,3 @@ +export interface StartQuizResponse { + isStarted: boolean; +} diff --git a/packages/shared/interfaces/response/submit-answer.request.interface.ts b/packages/shared/interfaces/response/submit-answer.request.interface.ts new file mode 100644 index 00000000..75315295 --- /dev/null +++ b/packages/shared/interfaces/response/submit-answer.request.interface.ts @@ -0,0 +1,6 @@ +export interface SubmitAnswerRequest { + pinCode: string; + sid: string; + selectedAnswer: number[]; + submitTime: number; +} diff --git a/packages/shared/interfaces/response/time-end.response.interface.ts b/packages/shared/interfaces/response/time-end.response.interface.ts new file mode 100644 index 00000000..0cf1533c --- /dev/null +++ b/packages/shared/interfaces/response/time-end.response.interface.ts @@ -0,0 +1,3 @@ +export interface TimeEndResponse { + isEnd: boolean; +} diff --git a/packages/shared/interfaces/response/timer-tick.response.interface.ts b/packages/shared/interfaces/response/timer-tick.response.interface.ts new file mode 100644 index 00000000..7e45a2f9 --- /dev/null +++ b/packages/shared/interfaces/response/timer-tick.response.interface.ts @@ -0,0 +1,5 @@ +export interface TimerTickResponse { + curretTime: number; + elaspedTime: number; + remainingTime: number; +} diff --git a/packages/shared/interfaces/utils/choice.interface.ts b/packages/shared/interfaces/utils/choice.interface.ts new file mode 100644 index 00000000..49a1c12d --- /dev/null +++ b/packages/shared/interfaces/utils/choice.interface.ts @@ -0,0 +1,7 @@ +export interface Choice { + id: number; + quizId: number; + content: string; + isCorrect: boolean; + position: number; +} diff --git a/packages/shared/interfaces/utils/quizdata.interface.ts b/packages/shared/interfaces/utils/quizdata.interface.ts new file mode 100644 index 00000000..d401549e --- /dev/null +++ b/packages/shared/interfaces/utils/quizdata.interface.ts @@ -0,0 +1,12 @@ +import { Choice } from './choice.interface'; +import { QuizType } from '../../types/quiz.types'; + +export interface QuizData { + id: number; + content: string; + quizType: QuizType; + timeLimit: number; + point: number; + position: number; + choices: Choice[]; +} diff --git a/packages/shared/types/a.ts b/packages/shared/types/a.ts deleted file mode 100644 index ef74d34b..00000000 --- a/packages/shared/types/a.ts +++ /dev/null @@ -1 +0,0 @@ -const a = 5; diff --git a/packages/shared/types/quiz.types.ts b/packages/shared/types/quiz.types.ts new file mode 100644 index 00000000..7eb776e4 --- /dev/null +++ b/packages/shared/types/quiz.types.ts @@ -0,0 +1,6 @@ +export const QUIZ_TYPES = { + MULTIPLE_CHOICE: 'MC', + TRUE_FALSE: 'TF', +} as const; + +export type QuizType = (typeof QUIZ_TYPES)[keyof typeof QUIZ_TYPES];