Combien de doigts sont levés ?

if (isCorrect) { selectedDiv.classList.add('correct'); feedbackSoundPath = 'uploads/feedback/correct/fr/right.mp3'; } else { selectedDiv.classList.add('incorrect'); const correctDiv = optionsContainer.querySelector(`[data-item-id='${correctAnswer.id}']`); if (correctDiv) { correctDiv.classList.add('correct'); } feedbackSoundPath = 'uploads/feedback/wrong/fr/wrong.mp3'; } // Load the next question after a short delay to show feedback playSound(feedbackSoundPath, () => { setTimeout(loadQuestion, 1200); }); } // --- EVENT LISTENERS --- readQuestionButton.addEventListener('click', () => { if (currentQuestionAudio) { playSound(currentQuestionAudio); } }); nextQuestionButton.addEventListener('click', () => { audioPlayer.pause(); loadQuestion(); }); document.getElementById('back-btn').addEventListener('click', () => { window.location.href = 'category_fr.php?id=27'; }); document.getElementById('home-btn').addEventListener('click', () => { window.location.href = 'index_fr.php'; }); // --- LOGIC TO START THE QUIZ --- if (allItems.length > 0) { startContainer.style.display = 'block'; quizWrapper.style.display = 'none'; startButton.addEventListener('click', () => { startContainer.style.display = 'none'; quizWrapper.style.display = 'flex'; // Use flex to show the quiz layout loadQuestion(); }, { once: true }); } else { startContainer.style.display = 'none'; quizWrapper.style.display = 'none'; document.querySelector('.app-main').innerHTML = `

Aucun élément de quiz trouvé.

`; } // PWA Service Worker Registration if ('serviceWorker' in navigator) { window.addEventListener('load', () => { navigator.serviceWorker.register('/QuizApp2/sw.js').then(registration => { console.log('ServiceWorker registration successful with scope: ', registration.scope); }, err => { console.log('ServiceWorker registration failed: ', err); }); }); }