adding manager UI and audio and video (youtube) questions

This commit is contained in:
RandyJC
2025-11-28 21:17:18 +01:00
parent c79d82c565
commit 14ea9c75cd
16 changed files with 1018 additions and 80 deletions

View File

@@ -17,6 +17,7 @@ export type Quizz = {
questions: {
question: string
image?: string
media?: QuestionMedia
answers: string[]
solution: number
cooldown: number
@@ -24,6 +25,12 @@ export type Quizz = {
}[]
}
export type QuestionMedia =
| { type: "image"; url: string }
| { type: "audio"; url: string }
| { type: "video"; url: string }
| { type: "youtube"; url: string }
export type QuizzWithId = Quizz & { id: string }
export type GameUpdateQuestion = {

View File

@@ -1,4 +1,4 @@
import { Player } from "."
import { Player, QuestionMedia } from "."
export const STATUS = {
SHOW_ROOM: "SHOW_ROOM",
@@ -18,11 +18,17 @@ export type Status = (typeof STATUS)[keyof typeof STATUS]
export type CommonStatusDataMap = {
SHOW_START: { time: number; subject: string }
SHOW_PREPARED: { totalAnswers: number; questionNumber: number }
SHOW_QUESTION: { question: string; image?: string; cooldown: number }
SHOW_QUESTION: {
question: string
image?: string
media?: QuestionMedia
cooldown: number
}
SELECT_ANSWER: {
question: string
answers: string[]
image?: string
media?: QuestionMedia
time: number
totalPlayer: number
}
@@ -46,6 +52,7 @@ type ManagerExtraStatus = {
correct: number
answers: string[]
image?: string
media?: QuestionMedia
}
SHOW_LEADERBOARD: { oldLeaderboard: Player[]; leaderboard: Player[] }
}