time limit now works and the limit shows in the hosts screen!

This commit is contained in:
RezHackXYZ 2025-06-01 11:59:52 +05:30
parent 41941f98e8
commit c3cfa144d3
8 changed files with 79 additions and 2 deletions

View file

@ -44,6 +44,20 @@
<option value={i + 2}>{i + 2}</option>
{/each}
</select>
<select
bind:value={questions.v[index].timeLimit}
class="h-fit rounded-xl bg-gray-800 p-1 text-center text-white"
>
<option disabled selected>Time Limit</option>
<option value={null}>infinite</option>
<option value={5}>5 sec</option>
<option value={10}>10 sec</option>
<option value={15}>15 sec</option>
<option value={30}>30 sec</option>
<option value={60}>1 min</option>
<option value={120}>2 min</option>
<option value={300}>5 min</option>
</select>
<DeleteQuestion {index} />
</div>

View file

@ -9,6 +9,7 @@ export let questions = $state({
name: "",
answers: ["", "", "", ""],
correctAnswer: undefined,
timeLimit: 30,
},
],
});
@ -22,6 +23,7 @@ export function AddQuestion() {
name: "",
answers: ["", "", "", ""],
correctAnswer: undefined,
timeLimit: 30,
});
}

View file

@ -20,6 +20,7 @@ export async function createGame(questions, gamePin) {
gameid: gamePin,
questionstext: q.name,
correctanswer: q.correctAnswer,
timelimit: q.timeLimit,
media: q.media || null,
}));