forge
Explore
Log in

Don't you dare go Hollow

hezarfen_frontend

Clone
★ 0

0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits

homework-grade.ts13 lines, 610 bytesHistoryRawDownload
1import type { HomeworkRosterEntry } from "@/api/client";
2
3/**
4 * The status the grading panel opens with: the saved result, else "missing"
5 * once the deadline passed with nothing handed in, else "done" only for a
6 * student who did submit. A non-submitter before the deadline gets "" — the
7 * grader has to choose, so one quick save never marks them as done.
8 */
9export function defaultGradeStatus(row: Pick<HomeworkRosterEntry, "result" | "missing" | "submission">): string {
10 if (row.result?.status) return row.result.status;
11 if (row.missing) return "missing";
12 return row.submission ? "done" : "";
13}