From 575fcd3f8cababa599e1d54f7b25bf3f521e45ac Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 15 Nov 2025 02:23:37 +0100 Subject: [PATCH] modified: app.py modified: templates/quiz.html modified: templates/quiz_buzzer.html modified: templates/quiz_buzzer_multiplayer.html modified: templates/quiz_multiplayer.html --- app.py | 15 +++++++++++++++ templates/quiz.html | 1 + templates/quiz_buzzer.html | 1 + templates/quiz_buzzer_multiplayer.html | 1 + templates/quiz_multiplayer.html | 1 + 5 files changed, 19 insertions(+) diff --git a/app.py b/app.py index 0f6ca05..512585a 100644 --- a/app.py +++ b/app.py @@ -461,10 +461,25 @@ def reset_quiz(playlist_id): session.pop(f'played_tracks_{playlist_id}', None) session.pop(f'score_{playlist_id}', None) session.pop(f'total_played_{playlist_id}', None) # Auch den Zähler zurücksetzen + session.pop(f'player_scores_{playlist_id}', None) # Multiplayer-Scores zurücksetzen next_mode = request.args.get('next_mode') if next_mode: return redirect(url_for('quiz', playlist_id=playlist_id, mode=next_mode)) return redirect(url_for('playlists')) +@app.route("/reset_scores/") +def reset_scores(playlist_id): + """Reset nur die Scores, aber behalte gespielte Tracks.""" + session[f'score_{playlist_id}'] = 0 + session[f'player_scores_{playlist_id}'] = [0, 0, 0, 0] + + # Zurück zum Quiz mit aktuellen Parametern + mode = request.args.get('mode', 'title') + buzzer = request.args.get('buzzer', '0') + local_multiplayer = request.args.get('local_multiplayer', '0') + + return redirect(url_for('quiz', playlist_id=playlist_id, mode=mode, buzzer=buzzer, local_multiplayer=local_multiplayer)) + if __name__ == "__main__": app.run(host="0.0.0.0", port=5000, debug=True) + diff --git a/templates/quiz.html b/templates/quiz.html index a4404da..571f45b 100644 --- a/templates/quiz.html +++ b/templates/quiz.html @@ -570,6 +570,7 @@ window.onload = function() { diff --git a/templates/quiz_buzzer.html b/templates/quiz_buzzer.html index 018bbf1..22852cd 100644 --- a/templates/quiz_buzzer.html +++ b/templates/quiz_buzzer.html @@ -565,6 +565,7 @@
+ 🔄 Punkte zurücksetzen {{ translations['end_quiz'] if translations.get('end_quiz') else '🏁 End Quiz' }} {{ translations['back_to_playlists'] if translations.get('back_to_playlists') else '⬅️ Back' }}
diff --git a/templates/quiz_buzzer_multiplayer.html b/templates/quiz_buzzer_multiplayer.html index 2d4f895..3951115 100644 --- a/templates/quiz_buzzer_multiplayer.html +++ b/templates/quiz_buzzer_multiplayer.html @@ -632,6 +632,7 @@
+ 🔄 Punkte zurücksetzen {{ translations['end_quiz'] if translations.get('end_quiz') else '🏁 End Quiz' }} {{ translations['back_to_playlists'] if translations.get('back_to_playlists') else '⬅️ Back' }}
diff --git a/templates/quiz_multiplayer.html b/templates/quiz_multiplayer.html index 8e9452a..296b021 100644 --- a/templates/quiz_multiplayer.html +++ b/templates/quiz_multiplayer.html @@ -69,6 +69,7 @@
+ 🔄 Punkte zurücksetzen {{ translations['end_quiz'] }}

{{ translations['question_artist'] }}