From a14d47b15ce02b015aa6450f75c3c2b18b06421f Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 15 Jan 2021 17:49:30 +0100 Subject: [PATCH] Feat: Clean empty fig --- recopytex/dashboard/exam.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/recopytex/dashboard/exam.py b/recopytex/dashboard/exam.py index 5c3026c..2a9c3f4 100644 --- a/recopytex/dashboard/exam.py +++ b/recopytex/dashboard/exam.py @@ -42,7 +42,7 @@ app.layout = html.Div( color="success", dark=True, ), - html.Br(), + html.H2("Choix de l'évaluation"), dbc.Row( [ dbc.Col( @@ -66,16 +66,16 @@ app.layout = html.Div( ), ], ), - html.Br(), + html.H2("Résultats"), dbc.Row( [ dbc.Col( 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=[ @@ -118,8 +118,8 @@ app.layout = html.Div( ), ], ), - html.Br(), - html.Div( + html.H2("Édition des notes"), + dbc.Row( [ dash_table.DataTable( id="scores_table", @@ -134,6 +134,7 @@ app.layout = html.Div( dbc.Button("Ajouter un élément", id="btn_add_element"), ] ), + html.H2("Actions"), dcc.Store(id="final_score"), ] ) @@ -219,7 +220,7 @@ def update_final_scores_hist(data): assessment_scores = pd.DataFrame.from_records(data) if assessment_scores.empty: - return [{}] + return [{'data': [], 'layout':[]}] ranges = np.linspace( 0, assessment_scores.Bareme.max(), int(assessment_scores.Bareme.max() * 2 + 1) @@ -264,7 +265,7 @@ def update_competence_fig(data): scores = flat_df_students(scores).dropna(subset=["Score"]) if scores.empty: - return [{}] + return [{'data': [], 'layout':[]}] scores = pp_q_scores(scores) pt = pd.pivot_table(