--- type: object cluster: gradebook universe: live status: verified entity: app/models/grade_entry.rb --- # GradeEntry One student's row in one [grade-book](grade-book.md): two letter grades, attendance days, a perfect-attendance flag. **This is where every payout amount is defined.** Verified 2026-08-16 against commit `63732df`. ## Why this shape The payout table is five Ruby constants on this model, all in **cents** (`app/models/grade_entry.rb:9-13`): | Constant | Value | Meaning | |---|---|---| | `EARNINGS_PER_DAY_ATTENDANCE` | `20` | $0.20 per day present | | `EARNINGS_FOR_A_GRADE` | `3_00` | $3.00 for any A | | `EARNINGS_FOR_B_GRADE` | `2_00` | $2.00 for any B | | `EARNINGS_FOR_IMPROVED_GRADE` | `2_00` | $2.00 for improving | | `EARNINGS_FOR_PERFECT_ATTENDANCE` | `1_00` | $1.00 bonus | They are not configuration. Changing what a student earns is a code change and a deploy — there is no admin screen and no database row for these. **`GRADE_OPTIONS` is ordered best-to-worst on purpose** (`:15`). `improved_grade?` compares array *indices*, treating a lower index as better (`:64-67`). Reordering or inserting into that array silently changes every improvement bonus in the app. **There are no validations on this model at all** — grades are constrained only by the `