diff --git a/frontend/src/lib/play/end.svelte b/frontend/src/lib/play/end.svelte index 86d71a4..64fbfdd 100644 --- a/frontend/src/lib/play/end.svelte +++ b/frontend/src/lib/play/end.svelte @@ -80,47 +80,54 @@

{$t('play_page.end_sentence')}

{#if data_available} -
-
-

- {$t('play_page.1st_place')}: {winners_arr[0][0]} - {$t('play_page.with_out_of', { - correct_questions: winners_arr[0][1] ?? 0, - total_question_count: quiz_data.questions.length - })} -

+ {#if winners_arr[0][0] === undefined} +
+

{$t('admin_page.no_answers')}

- {#if winners_arr.length >= 2} + {:else} +
-

- {$t('play_page.2nd_place')}: - {winners_arr[1][0]} +

+ {$t('play_page.1st_place')}: + {winners_arr[0][0]} {$t('play_page.with_out_of', { - correct_questions: winners_arr[1][1] ?? 0, + correct_questions: winners_arr[0][1] ?? 0, total_question_count: quiz_data.questions.length })}

- {/if} - {#if winners_arr.length >= 3} -
-

- {$t('play_page.3rd place')}: - {winners_arr[2][0]} - - {$t('play_page.with_out_of', { - correct_questions: winners_arr[2][1] ?? 0, - total_question_count: quiz_data.questions.length - })} - -

-
- {/if} -
+ {#if winners_arr.length >= 2 && winners_arr[1][0] !== undefined} +
+

+ {$t('play_page.2nd_place')}: + {winners_arr[1][0]} + {$t('play_page.with_out_of', { + correct_questions: winners_arr[1][1] ?? 0, + total_question_count: quiz_data.questions.length + })} +

+
+ {/if} + {#if winners_arr.length >= 3 && winners_arr[2][0] !== undefined} +
+

+ {$t('play_page.3rd place')}: + {winners_arr[2][0]} + + {$t('play_page.with_out_of', { + correct_questions: winners_arr[2][1] ?? 0, + total_question_count: quiz_data.questions.length + })} + +

+
+ {/if} +
+ {/if} {:else}

{$t('admin_page.no_answers')}