From 2210ef46238f2f00499f9ccec9808633b6523363 Mon Sep 17 00:00:00 2001 From: chriseo Date: Mon, 15 Jun 2026 23:13:49 +0200 Subject: [PATCH] Fix explanation letter prefix after answer shuffle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After shuffleQuestion() reorders answers, the hardcoded A–D prefix in each explanation text no longer matched the displayed option letter. Replace the leading letter dynamically based on the shuffled position. Co-Authored-By: Claude Sonnet 4.6 --- js/quiz.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/quiz.js b/js/quiz.js index a23a991..7686ada 100644 --- a/js/quiz.js +++ b/js/quiz.js @@ -172,7 +172,9 @@ function handleAnswer(chosen) { expDiv.innerHTML = '
Proefexamen ' + q.exam + ', vraag ' + q.qnum + '
' + '
Toelichting
' + - q.explanation.map(e => '

' + e + '

').join(''); + q.explanation.map((e, i) => + '

' + e.replace(/^[A-D]\.\s*/, 'ABCD'[i] + '. ') + '

' + ).join(''); const nextBtn = document.getElementById('next-btn'); nextBtn.style.display = 'inline-flex';