Updated to Svelte 5
This commit is contained in:
@@ -8,8 +8,12 @@ SPDX-License-Identifier: MPL-2.0
|
||||
import type { Question } from '$lib/quiz_types';
|
||||
import { QuizQuestionType } from '$lib/quiz_types';
|
||||
|
||||
export let data;
|
||||
export let question: Question;
|
||||
interface Props {
|
||||
data: any;
|
||||
question: Question;
|
||||
}
|
||||
|
||||
let { data, question }: Props = $props();
|
||||
|
||||
let quiz_answers = [];
|
||||
let quiz_colors = [];
|
||||
@@ -21,7 +25,7 @@ SPDX-License-Identifier: MPL-2.0
|
||||
answer_correct.push(i.right);
|
||||
}
|
||||
|
||||
let sorted_data = {};
|
||||
let sorted_data = $state({});
|
||||
for (const i of quiz_answers) {
|
||||
sorted_data[i] = 0;
|
||||
}
|
||||
@@ -56,7 +60,7 @@ SPDX-License-Identifier: MPL-2.0
|
||||
data.length}rem; background-color: {quiz_colors[i]
|
||||
? quiz_colors[i]
|
||||
: 'black'}"
|
||||
/>
|
||||
></div>
|
||||
{/each}
|
||||
</div>
|
||||
<div class="flex gap-12">
|
||||
|
||||
Reference in New Issue
Block a user