From 9f7a449e3dbf8bb574645ae1ad6a96a9f050c16f Mon Sep 17 00:00:00 2001 From: Justin Oros Date: Thu, 14 May 2026 09:45:23 -0700 Subject: [PATCH] Fix answer clicks broken by missing q param in pick(), fix fetch path for GitHub Pages --- game.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game.js b/game.js index 0eb6a7d..909aa8e 100644 --- a/game.js +++ b/game.js @@ -472,7 +472,7 @@ class Game { /* ── LOAD QUESTIONS ───────────────────────────────────── */ loadQuestions(cb) { if (this.state.questions.length>0) { cb(); return; } - fetch('questions.json') + fetch('./questions.json') .then(r=>r.json()) .then(data=>{ this.state.questions=data.levels[0].questions; cb(); }) .catch(()=>this.toast('❌ Could not load questions.json')); @@ -564,13 +564,13 @@ class Game { btn.className='choice-btn'; btn.setAttribute('data-letter', slotIdx + 1); btn.textContent=q.options[origIdx]; - btn.addEventListener('click',()=>this.pick(slotIdx, correctShuffledIdx, container)); + btn.addEventListener('click',()=>this.pick(slotIdx, correctShuffledIdx, q, container)); container.appendChild(btn); }); this._renderCursor(); } - pick(chosen, correctIdx, container) { + pick(chosen, correctIdx, q, container) { if(this.state.answering)return; this.state.answering=true;