dd checks in note_to_mark

This commit is contained in:
Benjamin Bertrand 2017-03-24 10:24:33 +03:00
parent 29a5f6a503
commit 76813726eb

View File

@ -83,6 +83,8 @@ def note_to_mark(x):
if x["Niveau"]: if x["Niveau"]:
if x["Note"] == NOANSWER: if x["Note"] == NOANSWER:
return 0 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 return x["Note"] * x["Bareme"] / 3
if x["Note"] > x["Bareme"]: if x["Note"] > x["Bareme"]:
@ -481,7 +483,7 @@ def digest_flat_df(flat_df):
df["Level"] = compute_level(df) df["Level"] = compute_level(df)
df["Latex_rep"] = compute_latex_rep(df) df["Latex_rep"] = compute_latex_rep(df)
df["Normalized"] = compute_normalized(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 = compute_exo_marks(df)
exo_df["Normalized"] = compute_normalized(exo_df) exo_df["Normalized"] = compute_normalized(exo_df)