Feat: round to half point when computing score

This commit is contained in:
Bertrand Benjamin 2019-08-21 07:36:58 +02:00
parent 7bb224a48f
commit f1a2464a8f
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ def score_to_mark(x):
if x[COLUMNS["is_leveled"]]:
if x[COLUMNS["score"]] not in [0, 1, 2, 3]:
raise ValueError(f"The evaluation is out of range: {x[COLUMNS['score']]} at {x}")
return x[COLUMNS["score"]] * x[COLUMNS["score_rate"]] / 3
return round_half_point(x[COLUMNS["score"]] * x[COLUMNS["score_rate"]] / 3)
if x[COLUMNS["score"]] > x[COLUMNS["score_rate"]]:
raise ValueError(