{#if Array.isArray(data.questions[selected_question].answers)} {#each data.questions[selected_question].answers as answer, index}
{ data.questions[selected_question].answers.splice(index, 1); data.questions[selected_question].answers = data.questions[selected_question].answers; }} class="border-b-2 border-dotted w-5/6 text-center rounded-lg" style="background-color: {answer.color ?? 'transparent'}" placeholder="Empty..." />
{ answer.right = !answer.right; console.log(answer.right); }} > {#if answer.right}
{:else}
{/if}
{ answer.color = null; }} />
{/each} {/if} {#if data.questions[selected_question].answers.length < 4}
{ data.questions[selected_question].answers = [ ...data.questions[selected_question].answers, { ...get_empty_answer(data.questions[selected_question].answers.length) } ]; }} >
{$t('editor_page.add_an_answer')}
{/if}