@quizpot/quizcore 0.0.2 → 0.0.4
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.
- package/dist/index.cjs +582 -0
- package/dist/index.d.cts +472 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +472 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +522 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +7 -6
- package/dist/events/client/host/kick-player.d.ts +0 -8
- package/dist/events/client/host/kick-player.d.ts.map +0 -1
- package/dist/events/client/host/kick-player.js +0 -4
- package/dist/events/client/host/next-step.d.ts +0 -5
- package/dist/events/client/host/next-step.d.ts.map +0 -1
- package/dist/events/client/host/next-step.js +0 -3
- package/dist/events/client/host/start-lobby.d.ts +0 -6
- package/dist/events/client/host/start-lobby.d.ts.map +0 -1
- package/dist/events/client/host/start-lobby.js +0 -4
- package/dist/events/client/player/submit-answer.d.ts +0 -9
- package/dist/events/client/player/submit-answer.d.ts.map +0 -1
- package/dist/events/client/player/submit-answer.js +0 -4
- package/dist/events/server/lobby-deleted.d.ts +0 -8
- package/dist/events/server/lobby-deleted.d.ts.map +0 -1
- package/dist/events/server/lobby-deleted.js +0 -4
- package/dist/events/server/lobby-joined.d.ts +0 -14
- package/dist/events/server/lobby-joined.d.ts.map +0 -1
- package/dist/events/server/lobby-joined.js +0 -18
- package/dist/events/server/lobby-status-update.d.ts +0 -32
- package/dist/events/server/lobby-status-update.d.ts.map +0 -1
- package/dist/events/server/lobby-status-update.js +0 -4
- package/dist/events/server/player-answer-result.d.ts +0 -11
- package/dist/events/server/player-answer-result.d.ts.map +0 -1
- package/dist/events/server/player-answer-result.js +0 -4
- package/dist/events/server/player-joined.d.ts +0 -9
- package/dist/events/server/player-joined.d.ts.map +0 -1
- package/dist/events/server/player-joined.js +0 -4
- package/dist/events/server/player-kicked.d.ts +0 -6
- package/dist/events/server/player-kicked.d.ts.map +0 -1
- package/dist/events/server/player-kicked.js +0 -4
- package/dist/events/server/player-left.d.ts +0 -9
- package/dist/events/server/player-left.d.ts.map +0 -1
- package/dist/events/server/player-left.js +0 -4
- package/dist/events/server/player-update.d.ts +0 -9
- package/dist/events/server/player-update.d.ts.map +0 -1
- package/dist/events/server/player-update.js +0 -4
- package/dist/events/server/update-lobby-answers.d.ts +0 -8
- package/dist/events/server/update-lobby-answers.d.ts.map +0 -1
- package/dist/events/server/update-lobby-answers.js +0 -4
- package/dist/index.d.ts +0 -26
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -25
- package/dist/managers/lobby-manager.d.ts +0 -12
- package/dist/managers/lobby-manager.d.ts.map +0 -1
- package/dist/managers/lobby-manager.js +0 -112
- package/dist/types/events.d.ts +0 -16
- package/dist/types/events.d.ts.map +0 -1
- package/dist/types/events.js +0 -1
- package/dist/types/lobby.d.ts +0 -42
- package/dist/types/lobby.d.ts.map +0 -1
- package/dist/types/lobby.js +0 -10
- package/dist/types/question.d.ts +0 -106
- package/dist/types/question.d.ts.map +0 -1
- package/dist/types/question.js +0 -22
- package/dist/types/questions/multiple-choice.d.ts +0 -51
- package/dist/types/questions/multiple-choice.d.ts.map +0 -1
- package/dist/types/questions/multiple-choice.js +0 -21
- package/dist/types/questions/short-answer.d.ts +0 -34
- package/dist/types/questions/short-answer.d.ts.map +0 -1
- package/dist/types/questions/short-answer.js +0 -11
- package/dist/types/questions/true-false.d.ts +0 -36
- package/dist/types/questions/true-false.d.ts.map +0 -1
- package/dist/types/questions/true-false.js +0 -12
- package/dist/types/quizfile.d.ts +0 -79
- package/dist/types/quizfile.d.ts.map +0 -1
- package/dist/types/quizfile.js +0 -23
- package/dist/types/quizstep.d.ts +0 -73
- package/dist/types/quizstep.d.ts.map +0 -1
- package/dist/types/quizstep.js +0 -7
- package/dist/types/quiztheme.d.ts +0 -7
- package/dist/types/quiztheme.d.ts.map +0 -1
- package/dist/types/quiztheme.js +0 -5
- package/dist/types/slide.d.ts +0 -18
- package/dist/types/slide.d.ts.map +0 -1
- package/dist/types/slide.js +0 -9
- package/dist/types/slides/comparison.d.ts +0 -9
- package/dist/types/slides/comparison.d.ts.map +0 -1
- package/dist/types/slides/comparison.js +0 -7
- package/dist/types/slides/titleImageTextSlide.d.ts +0 -9
- package/dist/types/slides/titleImageTextSlide.d.ts.map +0 -1
- package/dist/types/slides/titleImageTextSlide.js +0 -7
- package/dist/types/slides/titleSlide.d.ts +0 -8
- package/dist/types/slides/titleSlide.d.ts.map +0 -1
- package/dist/types/slides/titleSlide.js +0 -6
- package/dist/util/guards.d.ts +0 -18
- package/dist/util/guards.d.ts.map +0 -1
- package/dist/util/guards.js +0 -15
- package/dist/util/names/additives.json +0 -23
- package/dist/util/names/animals.json +0 -23
- package/dist/util/names/colors.json +0 -14
- package/dist/util/names/names.d.ts +0 -4
- package/dist/util/names/names.d.ts.map +0 -1
- package/dist/util/names/names.js +0 -31
- package/dist/util/sanitizer.d.ts +0 -3
- package/dist/util/sanitizer.d.ts.map +0 -1
- package/dist/util/sanitizer.js +0 -18
- package/dist/util/score.d.ts +0 -11
- package/dist/util/score.d.ts.map +0 -1
- package/dist/util/score.js +0 -33
- package/dist/util/validator.d.ts +0 -14
- package/dist/util/validator.d.ts.map +0 -1
- package/dist/util/validator.js +0 -27
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SubmittedAnswer } from "../../../util/validator";
|
|
2
|
-
export type SubmitAnswer = {
|
|
3
|
-
type: "SUBMIT_ANSWER";
|
|
4
|
-
payload: {
|
|
5
|
-
submission: SubmittedAnswer;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const createSubmitAnswerEvent: (submission: SubmittedAnswer) => SubmitAnswer;
|
|
9
|
-
//# sourceMappingURL=submit-answer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"submit-answer.d.ts","sourceRoot":"","sources":["../../../../src/events/client/player/submit-answer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE;QAAE,UAAU,EAAE,eAAe,CAAA;KAAE,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,YAAY,eAAe,KAAG,YAGpE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lobby-deleted.d.ts","sourceRoot":"","sources":["../../../src/events/server/lobby-deleted.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,YAGvD,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Lobby, Player } from "../../types/lobby";
|
|
2
|
-
import { Answer } from "../../util/validator";
|
|
3
|
-
export type LobbyJoined = {
|
|
4
|
-
type: "LOBBY_JOINED";
|
|
5
|
-
payload: {
|
|
6
|
-
lobby: Omit<Lobby, "host" | "quiz" | "players" | "currentAnswers" | "answers">;
|
|
7
|
-
me?: Player;
|
|
8
|
-
players?: Player[];
|
|
9
|
-
currentAnswers?: Answer[];
|
|
10
|
-
answers?: Answer[];
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export declare const createLobbyJoinedEvent: (lobby: Lobby, me: Player, isHost: boolean) => LobbyJoined;
|
|
14
|
-
//# sourceMappingURL=lobby-joined.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lobby-joined.d.ts","sourceRoot":"","sources":["../../../src/events/server/lobby-joined.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE;QACP,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAAC,CAAC;QAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,OAAO,KAAK,EACZ,IAAI,MAAM,EACV,QAAQ,OAAO,KACd,WAiBD,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const createLobbyJoinedEvent = (lobby, me, isHost) => ({
|
|
2
|
-
type: "LOBBY_JOINED",
|
|
3
|
-
payload: {
|
|
4
|
-
lobby: {
|
|
5
|
-
code: lobby.code,
|
|
6
|
-
quizInfo: lobby.quizInfo,
|
|
7
|
-
status: lobby.status,
|
|
8
|
-
timeoutStartedAt: lobby.timeoutStartedAt,
|
|
9
|
-
duration: lobby.duration,
|
|
10
|
-
currentStep: lobby.currentStep,
|
|
11
|
-
settings: lobby.settings,
|
|
12
|
-
},
|
|
13
|
-
me,
|
|
14
|
-
players: isHost ? lobby.players : undefined,
|
|
15
|
-
currentAnswers: isHost ? lobby.currentAnswers : undefined,
|
|
16
|
-
answers: isHost ? lobby.answers : undefined,
|
|
17
|
-
}
|
|
18
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { LobbyStatus, Player } from "../../types/lobby";
|
|
2
|
-
import { SafeQuestion } from "../../types/question";
|
|
3
|
-
import { Slide } from "../../types/slide";
|
|
4
|
-
import { Answer } from "../../util/validator";
|
|
5
|
-
export type LobbyStatusUpdate = {
|
|
6
|
-
type: "LOBBY_STATUS_UPDATE";
|
|
7
|
-
payload: {
|
|
8
|
-
status: LobbyStatus.waiting;
|
|
9
|
-
} | {
|
|
10
|
-
status: LobbyStatus.slide;
|
|
11
|
-
slide: Slide;
|
|
12
|
-
} | {
|
|
13
|
-
status: LobbyStatus.question;
|
|
14
|
-
question: SafeQuestion;
|
|
15
|
-
timeoutStartedAt: number;
|
|
16
|
-
duration: number;
|
|
17
|
-
} | {
|
|
18
|
-
status: LobbyStatus.answer;
|
|
19
|
-
timeoutStartedAt: number;
|
|
20
|
-
duration: number;
|
|
21
|
-
} | {
|
|
22
|
-
status: LobbyStatus.answers;
|
|
23
|
-
answers: Answer[];
|
|
24
|
-
} | {
|
|
25
|
-
status: LobbyStatus.score;
|
|
26
|
-
leaderboard: Player[];
|
|
27
|
-
} | {
|
|
28
|
-
status: LobbyStatus.end;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export declare const createLobbyStatusUpdateEvent: (payload: LobbyStatusUpdate["payload"]) => LobbyStatusUpdate;
|
|
32
|
-
//# sourceMappingURL=lobby-status-update.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lobby-status-update.d.ts","sourceRoot":"","sources":["../../../src/events/server/lobby-status-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EACH;QAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAA;KAAE,GAC/B;QAAE,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,GAC3C;QAAE,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GACpG;QAAE,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC;QAAC,gBAAgB,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAC1E;QAAE,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,GAClD;QAAE,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC;QAAC,WAAW,EAAE,MAAM,EAAE,CAAA;KAAE,GACpD;QAAE,MAAM,EAAE,WAAW,CAAC,GAAG,CAAA;KAAE,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,SAAS,iBAAiB,CAAC,SAAS,CAAC,KACpC,iBAGD,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export type PlayerAnswerResult = {
|
|
2
|
-
type: "PLAYER_ANSWER_RESULT";
|
|
3
|
-
payload: {
|
|
4
|
-
isCorrect: boolean;
|
|
5
|
-
pointsAwarded: number;
|
|
6
|
-
score: number;
|
|
7
|
-
streak: number;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
export declare const createPlayerAnswerResultEvent: (isCorrect: boolean, pointsAwarded: number, score: number, streak: number) => PlayerAnswerResult;
|
|
11
|
-
//# sourceMappingURL=player-answer-result.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"player-answer-result.d.ts","sourceRoot":"","sources":["../../../src/events/server/player-answer-result.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE;QACP,SAAS,EAAE,OAAO,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,6BAA6B,GACxC,WAAW,OAAO,EAClB,eAAe,MAAM,EACrB,OAAO,MAAM,EACb,QAAQ,MAAM,KACb,kBAGD,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Player } from "../../types/lobby";
|
|
2
|
-
export type PlayerJoined = {
|
|
3
|
-
type: "PLAYER_JOINED";
|
|
4
|
-
payload: {
|
|
5
|
-
player: Player;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const createPlayerJoinedEvent: (player: Player) => PlayerJoined;
|
|
9
|
-
//# sourceMappingURL=player-joined.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"player-joined.d.ts","sourceRoot":"","sources":["../../../src/events/server/player-joined.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,YAGvD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"player-kicked.d.ts","sourceRoot":"","sources":["../../../src/events/server/player-kicked.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,EAAE,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,YAGzC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"player-left.d.ts","sourceRoot":"","sources":["../../../src/events/server/player-left.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,QAAQ,MAAM,KAAG,UAGrD,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Player } from "../../types/lobby";
|
|
2
|
-
export type PlayerUpdate = {
|
|
3
|
-
type: "PLAYER_UPDATE";
|
|
4
|
-
payload: {
|
|
5
|
-
player: Player;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const createPlayerUpdateEvent: (player: Player) => PlayerUpdate;
|
|
9
|
-
//# sourceMappingURL=player-update.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"player-update.d.ts","sourceRoot":"","sources":["../../../src/events/server/player-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,QAAQ,MAAM,KAAG,YAGvD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-lobby-answers.d.ts","sourceRoot":"","sources":["../../../src/events/server/update-lobby-answers.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,sBAAsB,CAAC;IAC7B,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,OAAO,MAAM,KAAG,kBAG5D,CAAC"}
|
package/dist/index.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export * from './events/client/host/kick-player';
|
|
2
|
-
export * from './events/client/host/next-step';
|
|
3
|
-
export * from './events/client/host/start-lobby';
|
|
4
|
-
export * from './events/client/player/submit-answer';
|
|
5
|
-
export * from './events/server/lobby-deleted';
|
|
6
|
-
export * from './events/server/lobby-joined';
|
|
7
|
-
export * from './events/server/lobby-status-update';
|
|
8
|
-
export * from './events/server/player-answer-result';
|
|
9
|
-
export * from './events/server/player-joined';
|
|
10
|
-
export * from './events/server/player-kicked';
|
|
11
|
-
export * from './events/server/player-left';
|
|
12
|
-
export * from './events/server/player-update';
|
|
13
|
-
export * from './events/server/update-lobby-answers';
|
|
14
|
-
export * from './managers/lobby-manager';
|
|
15
|
-
export * from './types/questions/multiple-choice';
|
|
16
|
-
export * from './types/questions/short-answer';
|
|
17
|
-
export * from './types/questions/true-false';
|
|
18
|
-
export * from './types/events';
|
|
19
|
-
export * from './types/lobby';
|
|
20
|
-
export * from './types/quizfile';
|
|
21
|
-
export * from './util/guards';
|
|
22
|
-
export * from './util/names/names';
|
|
23
|
-
export * from './util/sanitizer';
|
|
24
|
-
export * from './util/score';
|
|
25
|
-
export * from './util/validator';
|
|
26
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export * from './events/client/host/kick-player';
|
|
2
|
-
export * from './events/client/host/next-step';
|
|
3
|
-
export * from './events/client/host/start-lobby';
|
|
4
|
-
export * from './events/client/player/submit-answer';
|
|
5
|
-
export * from './events/server/lobby-deleted';
|
|
6
|
-
export * from './events/server/lobby-joined';
|
|
7
|
-
export * from './events/server/lobby-status-update';
|
|
8
|
-
export * from './events/server/player-answer-result';
|
|
9
|
-
export * from './events/server/player-joined';
|
|
10
|
-
export * from './events/server/player-kicked';
|
|
11
|
-
export * from './events/server/player-left';
|
|
12
|
-
export * from './events/server/player-update';
|
|
13
|
-
export * from './events/server/update-lobby-answers';
|
|
14
|
-
export * from './managers/lobby-manager';
|
|
15
|
-
export * from './types/questions/multiple-choice';
|
|
16
|
-
export * from './types/questions/short-answer';
|
|
17
|
-
export * from './types/questions/true-false';
|
|
18
|
-
export * from './types/events';
|
|
19
|
-
export * from './types/lobby';
|
|
20
|
-
export * from './types/quizfile';
|
|
21
|
-
export * from './util/guards';
|
|
22
|
-
export * from './util/names/names';
|
|
23
|
-
export * from './util/sanitizer';
|
|
24
|
-
export * from './util/score';
|
|
25
|
-
export * from './util/validator';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { PlayerAnswerResult } from "../events/server/player-answer-result";
|
|
2
|
-
import { Lobby } from "../types/lobby";
|
|
3
|
-
import { QuizFile } from "../types/quizfile";
|
|
4
|
-
import { SubmittedAnswer } from "../util/validator";
|
|
5
|
-
export declare const createLobby: (code: string, hostId: string, quiz: QuizFile) => Lobby;
|
|
6
|
-
export declare const advanceLobby: (lobby: Lobby) => Lobby;
|
|
7
|
-
export type SubmissionResult = {
|
|
8
|
-
nextLobby: Lobby;
|
|
9
|
-
result: PlayerAnswerResult;
|
|
10
|
-
};
|
|
11
|
-
export declare const handleSubmission: (lobby: Lobby, playerId: string, submission: SubmittedAnswer) => SubmissionResult | null;
|
|
12
|
-
//# sourceMappingURL=lobby-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lobby-manager.d.ts","sourceRoot":"","sources":["../../src/managers/lobby-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAe,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,OAAO,EAAqB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEvE,eAAO,MAAM,WAAW,GACtB,MAAM,MAAM,EACZ,QAAQ,MAAM,EACd,MAAM,QAAQ,KACb,KAiBD,CAAC;AAEH,eAAO,MAAM,YAAY,GAAI,OAAO,KAAK,KAAG,KAmC3C,CAAC;AA0BF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,KAAK,CAAC;IACjB,MAAM,EAAE,kBAAkB,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,OAAO,KAAK,EACZ,UAAU,MAAM,EAChB,YAAY,eAAe,KAC1B,gBAAgB,GAAG,IA0CrB,CAAC"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { LobbyStatus } from "../types/lobby";
|
|
2
|
-
import { isQuestion } from "../util/guards";
|
|
3
|
-
import { calculateScore } from "../util/score";
|
|
4
|
-
import { isCorrect } from "../util/validator";
|
|
5
|
-
export const createLobby = (code, hostId, quiz) => ({
|
|
6
|
-
code,
|
|
7
|
-
host: hostId,
|
|
8
|
-
quiz,
|
|
9
|
-
quizInfo: {
|
|
10
|
-
title: quiz.title,
|
|
11
|
-
stepCount: quiz.steps.length,
|
|
12
|
-
theme: quiz.theme
|
|
13
|
-
},
|
|
14
|
-
players: [],
|
|
15
|
-
status: LobbyStatus.waiting,
|
|
16
|
-
currentStep: 0,
|
|
17
|
-
timeoutStartedAt: null,
|
|
18
|
-
duration: null,
|
|
19
|
-
currentAnswers: [],
|
|
20
|
-
answers: [],
|
|
21
|
-
settings: { customNames: true, displayOnDevice: true }
|
|
22
|
-
});
|
|
23
|
-
export const advanceLobby = (lobby) => {
|
|
24
|
-
const isLastStep = lobby.currentStep >= lobby.quiz.steps.length - 1;
|
|
25
|
-
switch (lobby.status) {
|
|
26
|
-
case LobbyStatus.waiting:
|
|
27
|
-
return prepareStep(lobby, 0);
|
|
28
|
-
case LobbyStatus.slide:
|
|
29
|
-
case LobbyStatus.score:
|
|
30
|
-
return isLastStep
|
|
31
|
-
? { ...lobby, status: LobbyStatus.end }
|
|
32
|
-
: prepareStep(lobby, lobby.currentStep + 1);
|
|
33
|
-
case LobbyStatus.question: {
|
|
34
|
-
const step = lobby.quiz.steps[lobby.currentStep];
|
|
35
|
-
if (step.type !== 'question')
|
|
36
|
-
return lobby;
|
|
37
|
-
return {
|
|
38
|
-
...lobby,
|
|
39
|
-
status: LobbyStatus.answer,
|
|
40
|
-
timeoutStartedAt: Date.now(),
|
|
41
|
-
duration: step.data.timeLimit * 1000,
|
|
42
|
-
currentAnswers: []
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
case LobbyStatus.answer:
|
|
46
|
-
return { ...lobby, status: LobbyStatus.answers };
|
|
47
|
-
case LobbyStatus.answers:
|
|
48
|
-
return { ...lobby, status: LobbyStatus.score };
|
|
49
|
-
default:
|
|
50
|
-
return lobby;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
// Prepares the lobby for the next step
|
|
54
|
-
const prepareStep = (lobby, index) => {
|
|
55
|
-
const step = lobby.quiz.steps[index];
|
|
56
|
-
if (!step)
|
|
57
|
-
return lobby;
|
|
58
|
-
if (step.type === "slide") {
|
|
59
|
-
return {
|
|
60
|
-
...lobby,
|
|
61
|
-
status: LobbyStatus.slide,
|
|
62
|
-
currentStep: index
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
...lobby,
|
|
67
|
-
status: LobbyStatus.question,
|
|
68
|
-
currentStep: index,
|
|
69
|
-
timeoutStartedAt: null,
|
|
70
|
-
duration: null,
|
|
71
|
-
currentAnswers: []
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
export const handleSubmission = (lobby, playerId, submission) => {
|
|
75
|
-
if (lobby.status !== LobbyStatus.answer)
|
|
76
|
-
return null;
|
|
77
|
-
const step = lobby.quiz.steps[lobby.currentStep];
|
|
78
|
-
if (!isQuestion(step))
|
|
79
|
-
return null;
|
|
80
|
-
const player = lobby.players.find(p => p.id === playerId);
|
|
81
|
-
if (!player)
|
|
82
|
-
return null;
|
|
83
|
-
if (lobby.currentAnswers.some(a => a.playerId === playerId))
|
|
84
|
-
return null;
|
|
85
|
-
const correct = isCorrect(step.data, submission);
|
|
86
|
-
const timeTaken = Date.now() - (lobby.timeoutStartedAt ?? 0);
|
|
87
|
-
const answerObj = {
|
|
88
|
-
playerId,
|
|
89
|
-
submission,
|
|
90
|
-
timeTaken,
|
|
91
|
-
isCorrect: correct,
|
|
92
|
-
pointsAwarded: 0
|
|
93
|
-
};
|
|
94
|
-
const { newScore, pointsAwarded } = calculateScore(player, step.data, answerObj, lobby.quiz);
|
|
95
|
-
answerObj.pointsAwarded = pointsAwarded;
|
|
96
|
-
const nextLobby = {
|
|
97
|
-
...lobby,
|
|
98
|
-
players: lobby.players.map(p => p.id === playerId ? {
|
|
99
|
-
...p,
|
|
100
|
-
score: newScore,
|
|
101
|
-
streak: correct ? p.streak + 1 : 0
|
|
102
|
-
} : p),
|
|
103
|
-
currentAnswers: [...lobby.currentAnswers, answerObj]
|
|
104
|
-
};
|
|
105
|
-
return {
|
|
106
|
-
nextLobby,
|
|
107
|
-
result: {
|
|
108
|
-
type: "PLAYER_ANSWER_RESULT",
|
|
109
|
-
payload: { isCorrect: correct, pointsAwarded, score: newScore, streak: correct ? player.streak + 1 : 0 }
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
};
|
package/dist/types/events.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { LobbyJoined } from "../events/server/lobby-joined";
|
|
2
|
-
import { PlayerJoined } from "../events/server/player-joined";
|
|
3
|
-
import { PlayerLeft } from "../events/server/player-left";
|
|
4
|
-
import { PlayerUpdate } from "../events/server/player-update";
|
|
5
|
-
import { LobbyStatusUpdate } from "../events/server/lobby-status-update";
|
|
6
|
-
import { UpdateLobbyAnswers } from "../events/server/update-lobby-answers";
|
|
7
|
-
import { PlayerAnswerResult } from "../events/server/player-answer-result";
|
|
8
|
-
import { PlayerKicked } from "../events/server/player-kicked";
|
|
9
|
-
import { LobbyDeleted } from "../events/server/lobby-deleted";
|
|
10
|
-
import { KickPlayer } from "../events/client/host/kick-player";
|
|
11
|
-
import { StartLobby } from "../events/client/host/start-lobby";
|
|
12
|
-
import { NextStep } from "../events/client/host/next-step";
|
|
13
|
-
import { SubmitAnswer } from "../events/client/player/submit-answer";
|
|
14
|
-
export type AllClientEvents = KickPlayer | StartLobby | NextStep | SubmitAnswer;
|
|
15
|
-
export type AllServerEvents = PlayerJoined | PlayerLeft | PlayerUpdate | LobbyStatusUpdate | UpdateLobbyAnswers | PlayerAnswerResult | PlayerKicked | LobbyDeleted | LobbyJoined;
|
|
16
|
-
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAGrE,MAAM,MAAM,eAAe,GACzB,UAAU,GACV,UAAU,GACV,QAAQ,GACR,YAAY,CAAC;AAGf,MAAM,MAAM,eAAe,GACzB,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,YAAY,GACZ,YAAY,GACZ,WAAW,CAAC"}
|
package/dist/types/events.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/lobby.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Answer } from "../util/validator";
|
|
2
|
-
import { QuizFile } from "./quizfile";
|
|
3
|
-
import { QuizTheme } from "./quiztheme";
|
|
4
|
-
export type Lobby = {
|
|
5
|
-
code: string;
|
|
6
|
-
host: string;
|
|
7
|
-
quiz: QuizFile;
|
|
8
|
-
quizInfo: {
|
|
9
|
-
title: string;
|
|
10
|
-
stepCount: number;
|
|
11
|
-
theme: QuizTheme;
|
|
12
|
-
};
|
|
13
|
-
players: Player[];
|
|
14
|
-
status: LobbyStatus;
|
|
15
|
-
timeoutStartedAt: number | null;
|
|
16
|
-
duration: number | null;
|
|
17
|
-
currentStep: number;
|
|
18
|
-
currentAnswers: Answer[];
|
|
19
|
-
answers: Answer[];
|
|
20
|
-
settings: LobbySettings;
|
|
21
|
-
};
|
|
22
|
-
export type LobbySettings = {
|
|
23
|
-
customNames: boolean;
|
|
24
|
-
displayOnDevice: boolean;
|
|
25
|
-
};
|
|
26
|
-
export declare enum LobbyStatus {
|
|
27
|
-
waiting = "waiting",
|
|
28
|
-
slide = "slide",
|
|
29
|
-
question = "question",
|
|
30
|
-
answer = "answer",
|
|
31
|
-
answers = "answers",
|
|
32
|
-
score = "score",
|
|
33
|
-
end = "end"
|
|
34
|
-
}
|
|
35
|
-
export type Player = {
|
|
36
|
-
id: string;
|
|
37
|
-
name: string;
|
|
38
|
-
score: number;
|
|
39
|
-
streak: number;
|
|
40
|
-
isConnected: boolean;
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=lobby.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lobby.d.ts","sourceRoot":"","sources":["../../src/types/lobby.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,MAAM,KAAK,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAA;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;CACtB,CAAA"}
|
package/dist/types/lobby.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export var LobbyStatus;
|
|
2
|
-
(function (LobbyStatus) {
|
|
3
|
-
LobbyStatus["waiting"] = "waiting";
|
|
4
|
-
LobbyStatus["slide"] = "slide";
|
|
5
|
-
LobbyStatus["question"] = "question";
|
|
6
|
-
LobbyStatus["answer"] = "answer";
|
|
7
|
-
LobbyStatus["answers"] = "answers";
|
|
8
|
-
LobbyStatus["score"] = "score";
|
|
9
|
-
LobbyStatus["end"] = "end";
|
|
10
|
-
})(LobbyStatus || (LobbyStatus = {}));
|
package/dist/types/question.d.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { MultipleChoiceQuestion, SafeMultipleChoiceQuestion } from "./questions/multiple-choice";
|
|
3
|
-
import { SafeTrueFalseQuestion, TrueFalseQuestion } from "./questions/true-false";
|
|
4
|
-
import { SafeShortAnswerQuestion, ShortAnswerQuestion } from "./questions/short-answer";
|
|
5
|
-
export type Question = MultipleChoiceQuestion | TrueFalseQuestion | ShortAnswerQuestion;
|
|
6
|
-
export declare const QuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
7
|
-
question: z.ZodString;
|
|
8
|
-
imageHash: z.ZodOptional<z.ZodCustomStringFormat<"sha256_hex">>;
|
|
9
|
-
displayTime: z.ZodNumber;
|
|
10
|
-
timeLimit: z.ZodNumber;
|
|
11
|
-
points: z.ZodEnum<{
|
|
12
|
-
normalPoints: "normalPoints";
|
|
13
|
-
doublePoints: "doublePoints";
|
|
14
|
-
noPoints: "noPoints";
|
|
15
|
-
}>;
|
|
16
|
-
type: z.ZodLiteral<"multiple-choice">;
|
|
17
|
-
choices: z.ZodArray<z.ZodObject<{
|
|
18
|
-
text: z.ZodString;
|
|
19
|
-
correct: z.ZodBoolean;
|
|
20
|
-
}, z.core.$strip>>;
|
|
21
|
-
matchAll: z.ZodBoolean;
|
|
22
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
-
question: z.ZodString;
|
|
24
|
-
imageHash: z.ZodOptional<z.ZodCustomStringFormat<"sha256_hex">>;
|
|
25
|
-
displayTime: z.ZodNumber;
|
|
26
|
-
timeLimit: z.ZodNumber;
|
|
27
|
-
points: z.ZodEnum<{
|
|
28
|
-
normalPoints: "normalPoints";
|
|
29
|
-
doublePoints: "doublePoints";
|
|
30
|
-
noPoints: "noPoints";
|
|
31
|
-
}>;
|
|
32
|
-
type: z.ZodLiteral<"true-false">;
|
|
33
|
-
answer: z.ZodBoolean;
|
|
34
|
-
labels: z.ZodArray<z.ZodString>;
|
|
35
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
36
|
-
question: z.ZodString;
|
|
37
|
-
imageHash: z.ZodOptional<z.ZodCustomStringFormat<"sha256_hex">>;
|
|
38
|
-
displayTime: z.ZodNumber;
|
|
39
|
-
timeLimit: z.ZodNumber;
|
|
40
|
-
points: z.ZodEnum<{
|
|
41
|
-
normalPoints: "normalPoints";
|
|
42
|
-
doublePoints: "doublePoints";
|
|
43
|
-
noPoints: "noPoints";
|
|
44
|
-
}>;
|
|
45
|
-
type: z.ZodLiteral<"short-answer">;
|
|
46
|
-
answers: z.ZodArray<z.ZodString>;
|
|
47
|
-
}, z.core.$strip>], "type">;
|
|
48
|
-
export type SafeQuestion = SafeMultipleChoiceQuestion | SafeTrueFalseQuestion | SafeShortAnswerQuestion;
|
|
49
|
-
export declare const SafeQuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
50
|
-
points: z.ZodEnum<{
|
|
51
|
-
normalPoints: "normalPoints";
|
|
52
|
-
doublePoints: "doublePoints";
|
|
53
|
-
noPoints: "noPoints";
|
|
54
|
-
}>;
|
|
55
|
-
type: z.ZodLiteral<"multiple-choice">;
|
|
56
|
-
question: z.ZodString;
|
|
57
|
-
imageHash: z.ZodOptional<z.ZodCustomStringFormat<"sha256_hex">>;
|
|
58
|
-
displayTime: z.ZodNumber;
|
|
59
|
-
timeLimit: z.ZodNumber;
|
|
60
|
-
matchAll: z.ZodBoolean;
|
|
61
|
-
choices: z.ZodArray<z.ZodObject<{
|
|
62
|
-
text: z.ZodString;
|
|
63
|
-
}, z.core.$strip>>;
|
|
64
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
-
points: z.ZodEnum<{
|
|
66
|
-
normalPoints: "normalPoints";
|
|
67
|
-
doublePoints: "doublePoints";
|
|
68
|
-
noPoints: "noPoints";
|
|
69
|
-
}>;
|
|
70
|
-
type: z.ZodLiteral<"true-false">;
|
|
71
|
-
question: z.ZodString;
|
|
72
|
-
imageHash: z.ZodOptional<z.ZodCustomStringFormat<"sha256_hex">>;
|
|
73
|
-
displayTime: z.ZodNumber;
|
|
74
|
-
timeLimit: z.ZodNumber;
|
|
75
|
-
labels: z.ZodArray<z.ZodString>;
|
|
76
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
77
|
-
points: z.ZodEnum<{
|
|
78
|
-
normalPoints: "normalPoints";
|
|
79
|
-
doublePoints: "doublePoints";
|
|
80
|
-
noPoints: "noPoints";
|
|
81
|
-
}>;
|
|
82
|
-
type: z.ZodLiteral<"short-answer">;
|
|
83
|
-
question: z.ZodString;
|
|
84
|
-
imageHash: z.ZodOptional<z.ZodCustomStringFormat<"sha256_hex">>;
|
|
85
|
-
displayTime: z.ZodNumber;
|
|
86
|
-
timeLimit: z.ZodNumber;
|
|
87
|
-
}, z.core.$strip>], "type">;
|
|
88
|
-
export type QuestionPoints = z.infer<typeof QuestionPointsSchema>;
|
|
89
|
-
export declare const QuestionPointsSchema: z.ZodEnum<{
|
|
90
|
-
normalPoints: "normalPoints";
|
|
91
|
-
doublePoints: "doublePoints";
|
|
92
|
-
noPoints: "noPoints";
|
|
93
|
-
}>;
|
|
94
|
-
export type BaseQuestion = z.infer<typeof BaseQuestionSchema>;
|
|
95
|
-
export declare const BaseQuestionSchema: z.ZodObject<{
|
|
96
|
-
question: z.ZodString;
|
|
97
|
-
imageHash: z.ZodOptional<z.ZodCustomStringFormat<"sha256_hex">>;
|
|
98
|
-
displayTime: z.ZodNumber;
|
|
99
|
-
timeLimit: z.ZodNumber;
|
|
100
|
-
points: z.ZodEnum<{
|
|
101
|
-
normalPoints: "normalPoints";
|
|
102
|
-
doublePoints: "doublePoints";
|
|
103
|
-
noPoints: "noPoints";
|
|
104
|
-
}>;
|
|
105
|
-
}, z.core.$strip>;
|
|
106
|
-
//# sourceMappingURL=question.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../src/types/question.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAgC,0BAA0B,EAAoC,MAAM,6BAA6B,CAAC;AACjK,OAAO,EAAE,qBAAqB,EAA+B,iBAAiB,EAA2B,MAAM,wBAAwB,CAAC;AACxI,OAAO,EAAE,uBAAuB,EAAiC,mBAAmB,EAA6B,MAAM,0BAA0B,CAAC;AAElJ,MAAM,MAAM,QAAQ,GAAG,sBAAsB,GAAG,iBAAiB,GAAG,mBAAmB,CAAC;AAExF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAIzB,CAAC;AAEH,MAAM,MAAM,YAAY,GACpB,0BAA0B,GAC1B,qBAAqB,GACrB,uBAAuB,CAAC;AAE5B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAI7B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,oBAAoB;;;;EAAuD,CAAC;AAEzF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,kBAAkB;;;;;;;;;;iBAM7B,CAAC"}
|