{{-- Shared "create exam" builder JS — included wherever the create-exam modal (_create_modal.blade.php) appears. --}} {{-- The including page may define window.onExamPublished(res) before this include to react to a successful publish. --}} var examQCount = 0; function examOptionLetter(idx){ return String.fromCharCode(65 + idx); } function markExamOptionCorrect(radio){ var row = radio.closest('.opt-row'); var wrap = row.parentElement; wrap.querySelectorAll('.opt-row').forEach(function(r){ r.classList.remove('is-correct'); }); row.classList.add('is-correct'); } function examOptionRowHtml(qId, idx, canRemove){ return '