added ai!
This commit is contained in:
parent
ad959266a5
commit
d1c8ae269b
15 changed files with 311 additions and 146 deletions
|
@ -1,9 +1,7 @@
|
|||
import { createGame } from "./InsertGameInDB.js";
|
||||
import { questions } from "./GameCreateData.svelte.js";
|
||||
import { questions,Wait } from "./GameCreateData.svelte.js";
|
||||
|
||||
export async function startGame() {
|
||||
|
||||
|
||||
if (questions.v.some((q) => q.name === "")) return alert("Please fill all questions");
|
||||
if (questions.v.some((q) => q.answers.some((a) => a === ""))) return alert("Fill all options");
|
||||
if (questions.v.some((q) => q.correctAnswer === undefined))
|
||||
|
@ -13,7 +11,6 @@ export async function startGame() {
|
|||
.toString()
|
||||
.padStart(6, "0");
|
||||
|
||||
await createGame(questions.v, gamePin);
|
||||
Wait.v = true;
|
||||
|
||||
window.location.href = "/host/" + gamePin;
|
||||
}
|
||||
await createGame(questions.v, gamePin);}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue