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 <noreply@anthropic.com>
This commit is contained in:
Nate EmmertandClaude Sonnet 4.6 committed 2026-08-21 08:34:36 -04:00
1 parent 43aa367f63
commit 4574bd3785
2 files changed
+3 -22

No files matched your search

+3 -19
View File
@@ -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;