From 76813726eb00b2398a618e45e6fb1fe66dc74e17 Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Fri, 24 Mar 2017 10:24:33 +0300 Subject: [PATCH] dd checks in note_to_mark --- notes_tools/tools/df_marks_manip.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/notes_tools/tools/df_marks_manip.py b/notes_tools/tools/df_marks_manip.py index 7dac37c..b231370 100644 --- a/notes_tools/tools/df_marks_manip.py +++ b/notes_tools/tools/df_marks_manip.py @@ -83,6 +83,8 @@ def note_to_mark(x): if x["Niveau"]: if x["Note"] == NOANSWER: return 0 + if x["Note"] not in [0, 1, 2, 3]: + raise ValueError(f"The evaluation is out of range: {x['Note']} at {x}") return x["Note"] * x["Bareme"] / 3 if x["Note"] > x["Bareme"]: @@ -481,7 +483,7 @@ def digest_flat_df(flat_df): df["Level"] = compute_level(df) df["Latex_rep"] = compute_latex_rep(df) df["Normalized"] = compute_normalized(df) - df["Uniq_quest"] = compute_question_description(df) + #df["Uniq_quest"] = compute_question_description(df) exo_df = compute_exo_marks(df) exo_df["Normalized"] = compute_normalized(exo_df)