From 1855d4016d0c9f320e1627610581e5fdf21ea612 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 23 Feb 2021 16:53:59 +0100 Subject: [PATCH] Feat: start student_analysis --- .../dashboard/student_analysis/__init__.py | 0 recopytex/dashboard/student_analysis/app.py | 123 ++++++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 recopytex/dashboard/student_analysis/__init__.py create mode 100644 recopytex/dashboard/student_analysis/app.py diff --git a/recopytex/dashboard/student_analysis/__init__.py b/recopytex/dashboard/student_analysis/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/recopytex/dashboard/student_analysis/app.py b/recopytex/dashboard/student_analysis/app.py new file mode 100644 index 0000000..50880d9 --- /dev/null +++ b/recopytex/dashboard/student_analysis/app.py @@ -0,0 +1,123 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import dash +import dash_html_components as html +import dash_core_components as dcc +import dash_table +import plotly.graph_objects as go +from datetime import date, datetime +import uuid +import pandas as pd +import yaml + +from ...scripts.getconfig import config +from ...config import NO_ST_COLUMNS +from ..app import app +from ...scripts.exam import Exam + +def get_students(csv): + return list(pd.read_csv(csv).T.to_dict().values()) + + +QUESTION_COLUMNS = [ + {"id": "id", "name": "Question"}, + { + "id": "competence", + "name": "Competence", + "presentation": "dropdown", + }, + {"id": "theme", "name": "Domaine"}, + {"id": "comment", "name": "Commentaire"}, + {"id": "score_rate", "name": "Bareme"}, + {"id": "is_leveled", "name": "Est_nivele"}, +] + +layout = html.Div( + [ + html.Header( + children=[ + html.H1("Bilan des élèves"), + ], + ), + html.Main( + children=[ + html.Section( + children=[ + html.Form( + id="select-student", + children=[ + html.Label( + children=[ + "Classe", + dcc.Dropdown( + id="tribe", + options=[ + {"label": t["name"], "value": t["name"]} + for t in config["tribes"] + ], + value=config["tribes"][0]["name"], + ), + ] + ), + html.Label( + children=[ + "Élève", + dcc.Dropdown( + id="student", + options=[ + {"label": t["Nom"], "value": t["Nom"]} + for t in get_students(config["tribes"][0]["students"]) + ], + value=get_students(config["tribes"][0]["students"])[0]["Nom"], + ), + ] + ), + html.Label( + children=[ + "Trimestre", + dcc.Dropdown( + id="term", + options=[ + {"label": i + 1, "value": i + 1} + for i in range(3) + ], + value=1, + ), + ] + ), + ], + ), + ], + id="form", + ), + html.Section( + children=[ + html.H2("Évaluations"), + html.Div( + id="describe", + ), + html.Div( + id="eval-table", + ), + ], + id="Évaluations", + ), + html.Section( + children=[ + html.Div( + id="competences-viz", + ), + html.Div( + id="themes-viz", + ), + ], + id="visualisation", + ), + ] + ), + dcc.Store(id="student-scores"), + ] +) + +