Compare commits

..

No commits in common. "e8bf0b3f0a0aff77d85a92b648187fcafe0d8653" and "84fcee625d62dae5f0034eeb319faa13825c28f1" have entirely different histories.

2 changed files with 5 additions and 6 deletions

View File

@ -79,9 +79,9 @@ layout = html.Div(
dash_table.DataTable( dash_table.DataTable(
id="final_score_table", id="final_score_table",
columns=[ columns=[
{"id": "Eleve", "name": "Élève"}, {"id": "Élève", "name": "Élève"},
{"id": "Note", "name": "Note"}, {"id": "Note", "name": "Note"},
{"id": "Bareme", "name": "Barème"}, {"id": "Barème", "name": "Barème"},
], ],
data=[], data=[],
style_data_conditional=[ style_data_conditional=[
@ -217,7 +217,7 @@ def update_final_scores_descr(data):
scores = pd.DataFrame.from_records(data) scores = pd.DataFrame.from_records(data)
if scores.empty: if scores.empty:
return [[{}]] return [[{}]]
desc = scores["Note"].describe().T.round(2) desc = scores["Note"].describe().T
return [[desc.to_dict()]] return [[desc.to_dict()]]
@ -302,7 +302,7 @@ def update_competence_fig(data):
fig = go.Figure() fig = go.Figure()
bars = [ bars = [
{"score": -1, "name": "Pas de réponse", "color": COLORS["."]}, {"score": -1, "name": "Pas de réponse", "color": COLORS["."]},
{"score": 0, "name": "Faux", "color": COLORS[0]}, {"score": 0, "name": "Faut", "color": COLORS[0]},
{"score": 1, "name": "Peu juste", "color": COLORS[1]}, {"score": 1, "name": "Peu juste", "color": COLORS[1]},
{"score": 2, "name": "Presque juste", "color": COLORS[2]}, {"score": 2, "name": "Presque juste", "color": COLORS[2]},
{"score": 3, "name": "Juste", "color": COLORS[3]}, {"score": 3, "name": "Juste", "color": COLORS[3]},

View File

@ -49,8 +49,7 @@ def score_to_mark(x):
raise ValueError( raise ValueError(
f"The evaluation is out of range: {x[COLUMNS['score']]} at {x}" f"The evaluation is out of range: {x[COLUMNS['score']]} at {x}"
) )
return round(x[COLUMNS["score"]] * x[COLUMNS["score_rate"]] / 3, 2) return round_half_point(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"]]: if x[COLUMNS["score"]] > x[COLUMNS["score_rate"]]:
raise ValueError( raise ValueError(