Repository navigation
exams: a subject without marks parts never grades A+ — Tier B - #71
Open
omerFixesBugs wants to merge 4 commits into
Open
omerFixesBugs wants to merge 4 commits into
omerFixesBugs wants to merge 4 commits into
Conversation
…irst) On main a subject with no parts has full marks 0, and every band's "at least min% of 0" holds, so it grades A+ (5.0) and passes in NONE rounding (and the ROUND_HALF_UP and CEIL schemes throw instead). The e2e test reproduces the whole path on main: an empty section's part-less sheets submit and lock, students join by roster sync, the preview shows 5.00 and publish stores A+. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- shared: subjectResult treats full marks 0 (no parts) as INCOMPLETE, like a blank part: no letter, no point, not passed, so the student has no GPA, pass or division and no place. gradeForMarks refuses full marks 0 in every rounding mode (NONE gave the top band; the others threw by accident). - api: the publish check lists subjectsWithoutMarks (subjects someone sits that have no parts) as a blocker, and publish refuses them first with 422 SUBJECT_WITHOUT_MARKS naming the subjects. Saving or submitting a part-less sheet is refused with the same code, so an empty sheet can no longer be submitted and locked. Opening an exam is unchanged. - web: the results panel lists the part-less subjects and keeps Publish off; the refusal toast names them; the sheet explains that the parts are not set, keeps Submit off, counts nobody as entered and previews "Incomplete". Published snapshots are not recomputed: they keep their stored values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The web names the subjects only for a refused publish; a refused sheet save shows the sheet's own words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omerFixesBugs
added a commit
that referenced
this pull request
Nov 30, 2026
…k, the clean-up Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omerFixesBugs
marked this pull request as ready for review
November 30, 2026 16:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found on main by today's review of #66 (Aliya). Not for merging today: it changes exam behaviour the owner did not ask for, so it stays a draft for the owner to decide, even though it is Tier B.
The bug
A subject whose marks parts were never set has full marks 0. In NONE rounding every band's "at least min% of 0" held, so
subjectResultgave it A+ (5.0) and a pass; with ROUND_HALF_UP or CEIL it threw instead (a 500 on the preview and the publish check). NCTB classes 1–5, the coaching templates, and Aliya's Ibtedayi and Alim have no default parts.What it did on main. The new e2e test was run on main first, and every step below happened:
ROSTER_CHANGED), so the office saw "not locked" sheets with no reason given;The fix
INCOMPLETE(no letter or point, not passed). It counts like a missing subject: the student gets no GPA, pass, division or place.gradeForMarksnow refuses full marks 0 in every rounding mode.subjectsWithoutMarks, for subjects someone on the roster sits that have no parts. Publish refuses these first with 422SUBJECT_WITHOUT_MARKSand names the subjects. Saving or submitting a part-less sheet gets the same 422, so a sheet is never locked empty. Creating and opening an exam are unchanged.Decisions made alone (day run 30 Nov 2026), for the owner to confirm:
docs/decisions-pending.md→ "Exams: a subject without marks parts" (EX-1 to EX-7). Docs:docs/exams.md.Tests
exams.test.ts,exams-results.test.ts) and the API e2e testapps/api/test/exams-partless.e2e-spec.ts. On main, 7 unit tests and all 5 e2e tests failed.Tier
Tier B: exam logic only. It touches no auth, money, roles, RLS, CI or CLAUDE.md.
Review (day run 30 Nov 2026, on 1eba881): no must-fix, no should-fix
CHECK keep each part at 1 or more). Parts, absent students, both COMBINED papers, optional and
4th subjects, and every rounding mode are untouched. A part-less 4th subject makes the student
incomplete; on main its A+ added a GPA bonus.
gradeForMarksis reached by no caller now. On main,ROUND_HALF_UP and CEIL crashed the sheet preview and gave the tabulation a 500.
saved at all.
one unit test's
toThrow(RangeError)also passes on main for two rounding modes.stored A+. It can still send that in a result SMS until it is republished. Run the read-only
query in EX-6 and unpublish or republish what it finds. Alternatively, a follow-up could refuse
the SMS while a snapshot holds a subject with full marks 0.
Left as a draft for the owner: it changes exam behaviour that was not asked for.
🤖 Generated with Claude Code