Made public quiz view compatible with range-answers

This commit is contained in:
Mawoka
2022-08-04 10:57:02 +02:00
parent df6ce8a8b2
commit 3ad173c101
+12 -2
View File
@@ -32,6 +32,7 @@
import CollapsSection from '$lib/collapsible.svelte'; import CollapsSection from '$lib/collapsible.svelte';
import { createTippy } from 'svelte-tippy'; import { createTippy } from 'svelte-tippy';
import ImportedOrNot from '$lib/view_quiz/imported_or_not.svelte'; import ImportedOrNot from '$lib/view_quiz/imported_or_not.svelte';
import { QuizQuestionType } from '$lib/quiz_types.js';
const tippy = createTippy({ const tippy = createTippy({
arrow: true, arrow: true,
@@ -145,13 +146,17 @@
{/if} {/if}
<span class="m-1 flex flex-row gap-2 w-3/5 flex-nowrap whitespace-nowrap"> <span class="m-1 flex flex-row gap-2 w-3/5 flex-nowrap whitespace-nowrap">
{$t('editor.time_in_seconds')}: {$t('editor.time_in_seconds')}:
<p>{question.time}</p> {question.time}
</span> </span>
{#if question.type === QuizQuestionType.ABCD}
{#each question.answers as answer, index_answer} {#each question.answers as answer, index_answer}
<div <div
class="ml-8 grid grid-cols-1 gap-2 m-2 border border-black border-2 m-1" class="ml-8 grid grid-cols-1 gap-2 m-2 border border-black border-2 m-1"
> >
<h1 class="text-3xl m-1">{$t('words.answer')} {index_answer + 1}</h1> <h1 class="text-3xl m-1">
{$t('words.answer')}
{index_answer + 1}
</h1>
<p class="m-1"> <p class="m-1">
{$t('words.answer')}: {index_answer + 1} {$t('words.answer')}: {index_answer + 1}
{$t('words.question')}: {index_question + 1} {$t('words.question')}: {index_question + 1}
@@ -173,6 +178,11 @@
</label> </label>
</div> </div>
{/each} {/each}
{:else if question.type === QuizQuestionType.RANGE}
All numbers between {question.answers.min_correct}
and {question.answers.max_correct} are correct, where numbers between {question
.answers.min} and {question.answers.max} can be selected.
{/if}
</div> </div>
</CollapsSection> </CollapsSection>
</div> </div>