Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Bertrand Benjamin 2021-01-21 09:57:33 +01:00
commit 412e624791
2 changed files with 4 additions and 3 deletions

View File

@ -204,7 +204,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()]]
@ -289,7 +289,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]},

View File

@ -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(