modified: templates/quiz.html
This commit is contained in:
@@ -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();
|
||||
}
|
||||
</script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@@ -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!
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user