Inspiration
Before a final, students want one number: the score needed to reach a target course grade. Two mistakes distort it: counting ungraded work as zero, and confusing the average of graded work with the course grade. Final Line is for students in courses with weighted grade categories.
What it does
Enter each category's weight, how much of it is graded, your score, and a target. Final Line returns the minimum final-exam score, rounded up to 0.01 so it still reaches the target, and explains the outcome: achievable, already secured, impossible, not yet determined, or fixed when the final weighs 0%.
Blank scores are unknown, never zero. For partly graded work, you can enter an expected score; otherwise the app shows a range. Weights must total exactly 100%. A what-if table, slider and chart cover other final scores; every formula is shown with your numbers. It opens in Simplified Chinese, with English available; two fictional, labeled samples let you check the math.
Everything runs in the browser: grades are not sent to a server or AI service, and there are no analytics. An optional save uses this browser's local storage; reset clears it. Results export as text or JSON.
How it was built
A static Next.js site in TypeScript and React, with Tailwind CSS and shadcn/ui components on Base UI. Grade logic is kept in a pure module. The test suite contains 38 Vitest unit tests and 8 Playwright tests for the built site. Repository history records the calculator and tests on November 8, 2026, during the event. The standard Next.js scaffold and third-party libraries are pre-existing components.
Challenges and lessons
The hard part was definitions, not arithmetic. Blank had to stay distinct from zero, the running average from the course grade, and the required score must round up, so 86.67 meets a target that 86.66 misses.
Limitations
Scores are 0–100 percentages, with one final category. Curves, dropped scores, extra credit and replacement rules aren't applied unless already in your numbers. Letter grades aren't mapped. Saves don't sync across devices. It is not an official gradebook.
What's next
Not yet built: dropped scores, extra credit, letter-grade targets and raw-point entry.
AI assistance
A Cursor cloud coding agent implemented the app and its tests and drafted the original project text. Grok Bot coordinated that work. Claude reviewed this description. Hao selected the course-grade-calculator direction, approved requirements and submission. The running app uses no AI; results come from deterministic formulas.
License and credits
Source code is MIT-licensed. Dependencies keep their own licenses, including Next.js, React, Tailwind CSS, Base UI and shadcn/ui (MIT); class-variance-authority, TypeScript and Playwright (Apache-2.0).
Built With
- base-ui
- class-variance-authority
- eslint
- next.js
- node.js
- playwright
- react
- shadcn/ui
- tailwind
- typescript
- vitest