diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43d1d54..6d6f31e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: MPL-2.0 # Contribute to ClassQuiz 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 @@ -25,6 +25,6 @@ an issue here on GitHub. ## 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 an issue here, so I'll be able to add it. diff --git a/classquiz/socket_server/__init__.py b/classquiz/socket_server/__init__.py index 52875cc..5ff3e6b 100644 --- a/classquiz/socket_server/__init__.py +++ b/classquiz/socket_server/__init__.py @@ -292,10 +292,16 @@ async def submit_answer(sid: str, data: dict): session = await get_session(sid, sio) question_index = int(float(data.question_index)) 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"]) if already_answered: await sio.emit("already_replied", room=sid) return + answer_right, answer = check_answer(game_data, data) latency = int(float(session["ping"])) time_q_started = datetime.fromisoformat(await redis.get(f"game:{session['game_pin']}:current_time"))