From 74d751a58645ef9d0bed623ad1ad8df166c79c40 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 23 Feb 2021 17:06:55 +0100 Subject: [PATCH] Feat: update student list --- recopytex/dashboard/student_analysis/app.py | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/recopytex/dashboard/student_analysis/app.py b/recopytex/dashboard/student_analysis/app.py index 50880d9..205f1af 100644 --- a/recopytex/dashboard/student_analysis/app.py +++ b/recopytex/dashboard/student_analysis/app.py @@ -120,4 +120,33 @@ layout = html.Div( ] ) +@app.callback( + [ + dash.dependencies.Output("student", "options"), + dash.dependencies.Output("student", "value"), + ], + [ + dash.dependencies.Input("tribe", "value") + ],) +def update_students_list(tribe): + tribe_config = [t for t in config["tribes"] if t["name"] == tribe][0] + students = get_students(tribe_config["students"]) + options=[ + {"label": t["Nom"], "value": t["Nom"]} + for t in students + ] + value=students[0]["Nom"] + return options, value +# @app.callback( +# [ +# dash.dependencies.Output("student-scores", "data"), +# ], +# [ +# dash.dependencies.Input("tribe", "value"), +# dash.dependencies.Input("student", "value"), +# dash.dependencies.Input("term", "value"), +# ], +# ) +# def update_student_scores(tribe, student, term): +# return []