modified: app.py

modified:   templates/quiz_buzzer_multiplayer.html
This commit is contained in:
Simon
2026-02-20 22:54:29 +01:00
parent f08013ebaf
commit 3f3de7821f
2 changed files with 27 additions and 2 deletions

View File

@@ -688,10 +688,19 @@
});
}
function applyScoreToServer(playerId, delta) {
return fetch('/update_player_score/{{ playlist_id }}', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ player_id: playerId, delta: delta })
});
}
function continueGame() {
// Wende Minuspunkte an
// Wende Minuspunkte an (lokal und auf Server)
players[currentBuzzer - 1].score += pendingPoints;
updateScoreboard();
applyScoreToServer(currentBuzzer, pendingPoints);
// Reset für nächsten Buzzer
document.getElementById('answerSection').classList.remove('active');
@@ -718,9 +727,10 @@
}
function showSolution() {
// Wende Minuspunkte an
// Wende Minuspunkte an (lokal und auf Server)
players[currentBuzzer - 1].score += pendingPoints;
updateScoreboard();
applyScoreToServer(currentBuzzer, pendingPoints);
const resultContainer = document.getElementById('resultContainer');
resultContainer.innerHTML = `