From 6bc03265807ba97153ab40bc1f1548898de2059a Mon Sep 17 00:00:00 2001 From: sascha Date: Wed, 28 Jan 2026 21:43:32 +0000 Subject: [PATCH] app/static/script.js aktualisiert --- app/static/script.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/app/static/script.js b/app/static/script.js index 5e1178e..ad1d35c 100644 --- a/app/static/script.js +++ b/app/static/script.js @@ -45,7 +45,6 @@ function nextQuestion() { btn.innerText = "Prüfen"; btn.onclick = checkAnswer; btn.className = "action-btn primary"; - document.getElementById('feedback').innerText = ''; const lids = Array.from(document.querySelectorAll('#lesson-list input:checked')).map(cb => cb.value); @@ -91,7 +90,6 @@ function renderCard(card) { `; container.appendChild(row); }); - const first = container.querySelector('input'); if(first) first.focus(); } @@ -106,7 +104,6 @@ function checkAnswer() { type: i.dataset.type || 'german' }); }); - attempts++; fetch('/api/check', { @@ -122,17 +119,10 @@ function checkAnswer() { res.results.forEach((r, idx) => { const el = inputs[idx]; el.classList.remove('wrong', 'correct', 'typo', 'incomplete'); - - if (r.status === 'correct') { - el.classList.add('correct'); - } else if (r.status === 'typo') { - el.classList.add('typo'); - } else if (r.status === 'incomplete') { - el.classList.add('incomplete'); - globalMsg = r.msg; - } else { - el.classList.add('wrong'); - } + if (r.status === 'correct') { el.classList.add('correct'); } + else if (r.status === 'typo') { el.classList.add('typo'); } + else if (r.status === 'incomplete') { el.classList.add('incomplete'); globalMsg = r.msg; } + else { el.classList.add('wrong'); } }); if (res.all_correct) {