From f1a2464a8ff9f6eab38bbdebd46c55277b6f0c35 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 21 Aug 2019 07:36:58 +0200 Subject: [PATCH] Feat: round to half point when computing score --- recopytex/df_marks_manip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recopytex/df_marks_manip.py b/recopytex/df_marks_manip.py index cb57944..8d1e570 100644 --- a/recopytex/df_marks_manip.py +++ b/recopytex/df_marks_manip.py @@ -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(