diff --git a/templates/quiz.html b/templates/quiz.html
index b97cc1c..0242b7e 100644
--- a/templates/quiz.html
+++ b/templates/quiz.html
@@ -297,6 +297,10 @@
}
function switchGameMode(mode) {
+ // Beim Moduswechsel Multiplayer-Daten löschen
+ localStorage.removeItem('quizify_multiplayer_names');
+ localStorage.removeItem('quizify_multiplayer_scores');
+ localStorage.removeItem('quizify_multiplayer_current');
window.location.href = `/reset_quiz/{{ playlist_id }}?next_mode=${mode}`;
}
@@ -323,6 +327,10 @@ window.onload = function() {
}
document.getElementById('startPosition').value = getOption('startPosition', 'start');
updateMultiplayerUI();
+ // Starte Quiz nur, wenn KEIN Multiplayer-Popup offen ist
+ if (!document.getElementById('multiplayerPopup') || document.getElementById('multiplayerPopup').style.display === 'none') {
+ quizifyReady();
+ }
};
function onPlayDurationChange() {
@@ -426,6 +434,18 @@ checkAnswer = function() {
window.onload = function() {
// ...dein bisheriger onload code...
updateMultiplayerUI();
+ // Starte Quiz nur, wenn KEIN Multiplayer-Popup offen ist
+ if (!document.getElementById('multiplayerPopup') || document.getElementById('multiplayerPopup').style.display === 'none') {
+ quizifyReady();
+ }
+}
+
+function quizifyReady() {
+ // Hier alles, was nach dem Schließen des Popups passieren soll
+ if (window.onSpotifyWebPlaybackSDKReady) {
+ window.onSpotifyWebPlaybackSDKReady();
+ }
+ setCorrectAnswer();
}
@@ -533,6 +553,7 @@ function startMultiplayer(e) {
localStorage.setItem('quizify_multiplayer_current', 0);
document.getElementById('multiplayerPopup').style.display = 'none';
updateMultiplayerUI();
+ quizifyReady(); // <-- Musik und Quiz jetzt starten!
}
{% endif %}