Fix: name and bareme in final_score_table and describe rounding

This commit is contained in:
Bertrand Benjamin 2021-01-18 10:31:09 +01:00
parent c057fa11e7
commit e8bf0b3f0a

View File

@ -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]},