~/ophthal-mcq/ophthalmology_mcq.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>General Ophthalmology – 50 Fellowship MCQs</title>
<style>
:root {
--bg: #0f172a;
--card: #1e293b;
--card-hover: #243044;
--border: #334155;
--accent: #38bdf8;
--accent2: #818cf8;
--correct: #22c55e;
--wrong: #ef4444;
--text: #e2e8f0;
--muted: #94a3b8;
--tag-bg: #1e3a5f;
--tag-text: #7dd3fc;
--reveal-bg: #0c2340;
--reveal-border: #38bdf8;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--text);
font-family: 'Segoe UI', system-ui, sans-serif;
min-height: 100vh;
padding: 0 0 60px 0;
}
/* ── HEADER ── */
header {
background: linear-gradient(135deg, #0c1a35 0%, #1a3a6e 100%);
padding: 36px 24px 28px;
text-align: center;
border-bottom: 2px solid var(--accent);
}
header h1 {
font-size: clamp(1.4rem, 3.5vw, 2rem);
font-weight: 700;
color: #fff;
letter-spacing: 0.02em;
}
header p {
margin-top: 8px;
color: var(--muted);
font-size: 0.92rem;
}
/* ── PROGRESS BAR ── */
#progress-wrap {
background: var(--card);
padding: 14px 24px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 14px;
position: sticky;
top: 0;
z-index: 100;
}
#progress-bar-outer {
flex: 1;
height: 8px;
background: var(--border);
border-radius: 99px;
overflow: hidden;
}
#progress-bar-inner {
height: 100%;
background: linear-gradient(90deg, var(--accent), var(--accent2));
border-radius: 99px;
width: 0%;
transition: width 0.4s ease;
}
#progress-text {
font-size: 0.82rem;
color: var(--muted);
white-space: nowrap;
}
#score-display {
font-size: 0.82rem;
color: var(--correct);
font-weight: 600;
white-space: nowrap;
}
/* ── SECTION HEADERS ── */
.section-header {
margin: 32px 20px 10px;
padding: 10px 18px;
background: linear-gradient(90deg, #1a3a6e, transparent);
border-left: 4px solid var(--accent);
border-radius: 0 8px 8px 0;
font-size: 0.95rem;
font-weight: 700;
color: var(--accent);
letter-spacing: 0.05em;
text-transform: uppercase;
}
/* ── QUESTION CARD ── */
.q-card {
background: var(--card);
border: 1px solid var(--border);
border-radius: 12px;
margin: 10px 20px;
padding: 20px 22px;
transition: border-color 0.2s;
}
.q-card:hover { border-color: #475569; }
.q-header {
display: flex;
align-items: flex-start;
gap: 12px;
margin-bottom: 14px;
}
.q-num {
background: linear-gradient(135deg, var(--accent), var(--accent2));
color: #fff;
font-weight: 700;
font-size: 0.78rem;
padding: 3px 9px;
border-radius: 99px;
white-space: nowrap;
margin-top: 2px;
}
.q-text {
font-size: 0.97rem;
line-height: 1.55;
color: var(--text);
flex: 1;
}
/* ── OPTIONS ── */
.options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.opt {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 10px 14px;
background: #152032;
border: 1.5px solid var(--border);
border-radius: 8px;
cursor: pointer;
transition: background 0.15s, border-color 0.15s;
font-size: 0.92rem;
line-height: 1.45;
user-select: none;
}
.opt:hover:not(.disabled) { background: var(--card-hover); border-color: var(--accent); }
.opt-letter {
font-weight: 700;
color: var(--accent);
min-width: 20px;
font-size: 0.88rem;
}
.opt.correct-choice {
background: #052e16;
border-color: var(--correct);
}
.opt.correct-choice .opt-letter { color: var(--correct); }
.opt.wrong-choice {
background: #2d0a0a;
border-color: var(--wrong);
}
.opt.wrong-choice .opt-letter { color: var(--wrong); }
.opt.show-correct {
background: #052e16;
border-color: var(--correct);
}
.opt.show-correct .opt-letter { color: var(--correct); }
.opt-icon {
margin-left: auto;
font-size: 1rem;
}
/* ── ANSWER REVEAL ── */
.reveal-btn {
background: transparent;
border: 1.5px solid var(--accent);
color: var(--accent);
padding: 7px 16px;
border-radius: 7px;
font-size: 0.83rem;
font-weight: 600;
cursor: pointer;
transition: background 0.15s, color 0.15s;
letter-spacing: 0.03em;
}
.reveal-btn:hover { background: var(--accent); color: #0f172a; }
.answer-box {
display: none;
margin-top: 12px;
padding: 14px 16px;
background: var(--reveal-bg);
border: 1px solid var(--reveal-border);
border-radius: 8px;
font-size: 0.88rem;
line-height: 1.6;
color: #bae6fd;
}
.answer-box.open { display: block; }
.answer-box strong { color: #fff; }
.answer-label {
font-size: 0.78rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.08em;
color: var(--correct);
margin-bottom: 4px;
}
.answer-text { color: #cbd5e1; margin-top: 6px; }
.answer-source {
margin-top: 8px;
font-size: 0.75rem;
color: #64748b;
font-style: italic;
}
/* ── STATUS BADGE ── */
.status-badge {
display: inline-block;
font-size: 0.7rem;
padding: 2px 8px;
border-radius: 99px;
font-weight: 700;
margin-left: 8px;
vertical-align: middle;
}
.badge-correct { background: #052e16; color: var(--correct); border: 1px solid var(--correct); }
.badge-wrong { background: #2d0a0a; color: var(--wrong); border: 1px solid var(--wrong); }
/* ── SUMMARY BOX ── */
#summary {
display: none;
margin: 28px 20px;
padding: 24px;
background: linear-gradient(135deg, #0c2340, #1a3a6e);
border: 2px solid var(--accent);
border-radius: 14px;
text-align: center;
}
#summary h2 { font-size: 1.5rem; color: #fff; margin-bottom: 8px; }
#summary .big-score { font-size: 3rem; font-weight: 800; color: var(--accent); }
#summary p { color: var(--muted); margin-top: 6px; font-size: 0.9rem; }
#reset-btn {
margin-top: 18px;
background: var(--accent);
color: #0f172a;
border: none;
padding: 10px 28px;
border-radius: 8px;
font-size: 0.95rem;
font-weight: 700;
cursor: pointer;
transition: opacity 0.2s;
}
#reset-btn:hover { opacity: 0.85; }
/* ── DIFFICULTY TAG ── */
.diff-tag {
font-size: 0.68rem;
padding: 2px 7px;
border-radius: 99px;
font-weight: 600;
margin-left: 6px;
}
.diff-high { background: #3d1515; color: #fca5a5; border: 1px solid #ef4444; }
.diff-mod { background: #1c2d0f; color: #86efac; border: 1px solid #22c55e; }
@media (max-width: 600px) {
.q-card { margin: 8px 10px; padding: 16px 14px; }
.section-header { margin: 24px 10px 8px; }
}
</style>
</head>
<body>
<header>
<h1>🔬 General Ophthalmology — 50 Fellowship MCQs</h1>
<p>Post-Doctoral Fellowship Exam Preparation | Moderate & High Difficulty | Click an option to answer</p>
</header>
<div id="progress-wrap">
<div id="progress-bar-outer"><div id="progress-bar-inner"></div></div>
<span id="progress-text">0 / 50 answered</span>
<span id="score-display">Score: 0</span>
</div>
<div id="quiz-container"></div>
<div id="summary">
<h2>Quiz Complete! 🎉</h2>
<div class="big-score" id="final-score">--</div>
<p id="final-msg"></p>
<button id="reset-btn" onclick="resetQuiz()">Retake Quiz</button>
</div>
<script>
const questions = [
// ─── CORNEA & EXTERNAL DISEASE ───────────────────────────────────────────────
{
section: "CORNEA & EXTERNAL DISEASE",
num: 1, diff: "mod",
q: "A 35-year-old woman presents with recurrent painful corneal erosions, worse on waking. Slit lamp shows fine fingerprint lines and grey patches in the epithelium. The most common corneal dystrophy causing this presentation is classified under which IC3D layer?",
opts: ["Stromal dystrophy","Epithelial and subepithelial dystrophy","Bowman layer dystrophy (TGFBI)","Descemet membrane / endothelial dystrophy"],
ans: 1,
exp: "Epithelial Basement Membrane Dystrophy (Map-Dot-Fingerprint / Cogan's microcystic) is the most common anterior corneal dystrophy and falls under the IC3D epithelial and subepithelial category. It presents with maps, dots, and fingerprint patterns, causing recurrent erosions particularly on waking.",
src: "Wills Eye Manual §4.25"
},
{
section: null, num: 2, diff: "mod",
q: "A patient has bilateral diffuse stromal opacities extending from limbus to limbus with ill-defined edges and cloudy intervening stroma. Corneas are flatter and thinner than normal. The inheritance pattern of this corneal dystrophy is:",
opts: ["Autosomal dominant","X-linked recessive","Autosomal recessive","Sporadic"],
ans: 2,
exp: "Macular corneal dystrophy is autosomal recessive (unlike granular and lattice dystrophies which are autosomal dominant). The opacities are diffuse with cloudy intervening stroma, extending from limbus to limbus, involving full-thickness stroma.",
src: "Wills Eye Manual §4.25"
},
{
section: null, num: 3, diff: "high",
q: "Granular Dystrophy Type II (Avellino corneal dystrophy) is distinct from classical Granular Type I because it also contains deposits of:",
opts: ["Lipid","Amyloid","Glycosaminoglycans","Cholesterol crystals"],
ans: 1,
exp: "Avellino (Granular Type II) is a combined granular-lattice dystrophy. It contains both hyaline deposits (as in granular dystrophy) and amyloid deposits (as in lattice dystrophy), reflecting TGFBI gene mutations.",
src: "Wills Eye Manual §4.25"
},
{
section: null, num: 4, diff: "mod",
q: "A patient with Schnyder corneal dystrophy is found to have anterior stromal crystals. The workup MOST indicated in this patient is:",
opts: ["Renal function tests and urinary amino acid profile","Fasting serum cholesterol and triglycerides","Serum angiotensin-converting enzyme (ACE)","Serum uric acid levels"],
ans: 1,
exp: "Schnyder corneal dystrophy is a local disorder of corneal lipid metabolism but can be associated with systemic hyperlipidemia. Fasting serum cholesterol and triglyceride levels are the recommended workup.",
src: "Wills Eye Manual §4.25; Kanski's Ch.6"
},
{
section: null, num: 5, diff: "high",
q: "A 60-year-old woman with corneal guttae and progressive endothelial cell loss requires cataract surgery. The MOST important intraoperative strategy to protect her endothelium is:",
opts: ["Use of a smaller incision to reduce mechanical trauma","Avoidance of all viscoelastic substances","Use of torsional (Ozil) phacoemulsification to reduce cumulative ultrasound energy","Performing LASIK before cataract surgery to reduce corneal thickness"],
ans: 2,
exp: "In Fuchs endothelial corneal dystrophy, cataract surgery risks worsening endothelial cell loss. Modern torsional phacoemulsification uses significantly less cumulative dissipated energy/ultrasound time compared to longitudinal phacoemulsification, reducing endothelial damage.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.6"
},
{
section: null, num: 6, diff: "mod",
q: "A 15-year-old is diagnosed with Meesmann corneal dystrophy. The characteristic finding on retroillumination of the cornea is:",
opts: ["Map-like grey patches in the epithelium","Discrete tiny epithelial vesicles involving the whole cornea","White 'bread crumb-like' anterior stromal opacities","Lattice-like branching lines in the stroma"],
ans: 1,
exp: "Meesmann dystrophy shows discrete tiny epithelial vesicles on retroillumination, involving the whole cornea. It is rare and usually asymptomatic until middle age, though photophobia may develop. Treatment is usually not required unless significant symptoms arise.",
src: "Wills Eye Manual §4.25"
},
{
section: null, num: 7, diff: "high",
q: "Congenital hereditary endothelial dystrophy (CHED) presents at birth with bilateral corneal edema. Which statement is TRUE regarding CHED?",
opts: ["It is autosomal dominant only","It is associated with nystagmus and must be differentiated from congenital glaucoma","IOP is invariably elevated in CHED","Photophobia and epiphora are more prominent in CHED than in congenital glaucoma"],
ans: 1,
exp: "CHED is autosomal recessive, presents with bilateral corneal edema from birth, and can cause nystagmus. It must be differentiated from congenital glaucoma (elevated IOP, buphthalmos, Haab's striae). Congenital glaucoma causes more photophobia and epiphora; CHED does not elevate IOP.",
src: "Wills Eye Manual §4.25"
},
{
section: null, num: 8, diff: "high",
q: "Which corneal dystrophy is MOST likely to recur earliest (within 5 years) after corneal transplantation or PTK?",
opts: ["Macular dystrophy","Fuchs endothelial dystrophy","Granular dystrophy Type I","Lattice dystrophy Type I"],
ans: 2,
exp: "Granular dystrophy Type I can recur within 5 years after excimer laser PTK or corneal transplantation. Macular dystrophy recurrence tends to occur many years after transplantation. This early recurrence is a significant clinical concern in surgical planning.",
src: "Wills Eye Manual §4.25"
},
{
section: null, num: 9, diff: "high",
q: "Posterior polymorphous corneal dystrophy (PPCD) shares which clinically important feature with iridocorneal endothelial (ICE) syndrome?",
opts: ["Both are bilateral and autosomal recessive","Both may be associated with secondary glaucoma and iridocorneal adhesions","Both are caused by TGFBI gene mutations","Both present in childhood with severe photophobia"],
ans: 1,
exp: "Both PPCD and ICE syndrome affect the corneal endothelium, both can be associated with secondary glaucoma, and both can show peripheral anterior synechiae and iris abnormalities. Key distinction: ICE syndrome is unilateral and non-hereditary; PPCD is hereditary (usually AD).",
src: "Kanski's Clinical Ophthalmology 10th, Ch.6"
},
{
section: null, num: 10, diff: "mod",
q: "A patient with map-dot-fingerprint dystrophy presents with recurrent corneal erosions. The FIRST-LINE treatment recommended is:",
opts: ["Phototherapeutic keratectomy (PTK)","Hypertonic saline drops during day and ointment at night, with lubricants","Penetrating keratoplasty","Rigid contact lens fitting to mechanically debride epithelium"],
ans: 1,
exp: "First-line management for recurrent corneal erosions includes lubricants, hypertonic saline (5% NaCl drops by day, ointment at night), and bandage soft contact lenses. PTK is reserved for refractory cases that fail conservative management.",
src: "Wills Eye Manual §4.2 & 4.25"
},
// ─── GLAUCOMA ────────────────────────────────────────────────────────────────
{
section: "GLAUCOMA",
num: 11, diff: "mod",
q: "In Humphrey visual field testing for glaucoma, the 24-2 pattern tests points within which extent?",
opts: ["10° central radius only","24° temporally and 30° nasally","30° in all meridians uniformly","30° temporally and 30° nasally"],
ans: 1,
exp: "The '24' in 24-2 denotes testing to 24° on the temporal side and 30° on the nasal side. The '-2' describes the grid offset pattern. This is the most commonly used glaucoma-specific test pattern. The 30-2 is an alternative testing to 30° temporally.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.1"
},
{
section: null, num: 12, diff: "mod",
q: "The 10-2 Humphrey visual field pattern is MOST valuable in glaucoma management because:",
opts: ["It tests the full peripheral field to detect superior arcuate defects","It provides detailed central 10° mapping, important in advanced glaucoma with split fixation","It is faster than 24-2 and preferred for routine screening","It detects neurological field defects better than other patterns"],
ans: 1,
exp: "The 10-2 tests within a 10° radius and allows detailed monitoring of the central field in advanced glaucoma where fixation may be threatened ('split fixation'). It is complementary to 24-2, detecting damage not visible on 24-2 in advanced cases.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.1"
},
{
section: null, num: 13, diff: "mod",
q: "Glaucoma in Sturge-Weber syndrome (encephalotrigeminal angiomatosis) develops in approximately what percentage of affected patients?",
opts: ["5%","30%","60%","85%"],
ans: 1,
exp: "Glaucoma develops ipsilateral to the facial haemangioma in approximately 30% of Sturge-Weber patients. Of those who develop glaucoma, about 60% have IOP elevation before age 2 years, which may result in buphthalmos. The remainder develop glaucoma at any time from infancy to adulthood.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.11"
},
{
section: null, num: 14, diff: "high",
q: "In an OLDER patient with Sturge-Weber syndrome who develops glaucoma, the PRIMARY pathogenic mechanism is thought to be:",
opts: ["Angle neovascularization from choroidal haemangioma","Raised episcleral venous pressure from arteriovenous communication in an episcleral haemangioma","Trabeculodysgenesis identical to that seen in infants","Pupillary block from lens subluxation"],
ans: 1,
exp: "In Sturge-Weber, two distinct mechanisms exist by age: infants - trabeculodysgenesis; older patients - raised episcleral venous pressure due to arteriovenous communication in an episcleral haemangioma. Recognizing this distinction is important for surgical planning.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.11"
},
{
section: null, num: 15, diff: "high",
q: "A surgeon performs combined trabeculotomy-trabeculectomy for early-onset glaucoma in a Sturge-Weber patient. The complication MOST specifically feared in this setting, compared to non-Sturge-Weber glaucoma surgery, is:",
opts: ["Endophthalmitis","Malignant (aqueous misdirection) glaucoma","Choroidal effusion and suprachoroidal haemorrhage","Corneal decompensation from prolonged hypotony"],
ans: 2,
exp: "Due to the raised episcleral venous pressure and underlying choroidal haemangioma in Sturge-Weber syndrome, sudden surgical IOP decompression carries a high risk of choroidal effusion and suprachoroidal haemorrhage - a complication more specifically encountered in this condition.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.11"
},
{
section: null, num: 16, diff: "mod",
q: "Normal-tension glaucoma (NTG) is best defined as:",
opts: ["IOP always below 10 mmHg with glaucomatous optic nerve damage","Glaucomatous optic nerve and visual field changes with IOP consistently within the statistically normal range","A subtype of secondary open-angle glaucoma caused by vascular disease","Glaucoma in which only non-IOP-lowering treatments are effective"],
ans: 1,
exp: "Normal-tension glaucoma is characterized by glaucomatous optic nerve and visual field changes with IOP that is consistently within the statistically normal range (<21 mmHg). Its pathogenesis is multifactorial, including vascular dysregulation, optic nerve susceptibility, and cerebrospinal fluid pressure.",
src: "Robbins Pathologic Basis of Disease §Eye; Kanski's Ch.10"
},
{
section: null, num: 17, diff: "high",
q: "In aniridia-associated glaucoma, which treatment option offers the BEST chance of long-term IOP control?",
opts: ["Topical prostaglandin analogues as monotherapy","Trabeculectomy with mitomycin C","Glaucoma drainage devices (tube shunts)","Selective laser trabeculoplasty (SLT)"],
ans: 2,
exp: "In aniridia, medical treatment is usually inadequate for long-term control. Trabeculectomy (with or without mitomycin C) and combined trabeculotomy-trabeculectomy typically fail. Glaucoma drainage devices (tube shunts) offer the best chance of long-term successful IOP control. Diode laser cycloblation is reserved for refractory cases.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.11"
},
{
section: null, num: 18, diff: "high",
q: "Glaucoma in neurofibromatosis type 1 (NF1), when present, is most characteristically:",
opts: ["Bilateral, juvenile-onset, and associated with optic glioma","Unilateral, congenital, and associated with ipsilateral plexiform neurofibroma of the upper eyelid","Secondary to angle neovascularization from retinal ischemia","Associated with ectopia lentis causing secondary pupillary block"],
ans: 1,
exp: "NF1-associated glaucoma is relatively rare, usually unilateral and congenital. About 50% of affected patients have an ipsilateral plexiform neurofibroma of the upper eyelid or facial hemiatrophy. Mechanisms include congenital angle anomaly, often associated with ectropion uveae.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.11"
},
{
section: null, num: 19, diff: "high",
q: "Which mechanism is LEAST likely to cause elevated IOP in neovascular glaucoma?",
opts: ["Open-angle phase: fibrovascular membrane reducing trabecular outflow","Angle closure phase: membrane contraction forming peripheral anterior synechiae","Raised episcleral venous pressure from arteriovenous shunting","Progressive fibrovascular membrane proliferation over the iris and angle"],
ans: 2,
exp: "Raised episcleral venous pressure is a mechanism in carotid cavernous fistula or Sturge-Weber syndrome - NOT neovascular glaucoma. Neovascular glaucoma progresses from an open-angle phase (fibrovascular membrane impairs trabecular outflow) to an angle-closure phase (membrane contracts, PAS formation).",
src: "Kanski's Clinical Ophthalmology 10th, Ch.10"
},
{
section: null, num: 20, diff: "mod",
q: "Prostaglandin analogues (e.g., latanoprost) lower IOP primarily by which mechanism?",
opts: ["Reducing aqueous humour production by the ciliary body","Increasing conventional (trabecular/Schlemm's canal) outflow","Increasing uveoscleral (unconventional) outflow","Reducing episcleral venous pressure"],
ans: 2,
exp: "Prostaglandin analogues lower IOP primarily by enhancing uveoscleral (unconventional) outflow. They act on FP receptors in the ciliary body and scleral tissues, remodeling extracellular matrix and increasing aqueous permeability through the ciliary muscle. The conventional trabecular pathway accounts for ~70-90% of normal outflow.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.10"
},
// ─── RETINA & VITREOUS ───────────────────────────────────────────────────────
{
section: "RETINA & VITREOUS",
num: 21, diff: "high",
q: "According to ETDRS criteria, the defining feature of HIGH-RISK proliferative diabetic retinopathy (PDR) requiring prompt panretinal photocoagulation is:",
opts: ["Any new vessels elsewhere (NVE) regardless of size or haemorrhage","NVD ≥ 1/4-1/3 disc area with or without haemorrhage, OR any NVD with vitreous/preretinal haemorrhage, OR NVE ≥ 1/2 disc area with haemorrhage","NVD of any size without haemorrhage only","Vitreous haemorrhage alone without identifiable new vessels"],
ans: 1,
exp: "ETDRS high-risk PDR criteria: (1) NVD ≥ 1/4 to 1/3 disc area with or without haemorrhage, (2) any NVD with vitreous or preretinal haemorrhage, or (3) NVE ≥ 1/2 disc area with vitreous or preretinal haemorrhage. Panretinal photocoagulation reduces severe visual loss by >50% in these eyes.",
src: "Wills Eye Manual; Harrison's Principles 22E §34"
},
{
section: null, num: 22, diff: "mod",
q: "The Diabetic Retinopathy Study (DRS) demonstrated that panretinal photocoagulation (PRP) reduces the risk of severe visual loss in high-risk PDR by approximately:",
opts: ["15-20%","30-40%","50% or more","Only 5-10%"],
ans: 2,
exp: "The DRS demonstrated that PRP reduces the risk of severe visual loss (visual acuity <5/200) by more than 50% in eyes with high-risk PDR. This landmark study established PRP as the standard of care for high-risk PDR.",
src: "Harrison's Principles 22E; Wills Eye Manual"
},
{
section: null, num: 23, diff: "mod",
q: "Anti-VEGF therapy for center-involving diabetic macular edema (DME) is now considered:",
opts: ["Inferior to focal/grid laser for center-involving DME","As good as or superior to laser, and has largely replaced it as first-line for center-involving DME","Useful only in combination with laser, never as monotherapy","Effective only in ischemic DME subtype"],
ans: 1,
exp: "Anti-VEGF agents (ranibizumab, bevacizumab, aflibercept) are generally as good as or superior to laser therapy for center-involving DME and have largely replaced laser as first-line treatment. Laser photocoagulation remains particularly useful for non-center-involving DME and proliferative DR.",
src: "Goldman-Cecil Medicine §391; Wills Eye Manual"
},
{
section: null, num: 24, diff: "mod",
q: "Geographic atrophy in dry age-related macular degeneration (AMD) represents:",
opts: ["Subretinal neovascular membrane formation requiring anti-VEGF","Well-defined areas of RPE loss and photoreceptor atrophy causing irreversible central vision loss","A drusen coalescence that is reversible with antioxidant vitamins","A complication of anti-VEGF therapy"],
ans: 1,
exp: "Geographic atrophy is the advanced form of dry (non-exudative) AMD. It consists of sharply demarcated areas of RPE and overlying photoreceptor loss, resulting in irreversible central scotomas. The AREDS2 supplement formula is used for intermediate AMD, not geographic atrophy. Complement-targeted therapies (pegcetacoplan, avacincaptad pegol) have recently received regulatory approval.",
src: "Goldman-Cecil Medicine §391; Harrison's 22E"
},
{
section: null, num: 25, diff: "high",
q: "Glaucomatous optic nerve damage creates arcuate (Bjerrum) scotomas because glaucoma selectively damages axons entering which part of the optic disc?",
opts: ["Nasal quadrant, creating temporal field defects","Superotemporal and inferotemporal poles, creating arcuate scotomas emanating from the blind spot","Central papillomacular bundle, causing early central scotomas","Superior quadrant exclusively, causing inferior altitudinal defects"],
ans: 1,
exp: "Glaucoma selectively destroys axons entering the superotemporal or inferotemporal poles of the optic disc, resulting in arcuate scotomas shaped like a Turkish scimitar emanating from the blind spot. This reflects the arc-shaped course of the superior and inferior nerve fiber bundles temporal to fixation.",
src: "Harrison's Principles of Internal Medicine 22E §34"
},
{
section: null, num: 26, diff: "mod",
q: "A 55-year-old hypertensive patient has sudden painless visual loss. Fundoscopy shows disc edema, flame haemorrhages in ALL FOUR quadrants, markedly dilated tortuous veins, and cotton wool spots. The most likely diagnosis is:",
opts: ["Central retinal artery occlusion (CRAO)","Branch retinal vein occlusion (BRVO)","Central retinal vein occlusion (CRVO)","Non-arteritic anterior ischemic optic neuropathy (NAION)"],
ans: 2,
exp: "CRVO presents with the classic 'stormy sunset' fundus: disc edema, flame-shaped haemorrhages in all four quadrants, markedly dilated tortuous veins, and cotton wool spots. CRAO presents with a pale fundus and cherry-red spot. BRVO affects one sector. NAION shows disc edema with sector field loss.",
src: "Wills Eye Manual; Kanski's Ch.13"
},
{
section: null, num: 27, diff: "high",
q: "Which feature BEST distinguishes ischemic (non-perfused) CRVO from non-ischemic CRVO?",
opts: ["RAPD of 0.3 log units or less","Visual acuity better than 6/60 at presentation","More than 10 disc areas of retinal capillary non-perfusion on fluorescein angiography","Absence of cotton wool spots on fundoscopy"],
ans: 2,
exp: "Ischemic (non-perfused) CRVO is defined by >10 disc areas of retinal capillary non-perfusion on FFA. It presents with worse VA (typically <6/60), a significant RAPD, more extensive retinal haemorrhages, and carries high risk of neovascular complications including rubeotic glaucoma (neovascular glaucoma in ~33%).",
src: "Kanski's Clinical Ophthalmology 10th, Ch.13"
},
{
section: null, num: 28, diff: "mod",
q: "The 'cherry red spot' seen in central retinal artery occlusion is best explained by:",
opts: ["Haemorrhage at the fovea surrounded by white retina","The normal choroidal vasculature visible through the thin foveal retina, contrasted against the surrounding pale ischemic retina","Foveal RPE hypertrophy causing pigment accumulation","Subretinal neovascularization at the fovea"],
ans: 1,
exp: "In CRAO, the inner retina becomes pale and opaque due to ischemic edema (cytotoxic). At the fovea, the inner retina is absent (no ganglion cell layer), so the underlying normal choroidal circulation remains visible as a bright red spot, contrasted against the surrounding white ischemic retina.",
src: "Wills Eye Manual; Harrison's 22E §34"
},
{
section: null, num: 29, diff: "high",
q: "Multiple Evanescent White Dot Syndrome (MEWDS) is most characteristically associated with:",
opts: ["Bilateral presentation in middle-aged women with poor prognosis","Unilateral presentation in young myopic women with enlarged blind spot","Granulomatous panuveitis and choroidal granulomas requiring systemic steroids","Permanent photoreceptor damage in most cases"],
ans: 1,
exp: "MEWDS classically affects young myopic women, is unilateral, and presents with multiple small white dots at the outer retina/RPE level plus an enlarged blind spot on visual field testing. Visual prognosis is excellent - most cases resolve spontaneously within weeks to months without treatment.",
src: "Wills Eye Manual §11; Kanski's Ch.12"
},
{
section: null, num: 30, diff: "high",
q: "A symptomatic posterior vitreous detachment (PVD) with an identified horseshoe retinal tear carries approximately what risk of progressing to retinal detachment if left untreated?",
opts: ["Less than 5%","10-15%","30-50%","Over 70%"],
ans: 2,
exp: "A symptomatic PVD with an identified retinal tear (horseshoe/flap tear) carries approximately a 30-50% risk of progressing to rhegmatogenous retinal detachment if untreated. Prophylactic laser retinopexy or cryotherapy is therefore indicated for symptomatic tears identified during acute PVD.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.14; Wills Eye Manual"
},
// ─── LENS & CATARACT ─────────────────────────────────────────────────────────
{
section: "LENS & CATARACT",
num: 31, diff: "mod",
q: "Which type of cataract is MOST likely to require conversion from phacoemulsification to manual extracapsular cataract extraction (ECCE)?",
opts: ["Cortical cataract","Posterior subcapsular cataract","Dense brunescent (black/nigra) nuclear cataract","White mature cataract with intact capsule"],
ans: 2,
exp: "Dense brunescent/black (nigra) nuclear cataracts are extremely hard and may require excessive ultrasound energy for phacoemulsification, risking corneal endothelial decompensation, thermal burns, and posterior capsule rupture. ECCE (non-phaco) may be the safer technique for very hard nuclei.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.9"
},
{
section: null, num: 32, diff: "high",
q: "To minimize endothelial cell loss in a patient with Fuchs endothelial corneal dystrophy undergoing phacoemulsification, the BEST technique is:",
opts: ["Longitudinal phacoemulsification at maximum power to minimize operating time","Torsional (Ozil) phacoemulsification, which uses less cumulative dissipated energy","Manual SICS to avoid any ultrasound energy entirely","Femtosecond laser lens fragmentation followed by irrigation/aspiration only"],
ans: 1,
exp: "Modern torsional phacoemulsification (Ozil mode) uses significantly less cumulative dissipated energy (CDE) and effective phaco time compared to longitudinal phacoemulsification, thereby reducing endothelial cell loss. This is the preferred technique when endothelial compromise is present.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.9"
},
{
section: null, num: 33, diff: "high",
q: "Posterior capsule rupture with vitreous loss during phacoemulsification MOST significantly increases the long-term risk of:",
opts: ["Anterior capsular phimosis causing IOL decentration","Cystoid macular edema (CME) and endophthalmitis","Posterior IOL pigment dispersion glaucoma","Refractive surprise only, with no other serious complications"],
ans: 1,
exp: "Posterior capsule rupture with vitreous loss significantly increases rates of cystoid macular edema, endophthalmitis (vitreous provides a scaffold for bacteria), retinal detachment, and chronic uveitis. Proper anterior vitrectomy and sulcus or anterior chamber IOL placement are critical.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.9"
},
{
section: null, num: 34, diff: "mod",
q: "Posterior subcapsular cataracts (PSC) are MOST specifically associated with which group of risk factors?",
opts: ["Prolonged UV-B exposure and outdoor occupation","Corticosteroid use (systemic/topical/inhaled), diabetes mellitus, and ionizing radiation","Advanced age and female sex exclusively","High myopia in childhood"],
ans: 1,
exp: "PSC are specifically associated with corticosteroid use (systemic, topical, or inhaled), diabetes mellitus, ionizing radiation, trauma, and uveitis. They characteristically cause visual symptoms (glare, reduced vision in bright light/near vision) disproportionate to the apparent opacity size.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.9"
},
{
section: null, num: 35, diff: "mod",
q: "Nd:YAG laser posterior capsulotomy for posterior capsule opacification (PCO) should ideally be deferred for at least how long after uncomplicated cataract surgery?",
opts: ["1 week postoperatively","1 month postoperatively","6 weeks postoperatively","3-6 months or longer, unless vision is critically impaired"],
ans: 3,
exp: "Nd:YAG capsulotomy should generally be deferred at least 3-6 months after cataract surgery to allow IOL stabilization and PCO to fully develop. Early capsulotomy risks IOL pitting, cystoid macular edema, and retinal detachment. Urgent treatment may be warranted for amblyogenic PCO in children or critically impaired vision.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.9"
},
// ─── NEURO-OPHTHALMOLOGY ─────────────────────────────────────────────────────
{
section: "NEURO-OPHTHALMOLOGY",
num: 36, diff: "mod",
q: "Papilledema, by its STRICT ophthalmological definition, refers exclusively to optic disc swelling caused by:",
opts: ["Any cause of optic disc swelling (non-specific term)","Elevated intraocular pressure compressing the optic nerve head","Raised intracranial pressure transmitted along the optic nerve sheath","Ischemia of the optic nerve head from small vessel disease"],
ans: 2,
exp: "'Papilledema' strictly denotes optic disc swelling secondary to raised intracranial pressure. 'Disc swelling' and 'disc oedema' are non-specific terms encompassing other causes such as optic neuritis, NAION, hypertensive retinopathy, and infiltration. All papilledema requires urgent neuroimaging.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.16"
},
{
section: null, num: 37, diff: "mod",
q: "The characteristic visual field defect pattern produced by optic nerve disease is:",
opts: ["Homonymous hemianopia respecting the vertical meridian","Bitemporal hemianopia","Centrocaecal scotoma, arcuate scotoma, or altitudinal defect","Congruous inferior quadrantanopia"],
ans: 2,
exp: "Optic nerve disease produces pre-chiasmal field defects: centrocaecal scotoma (spanning blind spot and fixation), arcuate (Bjerrum) scotoma, altitudinal defects, or total loss. Bitemporal hemianopia = chiasmal. Homonymous hemianopia = retrochiasmal (optic tract to cortex).",
src: "Harrison's Principles of Internal Medicine 22E §34"
},
{
section: null, num: 38, diff: "high",
q: "A 32-year-old woman presents with acute painful monocular visual loss, reduced color vision (red desaturation), and afferent pupillary defect. MRI shows T2 optic nerve signal change. The MOST appropriate initial treatment is:",
opts: ["Oral prednisolone 1 mg/kg/day for 14 days","IV methylprednisolone 1 g/day for 3 days followed by oral prednisolone taper","Immediate orbital decompression surgery","Observation only - condition is fully self-limiting"],
ans: 1,
exp: "This is acute demyelinating optic neuritis. The ONTT showed IV methylprednisolone (1g/day x3 days, then oral taper) speeds visual recovery but does not improve final VA. Critically: oral prednisolone alone (1 mg/kg) INCREASES the rate of new demyelinating events and recurrent optic neuritis - it is CONTRAINDICATED as monotherapy.",
src: "ONTT; Wills Eye Manual §10; Kanski's Ch.16"
},
{
section: null, num: 39, diff: "high",
q: "Third nerve palsy with PUPIL INVOLVEMENT (dilated, unreactive pupil) combined with acute severe 'thunderclap' headache must URGENTLY exclude:",
opts: ["Diabetic microvascular third nerve palsy","Myasthenia gravis causing ptosis and ophthalmoplegia","Posterior communicating artery (PComA) aneurysm","Cavernous sinus thrombosis"],
ans: 2,
exp: "Pupil-involving CN III palsy with thunderclap headache is a posterior communicating artery aneurysm until proven otherwise. Parasympathetic fibers travel on the OUTSIDE of CN III and are first compressed by aneurysmal expansion. Diabetic/microvascular palsy characteristically SPARES the pupil. CT angiography is the priority.",
src: "Kanski's Ch.16; Harrison's 22E §404"
},
{
section: null, num: 40, diff: "mod",
q: "Horner syndrome consists of all of the following EXCEPT:",
opts: ["Partial (2 mm) ptosis from superior tarsal (Müller's) muscle paresis","Miosis with anisocoria greatest in dim light","Apparent enophthalmos from lower lid elevation (reverse ptosis)","Loss of accommodation (cycloplegia)"],
ans: 3,
exp: "Horner syndrome: ptosis (superior tarsal/Müller's muscle - partial, ~2mm), miosis (dilator muscle paresis - anisocoria worse in dim light), apparent enophthalmos (from lower lid elevation/inverse ptosis). Anhidrosis may occur with central or pre-ganglionic lesions. Accommodation is INTACT - ciliary muscle is parasympathetically innervated and unaffected.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.16"
},
{
section: null, num: 41, diff: "high",
q: "Internuclear ophthalmoplegia (INO) - characterized by ipsilateral adduction failure with contralateral abducting nystagmus - results from a lesion in:",
opts: ["The sixth nerve (abducens) nucleus ipsilateral to the abduction failure","The medial longitudinal fasciculus (MLF) ipsilateral to the eye with adduction failure","The third nerve nucleus contralateral to the adduction failure","The ipsilateral PPRF (paramedian pontine reticular formation)"],
ans: 1,
exp: "INO results from a lesion in the medial longitudinal fasciculus (MLF), which connects the contralateral abducens nucleus to the ipsilateral medial rectus subnucleus of CN III. INO is named for the eye with adduction failure, which is IPSILATERAL to the MLF lesion. Most common causes: MS (bilateral) and brainstem stroke (unilateral).",
src: "Kanski's Ch.16; Harrison's 22E §34"
},
{
section: null, num: 42, diff: "high",
q: "Which statement correctly describes a relative afferent pupillary defect (RAPD / Marcus Gunn pupil)?",
opts: ["RAPD positive in the right eye indicates a right optic tract lesion","RAPD positive in the left eye indicates left optic nerve or severe left retinal disease","RAPD is always present in complete third nerve palsy","Bilateral symmetric optic nerve lesions always produce an RAPD"],
ans: 1,
exp: "RAPD (detected by swinging flashlight test) indicates asymmetric afferent input - the pupil dilates when light swings to the affected eye. It is positive with unilateral optic nerve disease or severe unilateral retinal disease on the side of dilation. Bilateral symmetric lesions do NOT produce RAPD. Third nerve palsy causes efferent (not afferent) pupil defect.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.16"
},
// ─── UVEITIS & OCULAR INFLAMMATION ──────────────────────────────────────────
{
section: "UVEITIS & OCULAR INFLAMMATION",
num: 43, diff: "mod",
q: "A 25-year-old man with low back pain, morning stiffness lasting >1 hour, and bilateral recurrent acute anterior uveitis with posterior synechiae. The MOST likely associated systemic condition is:",
opts: ["Sarcoidosis (bilateral chronic granulomatous uveitis)","HLA-B27-associated disease (e.g., ankylosing spondylitis)","Behçet disease (oral/genital ulcers and retinal vasculitis)","Juvenile idiopathic arthritis, oligoarticular type"],
ans: 1,
exp: "HLA-B27-associated uveitis is the most common cause of recurrent acute anterior uveitis in young adults. It is classically non-granulomatous, unilateral and alternating. The association with sacroiliitis/ankylosing spondylitis (low back pain, morning stiffness, limited spinal mobility) is classic. HLA-B27 found in ~50-80% of cases.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.12"
},
{
section: null, num: 44, diff: "mod",
q: "The MOST COMMON cause of posterior uveitis (focal necrotizing retinochoroiditis) in immunocompetent patients worldwide is:",
opts: ["Cytomegalovirus (CMV) retinitis","Toxoplasma gondii retinochoroiditis","Sarcoidosis with choroidal granulomas","Ocular histoplasmosis syndrome"],
ans: 1,
exp: "Toxoplasmosis (Toxoplasma gondii) is the most common cause of posterior uveitis in immunocompetent patients globally. It presents as a 'headlight in fog' - an active white fluffy retinal lesion adjacent to a pigmented chorioretinal scar from prior congenital or acquired infection. CMV retinitis is the most common posterior uveitis in immunocompromised (HIV/AIDS) patients.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.12; Wills Eye Manual"
},
{
section: null, num: 45, diff: "mod",
q: "Which slit lamp finding BEST distinguishes granulomatous from non-granulomatous anterior uveitis?",
opts: ["Hypopyon formation in the anterior chamber","Large 'mutton-fat' keratic precipitates (KPs) on the corneal endothelium","Posterior synechiae to the anterior lens capsule","Progressive iris atrophy"],
ans: 1,
exp: "Granulomatous uveitis (sarcoidosis, VKH syndrome, sympathetic ophthalmia, TB, toxoplasmosis, leprosy) produces large 'mutton-fat' KPs - aggregates of epithelioid macrophages on the inferior corneal endothelium. Non-granulomatous uveitis produces small, fine, dusty, or stellate KPs. Busacca and Koeppe nodules also indicate granulomatous disease.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.12"
},
{
section: null, num: 46, diff: "high",
q: "Vogt-Koyanagi-Harada (VKH) syndrome is characterized by all of the following EXCEPT:",
opts: ["Bilateral granulomatous panuveitis with exudative retinal detachments","Poliosis, vitiligo, alopecia, and dysacousia","Meningismus and cerebrospinal fluid lymphocytic pleocytosis","Strong association with HLA-B27 haplotype"],
ans: 3,
exp: "VKH syndrome is strongly associated with HLA-DR4 (specifically DRB1*0405 in Japanese patients), NOT HLA-B27. HLA-B27 is associated with seronegative spondyloarthropathies and acute anterior uveitis. VKH features: bilateral panuveitis/exudative RD (uveitic phase), then cutaneous changes (vitiligo, poliosis, alopecia) and neurological findings (meningismus, CSF pleocytosis, dysacousia).",
src: "Kanski's Clinical Ophthalmology 10th, Ch.12"
},
// ─── STRABISMUS & PEDIATRIC ──────────────────────────────────────────────────
{
section: "STRABISMUS & PEDIATRIC OPHTHALMOLOGY",
num: 47, diff: "mod",
q: "Amblyopia therapy (patching/penalization of the fellow eye) is most effective when initiated:",
opts: ["At any age up to 18 years with equal benefit","During the sensitive period of visual development, ideally before 7-8 years of age","After at least 5 years of optical correction has been established","Only if strabismus is the underlying cause"],
ans: 1,
exp: "Amblyopia treatment is most effective during the sensitive/critical period of visual development (up to approximately 7-8 years) when cortical plasticity is highest. Treatment can still be attempted up to early teenage years but is progressively less effective. Full refractive correction should precede patching in refractive/anisometropic amblyopia.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.17"
},
{
section: null, num: 48, diff: "high",
q: "A 3-year-old child has a constant left esotropia of 40 prism diopters. Cycloplegic refraction shows +5.00 D bilaterally. The BEST initial management is:",
opts: ["Immediate surgical correction of the full 40 PD esotropia","Prescribe the full cycloplegic hyperopic correction and reassess in 3 months","Prescribe bifocal glasses only without full distance correction","Occlusion therapy of the right eye before considering any glasses"],
ans: 1,
exp: "In accommodative esotropia, the FIRST step is prescribing the FULL cycloplegic hyperopic correction. In fully accommodative esotropia, glasses alone will straighten the deviation by eliminating the accommodative convergence. Surgery is indicated only for non-accommodative or residual deviation after optical correction.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.17"
},
{
section: null, num: 49, diff: "high",
q: "Duane retraction syndrome Type I is characterized by:",
opts: ["Limitation of adduction with globe retraction on attempted adduction","Limitation of abduction with globe retraction and narrowing of palpebral fissure on attempted adduction","Equal limitation of both abduction and adduction with globe retraction","Isolated limitation of elevation with globe retraction"],
ans: 1,
exp: "Duane Type I (most common, ~78%): Limited or absent ABDUCTION with relatively normal adduction. On adduction, globe retraction occurs with narrowing of the palpebral fissure due to co-contraction of medial and lateral rectus (lateral rectus is aberrantly innervated by CN III branch instead of CN VI). Type II: limited adduction. Type III: both.",
src: "Kanski's Clinical Ophthalmology 10th, Ch.17"
},
{
section: null, num: 50, diff: "high",
q: "A child presents with acquired esotropia, bilateral papilledema, and limitation of abduction bilaterally. The MOST important diagnosis to exclude is:",
opts: ["Newly decompensating accommodative esotropia","Convergence excess esotropia from high AC/A ratio","Raised intracranial pressure causing bilateral sixth nerve palsy (false localizing sign)","Ocular myasthenia gravis causing bilateral lateral rectus fatigue"],
ans: 2,
exp: "Bilateral CN VI (abducens) palsy combined with papilledema is a classic 'false localizing sign' of raised intracranial pressure. The long intracranial course of CN VI makes it susceptible to stretching with raised ICP. This is a neurological emergency requiring urgent neuroimaging (CT/MRI head) to exclude intracranial mass, hydrocephalus, or pseudotumor cerebri.",
src: "Kanski's Ch.16 & 17; Harrison's 22E §34"
}
];
// ── STATE ───────────────────────────────────────────────────────────────────
let answered = 0;
let score = 0;
const userAnswers = new Array(questions.length).fill(null);
// ── BUILD UI ─────────────────────────────────────────────────────────────────
function buildQuiz() {
const container = document.getElementById('quiz-container');
container.innerHTML = '';
let currentSection = null;
questions.forEach((q, idx) => {
if (q.section && q.section !== currentSection) {
currentSection = q.section;
const sh = document.createElement('div');
sh.className = 'section-header';
sh.textContent = q.section;
container.appendChild(sh);
}
const card = document.createElement('div');
card.className = 'q-card';
card.id = `card-${idx}`;
const diffLabel = q.diff === 'high'
? `<span class="diff-tag diff-high">HIGH</span>`
: `<span class="diff-tag diff-mod">MOD</span>`;
card.innerHTML = `
<div class="q-header">
<span class="q-num">Q${q.num}</span>
<span class="q-text">${q.q}${diffLabel}</span>
</div>
<div class="options" id="opts-${idx}">
${['A','B','C','D'].map((ltr, oi) => `
<div class="opt" id="opt-${idx}-${oi}" onclick="selectAnswer(${idx}, ${oi})">
<span class="opt-letter">${ltr}.</span>
<span>${q.opts[oi]}</span>
<span class="opt-icon" id="icon-${idx}-${oi}"></span>
</div>
`).join('')}
</div>
<button class="reveal-btn" id="revbtn-${idx}" onclick="toggleReveal(${idx})">
▼ Show Answer & Explanation
</button>
<div class="answer-box" id="ans-${idx}">
<div class="answer-label">✔ Correct Answer: ${['A','B','C','D'][q.ans]}</div>
<div class="answer-text">${q.exp}</div>
<div class="answer-source">📖 ${q.src}</div>
</div>
`;
container.appendChild(card);
});
}
// ── ANSWER SELECTION ─────────────────────────────────────────────────────────
function selectAnswer(qIdx, optIdx) {
if (userAnswers[qIdx] !== null) return; // already answered
userAnswers[qIdx] = optIdx;
answered++;
const q = questions[qIdx];
const correct = q.ans;
const isCorrect = optIdx === correct;
if (isCorrect) score++;
// Style chosen option
const chosenEl = document.getElementById(`opt-${qIdx}-${optIdx}`);
chosenEl.classList.add(isCorrect ? 'correct-choice' : 'wrong-choice');
document.getElementById(`icon-${qIdx}-${optIdx}`).textContent = isCorrect ? '✔' : '✘';
// If wrong, highlight correct answer
if (!isCorrect) {
const corrEl = document.getElementById(`opt-${qIdx}-${correct}`);
corrEl.classList.add('show-correct');
document.getElementById(`icon-${qIdx}-${correct}`).textContent = '✔';
}
// Disable all options
['A','B','C','D'].forEach((_, oi) => {
const el = document.getElementById(`opt-${qIdx}-${oi}`);
el.classList.add('disabled');
el.style.cursor = 'default';
});
// Auto-open explanation
document.getElementById(`ans-${qIdx}`).classList.add('open');
const btn = document.getElementById(`revbtn-${qIdx}`);
btn.textContent = '▲ Hide Explanation';
// Add badge to question number
const qNum = document.querySelector(`#card-${qIdx} .q-num`);
const badge = document.createElement('span');
badge.className = `status-badge ${isCorrect ? 'badge-correct' : 'badge-wrong'}`;
badge.textContent = isCorrect ? '✔ Correct' : '✘ Wrong';
qNum.after(badge);
updateProgress();
if (answered === questions.length) {
setTimeout(showSummary, 600);
}
}
// ── TOGGLE EXPLANATION ────────────────────────────────────────────────────────
function toggleReveal(qIdx) {
const box = document.getElementById(`ans-${qIdx}`);
const btn = document.getElementById(`revbtn-${qIdx}`);
box.classList.toggle('open');
btn.textContent = box.classList.contains('open')
? '▲ Hide Explanation'
: '▼ Show Answer & Explanation';
}
// ── PROGRESS ─────────────────────────────────────────────────────────────────
function updateProgress() {
const pct = (answered / questions.length) * 100;
document.getElementById('progress-bar-inner').style.width = pct + '%';
document.getElementById('progress-text').textContent = `${answered} / ${questions.length} answered`;
document.getElementById('score-display').textContent = `Score: ${score}`;
}
// ── SUMMARY ───────────────────────────────────────────────────────────────────
function showSummary() {
const pct = Math.round((score / questions.length) * 100);
let msg = '';
if (pct >= 90) msg = 'Outstanding! Excellent fellowship-level performance.';
else if (pct >= 75) msg = 'Well done! Strong performance. Review the questions you missed.';
else if (pct >= 60) msg = 'Good effort. Focus on areas with incorrect answers.';
else msg = 'Keep practising. Revisit the explanations and core textbooks.';
document.getElementById('final-score').textContent = `${score} / ${questions.length} (${pct}%)`;
document.getElementById('final-msg').textContent = msg;
const summary = document.getElementById('summary');
summary.style.display = 'block';
summary.scrollIntoView({ behavior: 'smooth' });
}
// ── RESET ─────────────────────────────────────────────────────────────────────
function resetQuiz() {
answered = 0; score = 0;
userAnswers.fill(null);
document.getElementById('summary').style.display = 'none';
updateProgress();
buildQuiz();
window.scrollTo({ top: 0, behavior: 'smooth' });
}
// ── INIT ──────────────────────────────────────────────────────────────────────
buildQuiz();
updateProgress();
</script>
</body>
</html>