Closes #184 and closes #174

This commit is contained in:
Mawoka
2022-12-03 15:34:42 +01:00
parent 5934d06c7f
commit ac9a84c5e8
2 changed files with 113 additions and 105 deletions
+1 -1
View File
@@ -193,7 +193,7 @@
style="background-color: {answer.color ?? '#B45309'}"
class:opacity-50={!answer.right &&
timer_res === '0' &&
quiz_data.questions[selected_question].type !==
quiz_data.questions[selected_question].type ===
QuizQuestionType.ABCD}
>
<img class="w-14 inline-block pl-4" alt="icon" src={kahoot_icons[i]} />
+16 -8
View File
@@ -98,12 +98,17 @@
$: console.log(slider_value, 'values');
</script>
<div class="h-screen w-screen">
<div class="flex flex-col justify-center w-screen h-1/6">
<h1 class="text-6xl text-center text-black dark:text-white">
<h1 class="text-3xl text-center text-black dark:text-white mt-2">
{@html question.question}
</h1>
<div class="mx-auto my-2">
<CircularTimer bind:text={timer_res} bind:progress={circular_prgoress} color="#ef4444" />
<CircularTimer
bind:text={timer_res}
bind:progress={circular_prgoress}
color="#ef4444"
/>
</div>
</div>
{#if question.image !== null && game_mode !== 'kahoot'}
@@ -129,10 +134,10 @@
{/each}
</div>
{:else if game_mode === 'kahoot'}
<div class="grid grid-cols-2 gap-2 w-full p-4">
<div class="grid grid-cols-2 gap-2 w-full p-4 h-5/6">
{#each question.answers as answer, i}
<button
class="rounded-lg h-fit flex align-middle justify-center disabled:opacity-60 p-3"
class="rounded-lg h-full flex align-middle justify-center disabled:opacity-60 p-3"
style="background-color: {answer.color ?? '#B45309'}"
disabled={selected_answer !== undefined}
on:click={() => selectAnswer(answer.answer)}
@@ -179,13 +184,15 @@
<button
class="text-3xl rounded-lg h-fit flex align-middle justify-center p-3 bg-green-600"
disabled
class:opacity-30={answer.answer !== selected_answer}>{answer.answer}</button
class:opacity-30={answer.answer !== selected_answer}
>{answer.answer}</button
>
{:else}
<button
class="text-3xl rounded-lg h-fit flex align-middle justify-center p-3 bg-red-500"
disabled
class:opacity-30={answer.answer !== selected_answer}>{answer.answer}</button
class:opacity-30={answer.answer !== selected_answer}
>{answer.answer}</button
>
{/if}
{/each}
@@ -196,8 +203,8 @@
<Spinner />
{:else}
<p class="text-center">
Every number between {solution.answers.min_correct} and {solution.answers.max_correct} was
correct. You got {selected_answer}, so you have been
Every number between {solution.answers.min_correct} and {solution.answers
.max_correct} was correct. You got {selected_answer}, so you have been
{#if solution.answers.min_correct <= parseInt(selected_answer) && parseInt(selected_answer) <= solution.answers.max_correct}
correct
{:else}
@@ -213,3 +220,4 @@
bind:question={quiz_data.questions[selected_question]} />
{/await}-->
{/if}
</div>