From 01e7909e3ad02f24971e2279914228ee97acf24d Mon Sep 17 00:00:00 2001 From: ben8 Date: Thu, 8 May 2025 21:27:21 +0200 Subject: [PATCH 1/2] fix Eingabe --- django/play/consumers/game.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/django/play/consumers/game.py b/django/play/consumers/game.py index 07292d3..484fe7f 100644 --- a/django/play/consumers/game.py +++ b/django/play/consumers/game.py @@ -188,17 +188,20 @@ class GameConsumer(AsyncWebsocketConsumer): question_data = json.loads(current_question.data) print(answer_index) try: - #if answer_index >= 0 : # -1 means timeout - is_correct = question_data['options'][answer_index]['is_correct'] - print(is_correct) + #if answer_index >= 0 : # -1 means timeout + is_correct = question_data['options'][answer_index]['is_correct'] + print(is_correct) except: - user_input = str(answer_index).strip().lower() - correct_value = str(question_data['options'][0].get('value', '')).strip().lower() + user_input = str(answer_index).strip().lower().replace(" ", "") + correct_value = str(question_data['options'][0].get('value', '')).strip().lower().replace(" ", "") print("Richtig",correct_value) + print(user_input) if user_input == correct_value: is_correct=True - answer_index=0 + answer_index=int(0) print(is_correct) + else: + answer_index=int(1) From c8e2817b07b93383211f9ed54e18fa3d31fb9070 Mon Sep 17 00:00:00 2001 From: ben8 Date: Fri, 9 May 2025 15:53:34 +0200 Subject: [PATCH 2/2] Antwort_abschicken_ENTER+Design_verbessert --- django/templates/play/game/question_host.html | 7 ++++--- django/templates/play/game/question_participant.html | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/django/templates/play/game/question_host.html b/django/templates/play/game/question_host.html index 1ad132c..8081cec 100644 --- a/django/templates/play/game/question_host.html +++ b/django/templates/play/game/question_host.html @@ -50,15 +50,16 @@ {% else %} {% if request.session.mode == "learn" %} +
+ class="answer-option text-center p-2 bg-gray-100 hover:bg-blue-100 rounded-lg transition-colors duration-200 answer-option lg:w-80 "> - +
{% endif %} {% endif %} diff --git a/django/templates/play/game/question_participant.html b/django/templates/play/game/question_participant.html index a99e222..48744b9 100644 --- a/django/templates/play/game/question_participant.html +++ b/django/templates/play/game/question_participant.html @@ -27,13 +27,15 @@ {% endfor %} {% else %} +
+ class="answer-option text-center p-2 bg-gray-100 hover:bg-blue-100 rounded-lg transition-colors duration-200 answer-option lg:w-80"> +
{% endif %}