Move spelling test results from Spelling panel into Gradebook

Adds a GET /api/spelling-tests endpoint that returns all standalone test
results grouped by student. The Gradebook panel now shows a "Spelling Test
History" section below the course gradebook table. Removed the "Test results"
section from the Spelling panel left column.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-07-27 13:55:23 -04:00
1 parent 774979f2e4
commit 183b43b452
3 files changed
+46 -25

No files matched your search

+13
View File
@@ -968,6 +968,19 @@ app.get('/api/gradebook/:courseId/csv', requirePin, (req, res) => {
res.send([header, ...rows].map((r) => r.join(',')).join('\n'));
});
// All standalone spelling test results grouped by student
app.get('/api/spelling-tests', requirePin, (req, res) => {
const students = db.prepare(`SELECT id, name, emoji FROM students ORDER BY name`).all();
for (const s of students) {
s.tests = db.prepare(`
SELECT t.id, t.score, t.total, t.at, l.name AS list
FROM tests t JOIN lists l ON l.id = t.list_id
WHERE t.student_id = ? ORDER BY t.at DESC LIMIT 20
`).all(s.id);
}
res.json({ students });
});
// Full evidence for a submission (photo can be large, not included in queue list)
app.get('/api/grading-queue/:id/evidence', requirePin, (req, res) => {
const row = db.prepare(`SELECT evidence_notes, evidence_photo FROM submissions WHERE id = ?`).get(req.params.id);