From 4574bd37855b607a21e89fc62cd76b230f3d6dbe Mon Sep 17 00:00:00 2001 From: Nate Emmert Date: Fri, 21 Aug 2026 08:34:36 -0400 Subject: [PATCH] Limit practice sessions to the assigned list only Remove cross-list review words (Leitner spaced repetition) from practice sessions so only the currently assigned list's words are shown. Also remove the now-unused dueReviews count from the state endpoint and student UI. Co-Authored-By: Claude Sonnet 4.6 --- public/app.js | 3 --- server.js | 22 +++------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/public/app.js b/public/app.js index a017844..802926e 100644 --- a/public/app.js +++ b/public/app.js @@ -902,9 +902,6 @@ function renderSpellingTab(state, tests = []) { html = `No list assigned yet — ask a parent to pick one!`; currentSpellingListId = null; } - if (state.dueReviews > 0) { - html += `
🔁 ${state.dueReviews} old ${state.dueReviews === 1 ? 'word' : 'words'} due for review
`; - } $('#kid-week').innerHTML = html; $('#btn-test').disabled = !state.assignment; $('#btn-print-list').disabled = !state.assignment; diff --git a/server.js b/server.js index df51a60..38db476 100644 --- a/server.js +++ b/server.js @@ -413,17 +413,10 @@ app.get('/api/state/:studentId', (req, res) => { `).get(id, assignment.id); } - // only words outside this week's list count as "old reviews" - const dueReviews = db.prepare(` - SELECT COUNT(*) AS n FROM progress p JOIN words w ON w.id = p.word_id - WHERE p.student_id = ? AND w.list_id <> ? AND p.box < ${MASTERED_BOX} - AND date(p.due) <= date('now') - `).get(id, assignment ? assignment.id : -1).n; - - res.json({ student: { ...student, isBirthdayWeek: isBirthdayWeek(student.birthday) }, assignment, listProgress, dueReviews }); + res.json({ student: { ...student, isBirthdayWeek: isBirthdayWeek(student.birthday) }, assignment, listProgress }); }); -// Build a practice session: the target list's unmastered words + due reviews. +// Build a practice session: the target list's unmastered words only. // listId overrides the student's pinned weekly assignment (used when launched from a course item). app.get('/api/session/:studentId', (req, res) => { const id = req.params.studentId; @@ -441,16 +434,7 @@ app.get('/api/session/:studentId', (req, res) => { ORDER BY box, RANDOM() `).all(id, listId); - const reviews = db.prepare(` - SELECT w.id, w.word, w.sentence, w.definition, p.box - FROM progress p JOIN words w ON w.id = p.word_id - WHERE p.student_id = ? AND w.list_id <> ? AND p.box < ${MASTERED_BOX} - AND date(p.due) <= date('now') - ORDER BY p.due - LIMIT 5 - `).all(id, listId); - - res.json({ words: shuffle([...weekWords, ...reviews]) }); + res.json({ words: shuffle(weekWords) }); }); // Grade one practice answer. firstTry attempts move the Leitner box;