modified: app.py
modified: templates/quiz.html modified: templates/quiz_buzzer.html modified: templates/quiz_buzzer_multiplayer.html modified: templates/quiz_multiplayer.html
This commit is contained in:
15
app.py
15
app.py
@@ -461,10 +461,25 @@ def reset_quiz(playlist_id):
|
|||||||
session.pop(f'played_tracks_{playlist_id}', None)
|
session.pop(f'played_tracks_{playlist_id}', None)
|
||||||
session.pop(f'score_{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'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')
|
next_mode = request.args.get('next_mode')
|
||||||
if next_mode:
|
if next_mode:
|
||||||
return redirect(url_for('quiz', playlist_id=playlist_id, mode=next_mode))
|
return redirect(url_for('quiz', playlist_id=playlist_id, mode=next_mode))
|
||||||
return redirect(url_for('playlists'))
|
return redirect(url_for('playlists'))
|
||||||
|
|
||||||
|
@app.route("/reset_scores/<playlist_id>")
|
||||||
|
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__":
|
if __name__ == "__main__":
|
||||||
app.run(host="0.0.0.0", port=5000, debug=True)
|
app.run(host="0.0.0.0", port=5000, debug=True)
|
||||||
|
|
||||||
|
|||||||
@@ -570,6 +570,7 @@ window.onload = function() {
|
|||||||
|
|
||||||
<!-- Navigation -->
|
<!-- Navigation -->
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
<a href="/reset_scores/{{ playlist_id }}?mode={{ game_mode }}" class="btn" style="background:linear-gradient(135deg, #FFA500 0%, #FF8C00 100%); box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);" onclick="return confirm('Punkte zurücksetzen?')">🔄 Punkte zurücksetzen</a>
|
||||||
<a href="/reset_quiz/{{ playlist_id }}" class="btn btn-danger">{{ translations['end_quiz'] if translations.get('end_quiz') else '🏁 End Quiz' }}</a>
|
<a href="/reset_quiz/{{ playlist_id }}" class="btn btn-danger">{{ translations['end_quiz'] if translations.get('end_quiz') else '🏁 End Quiz' }}</a>
|
||||||
<a href="/playlists" class="btn btn-secondary">{{ translations['back_to_playlists'] if translations.get('back_to_playlists') else '⬅️ Back to Playlists' }}</a>
|
<a href="/playlists" class="btn btn-secondary">{{ translations['back_to_playlists'] if translations.get('back_to_playlists') else '⬅️ Back to Playlists' }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -565,6 +565,7 @@
|
|||||||
|
|
||||||
<!-- Navigation -->
|
<!-- Navigation -->
|
||||||
<div style="text-align:center; margin-top:30px;">
|
<div style="text-align:center; margin-top:30px;">
|
||||||
|
<a href="/reset_scores/{{ playlist_id }}?mode={{ game_mode }}&buzzer=1" class="btn" style="background:linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);" onclick="return confirm('Punkte zurücksetzen?')">🔄 Punkte zurücksetzen</a>
|
||||||
<a href="/reset_quiz/{{ playlist_id }}?buzzer=1" class="btn btn-danger">{{ translations['end_quiz'] if translations.get('end_quiz') else '🏁 End Quiz' }}</a>
|
<a href="/reset_quiz/{{ playlist_id }}?buzzer=1" class="btn btn-danger">{{ translations['end_quiz'] if translations.get('end_quiz') else '🏁 End Quiz' }}</a>
|
||||||
<a href="/playlists" class="btn btn-secondary">{{ translations['back_to_playlists'] if translations.get('back_to_playlists') else '⬅️ Back' }}</a>
|
<a href="/playlists" class="btn btn-secondary">{{ translations['back_to_playlists'] if translations.get('back_to_playlists') else '⬅️ Back' }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -632,6 +632,7 @@
|
|||||||
|
|
||||||
<!-- Navigation -->
|
<!-- Navigation -->
|
||||||
<div style="text-align:center; margin-top:30px;">
|
<div style="text-align:center; margin-top:30px;">
|
||||||
|
<a href="/reset_scores/{{ playlist_id }}?mode={{ game_mode }}&buzzer=1&local_multiplayer=1" class="btn" style="background:linear-gradient(135deg, #FFA500 0%, #FF8C00 100%);" onclick="return confirm('Alle Punkte zurücksetzen?')">🔄 Punkte zurücksetzen</a>
|
||||||
<a href="/reset_quiz/{{ playlist_id }}?buzzer=1&local_multiplayer=1" class="btn btn-danger">{{ translations['end_quiz'] if translations.get('end_quiz') else '🏁 End Quiz' }}</a>
|
<a href="/reset_quiz/{{ playlist_id }}?buzzer=1&local_multiplayer=1" class="btn btn-danger">{{ translations['end_quiz'] if translations.get('end_quiz') else '🏁 End Quiz' }}</a>
|
||||||
<a href="/playlists" class="btn btn-secondary">{{ translations['back_to_playlists'] if translations.get('back_to_playlists') else '⬅️ Back' }}</a>
|
<a href="/playlists" class="btn btn-secondary">{{ translations['back_to_playlists'] if translations.get('back_to_playlists') else '⬅️ Back' }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
<span id="multiplayerPlayers"></span>
|
<span id="multiplayerPlayers"></span>
|
||||||
</div>
|
</div>
|
||||||
<div style="text-align:center; margin-bottom: 20px;">
|
<div style="text-align:center; margin-bottom: 20px;">
|
||||||
|
<a href="/reset_scores/{{ playlist_id }}?mode={{ game_mode }}&local_multiplayer=1" class="btn" style="background:linear-gradient(135deg, #FFA500 0%, #FF8C00 100%); box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3); margin-top:10px;" onclick="return confirm('Alle Punkte zurücksetzen?')">🔄 Punkte zurücksetzen</a>
|
||||||
<a href="/reset_quiz/{{ playlist_id }}?local_multiplayer=1" class="btn btn-danger" style="margin-top:10px;">{{ translations['end_quiz'] }}</a>
|
<a href="/reset_quiz/{{ playlist_id }}?local_multiplayer=1" class="btn btn-danger" style="margin-top:10px;">{{ translations['end_quiz'] }}</a>
|
||||||
</div>
|
</div>
|
||||||
<h2 id="question-text" style="color:#fff;">{{ translations['question_artist'] }}</h2>
|
<h2 id="question-text" style="color:#fff;">{{ translations['question_artist'] }}</h2>
|
||||||
|
|||||||
Reference in New Issue
Block a user