Fix drill missed words button — shuffle was not defined

ReferenceError on click prevented the drill session from starting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-08-12 13:37:38 -04:00
1 parent 5290dd80ca
commit bb56b9b9e8
1 file changed
+9
+9
View File
@@ -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 };