Fix 7 UX pain points: grading filter, next-item nav, lesson prose, gradebook calc, auto-schedule skip, lesson item defaults, planner improvements

- Grading: add student filter dropdown, Enter-to-save, and point max always defaults to 100
- Student side: show next-item/back-to-course actions after completing a lesson or assignment
- Lesson body: apply prose typography styles (headings, lists, blockquotes, links, hr)
- Gradebook: fix % display when points_possible is 0 (default to 100 on grade save)
- Auto-schedule: skip items that already have a submission
- Item editor: default new/existing item point values to 100 instead of 10
- Planner: friendly week date header, per-day short date, today highlight, course color on task pills, done toggle, within-day drag reorder, Today button

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-08-04 16:33:59 -04:00
1 parent 60a2a597c5
commit 538522cfe7
6 files changed
+94 -25

No files matched your search

+33 -2
View File
@@ -258,6 +258,28 @@ async function loadHome() {
// ---------- kid home: Today / Courses / Spelling ----------
let currentCourseItems = []; // flat [{id, type, title}] from most-recently opened course
function findNextCourseItem(currentId) {
const idx = currentCourseItems.findIndex((it) => it.id === currentId);
if (idx === -1 || idx >= currentCourseItems.length - 1) return null;
return currentCourseItems[idx + 1];
}
function showNextActions(containerId, currentItemId) {
const next = findNextCourseItem(currentItemId);
const el = document.getElementById(containerId);
if (!el) return;
if (!next) { backTarget(); return; }
el.hidden = false;
el.innerHTML = `
<button class="check-btn" id="next-item-btn">Next: ${esc(next.title)} →</button>
<button class="check-btn secondary" id="back-course-btn">← Back to course</button>
`;
document.getElementById('next-item-btn').addEventListener('click', () => { el.hidden = true; openItem(next.id, next.type); });
document.getElementById('back-course-btn').addEventListener('click', () => { el.hidden = true; backTarget(); });
}
document.querySelectorAll('.nav-pill').forEach((pill) =>
pill.addEventListener('click', () => switchTab(pill.dataset.tab))
);
@@ -902,6 +924,7 @@ function activeUnitIndex(units) {
async function openCourse(courseId) {
const course = await api(`/api/courses/${courseId}/detail?studentId=${currentStudent.id}`);
currentCourseItems = course.units.flatMap((u) => u.items.map((it) => ({ id: it.id, type: it.type, title: it.title })));
$('#course-title').textContent = course.name;
const activeIdx = activeUnitIndex(course.units);
$('#course-units').innerHTML = course.units
@@ -992,12 +1015,15 @@ async function openLesson(itemId) {
show('lesson');
const btn = $('#lesson-done-btn');
const nextActions = $('#lesson-next-actions');
nextActions.hidden = true;
btn.textContent = item.submission ? '✅ Read' : 'Done reading ✓';
btn.onclick = async () => {
await api(`/api/items/${itemId}/complete`, { method: 'POST', body: { studentId: currentStudent.id, date: todayStr() } });
showMiniCelebration('📖 Lesson complete!');
await showDoneStamp();
backTarget();
btn.disabled = true;
showNextActions('lesson-next-actions', itemId);
};
}
@@ -1009,6 +1035,7 @@ async function openAssignment(itemId) {
$('#assignment-photo-input').value = '';
$('#assignment-evidence-notes').value = '';
$('#assignment-student-note').value = '';
$('#assignment-next-actions').hidden = true;
const item = await api(`/api/items/${itemId}?studentId=${currentStudent.id}`);
$('#assignment-kicker').textContent = `${item.course_name} · ${item.unit_name}`;
@@ -1068,7 +1095,11 @@ async function openAssignment(itemId) {
await api(`/api/items/${itemId}/complete`, { method: 'POST', body });
showMiniCelebration('📝 Turned in!');
await showDoneStamp();
openAssignment(itemId);
btn.hidden = true;
status.hidden = false;
status.className = 'status-banner';
status.textContent = '⏳ Turned in — waiting for a parent to grade it.';
showNextActions('assignment-next-actions', itemId);
};
}
show('assignment');