{#each questions as question, i}
Q{i + 1}.
{ if (questions.length > 1) { if ( confirm('Are you sure you want to delete this question? You cant undo this.') ) { questions.splice(i, 1); } } else { alert('You need at least one question.'); } }} class="flex h-fit cursor-pointer items-center justify-center rounded-xl bg-red-700 p-2 transition-all hover:scale-110 hover:-rotate-10" >
Delete question
{#each question.answers as answer, i2}
{/each}
{/each}
{ questions.push({ name: '', answers: ['', '', '', ''], correctAnswer: undefined }); }} class="flex h-fit cursor-pointer items-center justify-center rounded-xl bg-green-700 p-2 transition-all hover:scale-110 hover:-rotate-10" >
New question
Start Quiz