added ai!

This commit is contained in:
RezHackXYZ 2025-05-25 12:28:14 +05:30
parent ad959266a5
commit d1c8ae269b
No known key found for this signature in database
15 changed files with 311 additions and 146 deletions

View file

@ -1,54 +1,36 @@
import { DefaultQuestions } from "$lib/config.js";
export let Wait = $state({
v: false,
});
export let questions = $state({
v: [
{
name: '',
answers: ['', '', '', ''],
correctAnswer: undefined
}
]
name: "",
answers: ["", "", "", ""],
correctAnswer: undefined,
},
],
});
let DemoQuestions = [
{
name: 'Is hack club awesome?',
answers: ['its ok', 'its the BEST place in the world', 'its bad', 'Gu Gu Ga Ga'],
correctAnswer: 1
},
{
name: 'Who is the best programer in the world?',
answers: ['Some person', 'Bill Gates', 'RezHackXYZ', 'another person'],
correctAnswer: 2
},
{
name: 'What was the 5/11 incident?',
answers: [
'mass pings of @/birds',
'twin towers getting blasted by planes',
'the opening ceremony of the store of 7/11 on the 5/11 date',
'the opening ceremony of the competitor store of 7/11'
],
correctAnswer: 0
}
];
export function SetQuestionsToDemoQuestions() {
questions.v = DemoQuestions;
questions.v = DefaultQuestions;
}
export function AddQuestion() {
questions.v.push({
name: '',
answers: ['', '', '', ''],
correctAnswer: undefined
name: "",
answers: ["", "", "", ""],
correctAnswer: undefined,
});
}
export function DeleteQuestion(index) {
if (questions.v.length > 1) {
if (confirm('Are you sure you want to delete this question? You cant undo this.')) {
if (confirm("Are you sure you want to delete this question? You cant undo this.")) {
questions.v.splice(index, 1);
}
} else {
alert('You need at least one question.');
alert("You need at least one question.");
}
}