From c057fa11e7e9544ee0f029fe0e3e45c4dde99beb Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 18 Jan 2021 10:30:50 +0100 Subject: [PATCH 1/2] Feat: stop rounding score at 0.5 --- recopytex/df_marks_manip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recopytex/df_marks_manip.py b/recopytex/df_marks_manip.py index ed194fa..584882b 100644 --- a/recopytex/df_marks_manip.py +++ b/recopytex/df_marks_manip.py @@ -49,7 +49,8 @@ def score_to_mark(x): raise ValueError( f"The evaluation is out of range: {x[COLUMNS['score']]} at {x}" ) - return round_half_point(x[COLUMNS["score"]] * x[COLUMNS["score_rate"]] / 3) + return round(x[COLUMNS["score"]] * x[COLUMNS["score_rate"]] / 3, 2) + #return round_half_point(x[COLUMNS["score"]] * x[COLUMNS["score_rate"]] / 3) if x[COLUMNS["score"]] > x[COLUMNS["score_rate"]]: raise ValueError( From e8bf0b3f0a0aff77d85a92b648187fcafe0d8653 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Mon, 18 Jan 2021 10:31:09 +0100 Subject: [PATCH 2/2] Fix: name and bareme in final_score_table and describe rounding --- recopytex/dashboard/exam_analysis/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recopytex/dashboard/exam_analysis/app.py b/recopytex/dashboard/exam_analysis/app.py index 75e0043..447191c 100644 --- a/recopytex/dashboard/exam_analysis/app.py +++ b/recopytex/dashboard/exam_analysis/app.py @@ -79,9 +79,9 @@ layout = html.Div( dash_table.DataTable( id="final_score_table", columns=[ - {"id": "Élève", "name": "Élève"}, + {"id": "Eleve", "name": "Élève"}, {"id": "Note", "name": "Note"}, - {"id": "Barème", "name": "Barème"}, + {"id": "Bareme", "name": "Barème"}, ], data=[], style_data_conditional=[ @@ -217,7 +217,7 @@ def update_final_scores_descr(data): scores = pd.DataFrame.from_records(data) if scores.empty: return [[{}]] - desc = scores["Note"].describe().T + desc = scores["Note"].describe().T.round(2) return [[desc.to_dict()]] @@ -302,7 +302,7 @@ def update_competence_fig(data): fig = go.Figure() bars = [ {"score": -1, "name": "Pas de réponse", "color": COLORS["."]}, - {"score": 0, "name": "Faut", "color": COLORS[0]}, + {"score": 0, "name": "Faux", "color": COLORS[0]}, {"score": 1, "name": "Peu juste", "color": COLORS[1]}, {"score": 2, "name": "Presque juste", "color": COLORS[2]}, {"score": 3, "name": "Juste", "color": COLORS[3]},