Stop calling a feedback-only grade "no numeric grade recorded"
You were right that the output was wrong, though not quite for the
reason given: the schema has no textual grade. It is
grade: { type: Number, min: 0, max: 100 } with gradeComment: String, so
"OK" is the comment, not the grade.
What the model does allow is exactly your case — teachers grade with the
comment alone and leave grade unset. Rendering that as "graded (no
numeric grade recorded)" reads as missing or broken data when in fact
the written verdict is the whole grade. It now says "graded by feedback,
with no percentage given", and reserves the it-is-absent wording for
when there is genuinely neither a percentage nor a comment.
Also fixes a real misrepresentation next to it: grade is a percentage,
and both the detail and list views printed it bare, so an 85 could be
read as a mark out of 100, 15 or 6. Now rendered as 85%.
formatGradeState is pure and covered by seven cases, including 0% staying
distinct from "no grade" — the bug that an `if (grade)` test would have
introduced.
85 tests, 38/38 smoke.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -140,6 +140,13 @@ attributes the project's own e2e tests use. Note the page authenticates with the
|
||||
identity provider. Measured: 4 of 7 graded submissions in one course carried
|
||||
feedback no API call can return.
|
||||
|
||||
**A grade is a percentage or nothing.** The submission schema is
|
||||
`grade: { type: Number, min: 0, max: 100 }` and `gradeComment: { type: String }`
|
||||
— there is no textual grade field. In practice teachers frequently grade with
|
||||
`gradeComment` alone and leave `grade` unset, so a written "OK" is the whole
|
||||
verdict for that submission. Treat a missing `grade` as "no percentage given",
|
||||
never as "ungraded" (`graded` is its own boolean) and never as an error.
|
||||
|
||||
**files-storage ignores `parentType` when listing.** Asking for
|
||||
`.../gradings/{submissionId}` returns the files parented to that id whatever
|
||||
their type — the records come back saying `parentType: "submissions"`. The path
|
||||
|
||||
Reference in New Issue
Block a user