Merge branch 'mawoka-myblock:master' into feat/keyboard-shortcut

This commit is contained in:
Proxyfil
2026-04-28 21:44:31 +02:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ SPDX-License-Identifier: MPL-2.0
# Contribute to ClassQuiz # Contribute to ClassQuiz
For the development-setup, please check out the For the development-setup, please check out the
docs: [classquiz.mawoka.eu/docs/develop](https://classquiz.mawoka.eu/docs/develop) docs: [https://classquiz.de/docs/develop](https://classquiz.de/docs/develop)
## Formatting git-commits ## Formatting git-commits
@@ -25,6 +25,6 @@ an issue here on GitHub.
## Want to translate? ## Want to translate?
Go to [Weblate](https://translate.mawoka.eu/projects/classquiz/frontend/). Go to [Weblate](https://hosted.weblate.org/projects/classquiz/).
If the language isn't available, please open If the language isn't available, please open
an issue here, so I'll be able to add it. an issue here, so I'll be able to add it.
+6
View File
@@ -292,10 +292,16 @@ async def submit_answer(sid: str, data: dict):
session = await get_session(sid, sio) session = await get_session(sid, sio)
question_index = int(float(data.question_index)) question_index = int(float(data.question_index))
game_data = await PlayGame.get_from_redis(session["game_pin"]) game_data = await PlayGame.get_from_redis(session["game_pin"])
if question_index != game_data.current_question:
await sio.emit("question_not_active", room=sid)
return
already_answered = await has_already_answered(session["game_pin"], question_index, session["username"]) already_answered = await has_already_answered(session["game_pin"], question_index, session["username"])
if already_answered: if already_answered:
await sio.emit("already_replied", room=sid) await sio.emit("already_replied", room=sid)
return return
answer_right, answer = check_answer(game_data, data) answer_right, answer = check_answer(game_data, data)
latency = int(float(session["ping"])) latency = int(float(session["ping"]))
time_q_started = datetime.fromisoformat(await redis.get(f"game:{session['game_pin']}:current_time")) time_q_started = datetime.fromisoformat(await redis.get(f"game:{session['game_pin']}:current_time"))