Gradebook unit cards, scroll/state preservation on course edit
- Gradebook now groups items by unit with collapsible cards (same card style as course detail) and a Course overall summary table at the bottom - server.js: add unit_id/unit_name to gradebook API so items can be grouped - Course detail: preserve which units are open and scroll position across any in-place re-render (add unit, delete unit, save meta, return from item editor) — no more jumping to the top with everything reset Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
723bbb93c8
commit
de598496bc
3 files changed
+113
-36
No files matched your search
@@ -884,7 +884,8 @@ app.get('/api/gradebook/:courseId', requirePin, (req, res) => {
|
||||
if (!course) return res.status(404).json({ error: 'No such course' });
|
||||
|
||||
const gradableItems = db.prepare(`
|
||||
SELECT i.id, i.title, i.type, i.points, i.due_date, i.retake_policy
|
||||
SELECT i.id, i.title, i.type, i.points, i.due_date, i.retake_policy,
|
||||
u.id AS unit_id, u.name AS unit_name, u.sort AS unit_sort
|
||||
FROM items i JOIN units u ON u.id = i.unit_id
|
||||
WHERE u.course_id = ? AND i.type IN (${GRADABLE_TYPES.map(() => '?').join(',')})
|
||||
ORDER BY u.sort, i.sort, i.id
|
||||
|
||||
Reference in new issue
Block a user