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) 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 %}