fixes and patches n stuff

This commit is contained in:
tyuXX 2026-10-21 21:07:54 +00:00
parent 7c7ae8e051
commit 1af973d001
14 changed files with 571 additions and 268 deletions

View file

@ -221,11 +221,16 @@ document.addEventListener('DOMContentLoaded', () => {
// ----------------------------------------------------
// Inline Mistake Review Modal
// ----------------------------------------------------
function openReviewModal(targetSubjectName = null) {
function openReviewModal(targetSubjectName = null, targetType = 'all') {
if (!mistakeModal || !currentExamId) return;
mistakeModal.classList.remove('hidden');
document.body.style.overflow = 'hidden';
activeTypeFilter = targetType || 'all';
modalTypeBtns.forEach(b => {
b.classList.toggle('active', b.getAttribute('data-type') === activeTypeFilter);
});
if (!cachedQuestions) {
loadExamQuestions(targetSubjectName);
} else {
@ -244,7 +249,7 @@ document.addEventListener('DOMContentLoaded', () => {
}
if (btnReviewMistakes) {
btnReviewMistakes.addEventListener('click', () => openReviewModal());
btnReviewMistakes.addEventListener('click', () => openReviewModal(null, 'all'));
}
if (btnMistakeModalClose) {
@ -256,7 +261,9 @@ document.addEventListener('DOMContentLoaded', () => {
btn.addEventListener('click', (e) => {
e.stopPropagation();
const subjectName = btn.getAttribute('data-subject-name');
openReviewModal(subjectName);
const tip = btn.getAttribute('data-tip');
const targetType = tip === 'B' ? 'empty' : tip === 'Y' ? 'wrong' : 'all';
openReviewModal(subjectName, targetType);
});
});