From 121e693e92e20f1014360a2de8ad8696d0e6c426 Mon Sep 17 00:00:00 2001 From: Mawoka Date: Sun, 1 Oct 2023 10:49:44 +0200 Subject: [PATCH] :sparkles: Updated admin-join-screen --- classquiz/socket_server/__init__.py | 2 + .../lib/play/admin/game_not_started.svelte | 69 +++++++++---------- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/classquiz/socket_server/__init__.py b/classquiz/socket_server/__init__.py index 341f3c7..0aaa2bf 100644 --- a/classquiz/socket_server/__init__.py +++ b/classquiz/socket_server/__init__.py @@ -433,6 +433,8 @@ async def submit_answer(sid: str, data: dict): score = calculate_score( abs(diff) - latency, int(float(game_data.questions[int(float(data.question_index))].time)) ) + if score > 1000: + score = 1000 await redis.hincrby(f"game_session:{session['game_pin']}:player_scores", session["username"], score) answer_data = AnswerData( username=session["username"], diff --git a/frontend/src/lib/play/admin/game_not_started.svelte b/frontend/src/lib/play/admin/game_not_started.svelte index 265b248..fc6eff3 100644 --- a/frontend/src/lib/play/admin/game_not_started.svelte +++ b/frontend/src/lib/play/admin/game_not_started.svelte @@ -4,10 +4,11 @@ SPDX-FileCopyrightText: 2023 Marlon W (Mawoka) SPDX-License-Identifier: MPL-2.0 --> - -
+
-
-
-

+

+
+

{$t('play_page.join_description', { url: window.location.host === 'classquiz.de' @@ -49,47 +50,45 @@ SPDX-License-Identifier: MPL-2.0

QR code to join the game {#if cqc_code} -
-
-

{$t('play_page.join_by_entering_code')}

+
+
+

{$t('play_page.join_by_entering_code')}

{/if}
-

{$t('words.pin')}: {game_pin}

-
-
    - {#if players.length > 0} - {#each players as player} -
  • +

    {$t('words.pin')}: {game_pin}

    +
    +
    + { + socket.emit('start_game', ''); + }} + >{$t('admin_page.start_game')} + +
    +
    +
    + {#if players.length > 0} + {#each players as player} +
    { kick_player(player.username); }}>{player.username} - -
  • - {/each} - {/if} -
+ +
+ {/each} + {/if}
- {#if players.length > 0} -
- -
- {/if} +