document.addEventListener('DOMContentLoaded', () => { const correct_answer_index = 2; // The 3rd answer is correct const answerButtons = document.querySelectorAll('.btn-answer'); const nextButton = document.getElementById('next-question-btn'); const toastContainer = document.getElementById('toast-container'); answerButtons.forEach((button, index) => { button.addEventListener('click', () => { // Disable all buttons answerButtons.forEach(btn => btn.disabled = true); let is_correct = (index === correct_answer_index); if (is_correct) { button.classList.add('correct'); showToast('Bonne réponse !', 'success'); } else { button.classList.add('incorrect'); answerButtons[correct_answer_index].classList.add('correct'); showToast('Réponse incorrecte.', 'danger'); } // Show the next question button nextButton.classList.remove('d-none'); }); }); function showToast(message, type) { const toastHTML = `