From bb56b9b9e8092c6135e44f43165f06ce3f57f97c Mon Sep 17 00:00:00 2001 From: nmemmert <67961292+nmemmert@users.noreply.github.com> Date: Wed, 12 Aug 2026 13:37:38 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20drill=20missed=20words=20button=20?= =?UTF-8?q?=E2=80=94=20shuffle=20was=20not=20defined?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ReferenceError on click prevented the drill session from starting. Co-Authored-By: Claude Sonnet 4.6 --- public/app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/app.js b/public/app.js index 6bc1349..ab8033c 100644 --- a/public/app.js +++ b/public/app.js @@ -1991,6 +1991,15 @@ async function finishFlashcards(nothingDue) { $('#flash-home').addEventListener('click', () => backTarget()); } +function shuffle(arr) { + const a = arr.slice(); + for (let i = a.length - 1; i > 0; i--) { + const j = Math.floor(Math.random() * (i + 1)); + [a[i], a[j]] = [a[j], a[i]]; + } + return a; +} + // ---------- spelling: practice ---------- const practice = { words: [], i: 0, missed: [], missedWords: [], firstTryCorrect: 0, awaitingRetype: false, itemId: null, streak: 0 };