diff --git a/classquiz/socket_server/__init__.py b/classquiz/socket_server/__init__.py index b047fef..ee9e50d 100644 --- a/classquiz/socket_server/__init__.py +++ b/classquiz/socket_server/__init__.py @@ -57,7 +57,7 @@ async def join_game(sid, data): {"username": data["username"], "sid": sid}, room=redis_res["admin"], ) - sio.enter_room(sid, data["game_pin"]) # TODO: make more secure + sio.enter_room(sid, data["game_pin"]) @sio.event diff --git a/frontend/i18next-scanner.config.engine.cjs b/frontend/i18next-scanner.config.engine.cjs index 7323129..ad60520 100644 --- a/frontend/i18next-scanner.config.engine.cjs +++ b/frontend/i18next-scanner.config.engine.cjs @@ -10,7 +10,7 @@ module.exports = { trans: false, // Create and update files `en.json`, `fr.json`, `es.json` - lngs: ['en', 'de', 'fr'], + lngs: ['en'], ns: [ // The namespace I use diff --git a/frontend/src/lib/i18n/locales/en.json b/frontend/src/lib/i18n/locales/en.json index 7e03bcc..5df8b07 100644 --- a/frontend/src/lib/i18n/locales/en.json +++ b/frontend/src/lib/i18n/locales/en.json @@ -110,7 +110,9 @@ "already_registered_as_admin": "There is already an admin registered for this game.", "start_game": "Start game", "time_left": "Time left", - "get_results": "Get results" + "get_results": "Get results", + "get_results_and_stop_time": "Get results and stop time", + "get_final_results": "Get final results" }, "password_reset_page": { "reset_password": "Reset password" diff --git a/frontend/src/lib/play/end.svelte b/frontend/src/lib/play/end.svelte index e635734..0147408 100644 --- a/frontend/src/lib/play/end.svelte +++ b/frontend/src/lib/play/end.svelte @@ -66,7 +66,7 @@ {#if winners_arr.length >= 3}

- 2nd Place: {winners_arr[3]}{winners_arr[3]}With {winners[winners_arr[3]]}

diff --git a/frontend/src/routes/admin.svelte b/frontend/src/routes/admin.svelte index 721d7c3..d866ade 100644 --- a/frontend/src/routes/admin.svelte +++ b/frontend/src/routes/admin.svelte @@ -102,6 +102,7 @@ game_id: game_token, question_number: shown_question_now }); + timer_res = '0'; }; const getWinnersSorted = () => { @@ -174,6 +175,17 @@ event.preventDefault(); event.returnValue = ''; }; + + const get_question_title = (q_number: number): string => { + if (q_number - 1 === quiz_data.questions.length) { + return; + } + try { + return quiz_data.questions[q_number].question; + } catch (e) { + return ''; + } + }; @@ -222,9 +234,10 @@ {/if}
{#if timer_res === '0'} - -
- {#if question_results !== null} + {#if question_results === null} + +
+ {:else}
{/if} + {:else if timer_res !== undefined} + {/if}
- -
- {#if selected_question === quiz_data.questions.length} - + {#if get_question_title(selected_question + 1) !== ''} + +
+ {:else} + {/if} {/if} +{#if JSON.stringify(final_results) !== JSON.stringify([null])} + {#await import('$lib/play/end.svelte') then c} + + {/await} +{/if} diff --git a/frontend/src/routes/overview.svelte b/frontend/src/routes/overview.svelte index afe61d8..51cee23 100644 --- a/frontend/src/routes/overview.svelte +++ b/frontend/src/routes/overview.svelte @@ -117,125 +117,132 @@ {$t('words.settings')}
-
-
-
- - - - - - - - - - - - - - {#each quizzes as quiz} - - + {#each quizzes as quiz} + + + + + + + + + + {/each} + +
- {$t('words.title')} - - {$t('overview_page.created_at')} - - {$t('overview_page.question_count')} - - {$t('words.play')} - - {$t('words.edit')} - - {$t('words.delete')} - - {$t('words.public')} -
+
+
+ + + + - {/each} - -
- {quiz.title} - - + - {formatDate(quiz.created_at)} - - + - {quiz.questions.length} - - + - - - + - {$t('words.edit')} - - + - - - + - {#if quiz.public} - ✅ - {:else} - ❌ - {/if} - + {$t('words.public')} +
+ +
+ {quiz.title} + + {formatDate(quiz.created_at)} + + {quiz.questions.length} + + + + {$t('words.edit')} + + + + {#if quiz.public} + ✅ + {:else} + ❌ + {/if} +
+
- + {:else} +

+ Looks like you don't have any quizzes. Wanna change that? Click the + "Create"-button, or import a quiz from KAHOOT! +

+ {/if} {:catch err}

{err}