Time: 20:00 Score: 0 / 0
${item.q}
${optsHtml}
`; wrapper.appendChild(card); }); } function evaluateChoice(btn, isCorrect, rationale) { if (timeLeft <= 0) return; const parent = btn.parentElement; const buttons = parent.querySelectorAll('.qp-btn'); const explanation = parent.nextElementSibling; attempted++; if (isCorrect) { score++; } document.getElementById('current-score').innerText = score; document.getElementById('total-attempted').innerText = attempted; buttons.forEach(b => b.disabled = true); btn.classList.add(isCorrect ? 'qp-correct' : 'qp-incorrect'); explanation.style.display = 'block'; explanation.style.backgroundColor = isCorrect ? '#d4edda' : '#f8d7da'; explanation.style.borderColor = isCorrect ? '#28a745' : '#dc3545'; explanation.innerHTML = `${isCorrect ? 'Correct!' : 'Incorrect.'} ${rationale}`; } function resetQuiz() { clearInterval(timerInterval); score = 0; attempted = 0; timeLeft = 1200; document.getElementById('current-score').innerText = 0; document.getElementById('total-attempted').innerText = 0; document.getElementById('timer-display').innerText = "20:00"; document.getElementById('timer-display').classList.remove('timer-alert'); buildQuiz(); startTimer(); window.scrollTo({ top: 0, behavior: 'smooth' }); } buildQuiz(); startTimer();