Updated to Svelte 5

This commit is contained in:
Mawoka
2025-09-21 12:42:04 +02:00
parent fa533257b3
commit a88cf13f82
137 changed files with 2279 additions and 1948 deletions
@@ -13,14 +13,18 @@ SPDX-License-Identifier: MPL-2.0
const { t } = getLocalization();
export let questions: Question[];
export let answers: {
interface Props {
questions: Question[];
answers: {
username: string;
answer: string;
right: boolean;
tike_taken: number;
score: number;
}[][];
}
let { questions, answers }: Props = $props();
const get_average_score = (q_index: number): number => {
const q_answers = answers[q_index];
@@ -49,7 +53,7 @@ SPDX-License-Identifier: MPL-2.0
question_open = q_index;
}
};
let question_open: number | boolean = false;
let question_open: number | boolean = $state(false);
</script>
<div class="w-full flex justify-center">
@@ -61,7 +65,7 @@ SPDX-License-Identifier: MPL-2.0
>
<button
class="text-center underline text-xl"
on:click={() => {
onclick={() => {
toggle_dropdown(i);
}}>{@html question.question}</button
>