Improved question-type selection and fixed bug where Check Choice and ABCD were inverted

This commit is contained in:
Mawoka
2023-06-17 13:35:36 +02:00
parent b4c6f7f0ac
commit cc7d3a489b
16 changed files with 154 additions and 57 deletions
@@ -16,8 +16,6 @@
const default_colors = ['#D6EDC9', '#B07156', '#7F7057', '#4E6E58'];
console.log(get_foreground_color(default_colors[0]));
export let selected_question: number;
export let check_choice = false;
export let data: EditorData;
@@ -43,9 +41,8 @@
};
};
$: save_colors(data);
data.questions[selected_question].type = check_choice
? QuizQuestionType.ABCD
: QuizQuestionType.CHECK;
data.questions[selected_question].type =
check_choice === true ? QuizQuestionType.CHECK : QuizQuestionType.ABCD;
</script>
<div class="grid grid-rows-2 grid-flow-col auto-cols-auto gap-4 w-full px-10">
@@ -97,7 +94,6 @@
type="button"
on:click={() => {
answer.right = !answer.right;
console.log(answer.right);
}}
>
{#if answer.right}