מ${SOURCE[c.source] || "תרגול"}
${fmt(c.question)}
${figures(c)}// The review tab (חזרה): every wrong answer waits here as a card, grouped by skill. A card is answered in place: a right answer marks it done and removes
// it; a wrong one keeps it and names the mistake and its tip, never the right choice, and offers "נסו שוב". Practice only: no mastery and no grade change.
import { api } from "./api.js";
import { figures } from "./figures.js";
import { esc, fmt } from "./math.js";
import { shuffled, tabs } from "./ui.js";
const SOURCE = { practice: "תרגול", quiz: "בוחן", exercise_test: "מבחן תרגול", simulation: "מבחן סימולציה" };
const counter = n => n === 0 ? "אין שאלות שמחכות" : n === 1 ? "שאלה אחת מחכה" : `${n} שאלות מחכות`;
const cardsWord = n => n === 1 ? "כרטיס אחד" : `${n} כרטיסים`;
const card = c => ` מ${SOURCE[c.source] || "תרגול"} ${fmt(c.question)} ${fmt(g.lesson.name)} ${counter(data.count)} אין מה לחזור עליו. כל תשובה שגויה תופיע כאן, ותצא מהרשימה כשתענו עליה נכון.${fmt(g.skill.name)} ${cardsWord(g.cards.length)}
חזרה
${esc(error.message)}
`; return; } const page = document.getElementById("review"), groupEl = cardEl.closest(".review-group"); page.dataset.count = got.count; document.getElementById("review-count").textContent = counter(got.count); button.classList.add(got.correct ? "right" : "wrong"); // the picked choice only: the right one is never marked if (got.correct) { cardEl.classList.add("done"); feedback.innerHTML = `נכון! השאלה יצאה מהרשימה.
`; groupEl.querySelector(".review-skill-count").textContent = cardsWord(got.skill_count); if (got.skill_count === 0) groupEl.querySelectorAll("h3, .review-lesson").forEach(el => { el.hidden = true; }); // nothing waits on this skill: its heading goes (the done cards stay until the page is left) if (got.count === 0) page.insertAdjacentHTML("beforeend", `אין מה לחזור עליו. כל הכבוד!
`); return; } const m = got.mistake; feedback.innerHTML = `לא נכון. השאלה נשארת ברשימה.
${m ? `${fmt(m.tip)}
${m.back ? `כדאי לתרגל: ${fmt(m.back_name || "")}
` : ""}