Formatted code
This commit is contained in:
@@ -13,12 +13,12 @@ SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
let quiz_answers = [];
|
||||
let quiz_colors = [];
|
||||
let answer_correct: boolean[] = []
|
||||
let answer_correct: boolean[] = [];
|
||||
|
||||
for (const i of question.answers) {
|
||||
quiz_answers.push(i.answer);
|
||||
quiz_colors.push(i.color);
|
||||
answer_correct.push(i.right)
|
||||
answer_correct.push(i.right);
|
||||
}
|
||||
|
||||
let sorted_data = {};
|
||||
@@ -46,9 +46,12 @@ SPDX-License-Identifier: MPL-2.0
|
||||
{#each quiz_answers as answer, i}
|
||||
<div
|
||||
class="w-20 self-end flex justify-center border border-black shadow-xl rounded"
|
||||
class:shadow-blue-500={answer_correct[i] && question.type !== QuizQuestionType.VOTING}
|
||||
class:shadow-yellow-500={!answer_correct[i] && question.type !== QuizQuestionType.VOTING}
|
||||
class:opacity-70={!answer_correct[i] && question.type !== QuizQuestionType.VOTING}
|
||||
class:shadow-blue-500={answer_correct[i] &&
|
||||
question.type !== QuizQuestionType.VOTING}
|
||||
class:shadow-yellow-500={!answer_correct[i] &&
|
||||
question.type !== QuizQuestionType.VOTING}
|
||||
class:opacity-70={!answer_correct[i] &&
|
||||
question.type !== QuizQuestionType.VOTING}
|
||||
style="height: {(sorted_data[answer] * 20) /
|
||||
data.length}rem; background-color: {quiz_colors[i]
|
||||
? quiz_colors[i]
|
||||
@@ -57,11 +60,15 @@ SPDX-License-Identifier: MPL-2.0
|
||||
{/each}
|
||||
</div>
|
||||
<div class="flex gap-12">
|
||||
{#each quiz_answers as answer,i}
|
||||
{#each quiz_answers as answer, i}
|
||||
<div class="w-20">
|
||||
<p class="-rotate-45 text-xl text-str"
|
||||
class:line-through={!answer_correct[i] && question.type !== QuizQuestionType.VOTING}
|
||||
>{@html answer}</p>
|
||||
<p
|
||||
class="-rotate-45 text-xl text-str"
|
||||
class:line-through={!answer_correct[i] &&
|
||||
question.type !== QuizQuestionType.VOTING}
|
||||
>
|
||||
{@html answer}
|
||||
</p>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user