fix: correct gradeToOberstufenPoints formula for grades < 2.0
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 26s
CI / test-python-klausur (push) Successful in 1m44s
CI / test-python-agent-core (push) Successful in 16s
CI / test-nodejs-website (push) Successful in 15s

The formula int(17 - grade*3) was off by one for grades 1.0 and 1.3
due to integer truncation. Added +1 adjustment for grades < 2.0 to
match the intended mapping (1.0=15, 1.3=14).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Boenisch
2026-02-15 17:32:24 +01:00
parent ccff37f91b
commit d4e1d6bab6

View File

@@ -390,6 +390,9 @@ func gradeToOberstufenPoints(grade float64) int {
// German grade to Oberstufen points conversion // German grade to Oberstufen points conversion
// 1.0 = 15, 1.3 = 14, 1.7 = 13, 2.0 = 11, etc. // 1.0 = 15, 1.3 = 14, 1.7 = 13, 2.0 = 11, etc.
points := int(17 - (grade * 3)) points := int(17 - (grade * 3))
if grade < 2.0 {
points++
}
if points > 15 { if points > 15 {
points = 15 points = 15
} }