exam draft fix

This commit is contained in:
root
2026-04-11 15:33:12 -04:00
parent 89e95b7851
commit 7bc999643a
13 changed files with 582 additions and 180 deletions
+15 -1
View File
@@ -183,6 +183,14 @@
</div>
<div class="form-text small text-muted">Add a custom Surah or Arabic target.</div>
</div>
<?php elseif ($slug === 'islamic'): ?>
<div class="px-2 py-2 border-top">
<div class="input-group input-group-sm">
<input type="text" class="form-control" placeholder="Type subject or topic" data-custom-input data-subject="<?= esc($slug) ?>">
<button type="button" class="btn btn-outline-secondary" data-custom-entry data-subject="<?= esc($slug) ?>">Add</button>
</div>
<div class="form-text small text-muted">Add a subject or unit not listed above (e.g. Seerah, Fiqh, Akhlaq).</div>
</div>
<?php endif; ?>
</div>
</div>
@@ -385,6 +393,9 @@
if (isQuran) {
return isCustom ? 'Custom' : 'Surah';
}
if (subject === 'islamic' && isCustom) {
return 'Custom';
}
return parts.join(' ');
};
@@ -445,7 +456,10 @@
if (!input) return;
const customValue = input.value.trim();
if (customValue === '') return;
const unitValue = buildUnitDisplay(subject, '', '', { isQuran: subject === 'quran', isCustom: true });
const unitValue = buildUnitDisplay(subject, '', '', {
isQuran: subject === 'quran',
isCustom: subject === 'quran' || subject === 'islamic',
});
appendUnitChapterRow(subject, unitValue, customValue);
input.value = '';
hideMenus();