recopytex/recopytex/dashboard/pages/exams_scores/app.py

113 lines
4.2 KiB
Python
Raw Normal View History

2021-04-18 08:02:10 +00:00
#!/usr/bin/env python
# encoding: utf-8
import dash_html_components as html
import dash_core_components as dcc
from .models import get_tribes, get_exams
from .callbacks import *
layout = html.Div(
2021-04-20 16:30:12 +00:00
children=[
html.Header(
children=[
html.H1("Analyse des notes"),
html.P("Dernière sauvegarde", id="lastsave"),
],
),
html.Main(
children=[
html.Section(
children=[
html.Div(
children=[
"Classe: ",
dcc.Dropdown(
id="tribe",
options=[
{"label": t["name"], "value": t["name"]}
for t in get_tribes().values()
2021-04-18 14:44:40 +00:00
],
2021-04-20 16:30:12 +00:00
value=next(iter(get_tribes().values()))["name"],
2021-04-18 14:44:40 +00:00
),
],
),
2021-04-20 16:30:12 +00:00
html.Div(
children=[
"Evaluation: ",
dcc.Dropdown(id="exam_select"),
2021-04-18 14:44:40 +00:00
],
),
2021-04-20 16:30:12 +00:00
],
id="selects",
),
html.Section(
children=[
html.Div(
children=[
dash_table.DataTable(
id="final_score_table",
columns=[
{"name": "Étudiant", "id": "student_name"},
{"name": "Note", "id": "mark"},
{"name": "Barème", "id": "score_rate"},
],
2021-04-18 14:44:40 +00:00
)
],
2021-04-20 16:30:12 +00:00
id="final_score_table_container",
2021-04-20 17:04:06 +00:00
),
html.Div(
children=[
dash_table.DataTable(
id="score_statistics_table",
columns=[],
)
],
id="score_statistics_table_container",
2021-04-20 17:13:14 +00:00
),
html.Div(
children=[
dcc.Graph(
id="fig_exam_histo",
config={"displayModeBar": False},
2021-04-20 17:13:14 +00:00
)
],
id="fig_exam_histo_container",
2021-04-21 05:03:45 +00:00
),
html.Div(
children=[
dcc.Graph(
id="fig_questions_bar",
config={"displayModeBar": False},
2021-04-21 05:03:45 +00:00
)
],
id="fig_questions_bar_container",
2021-04-18 14:44:40 +00:00
),
],
2021-04-20 16:30:12 +00:00
id="analysis",
),
html.Section(
children=[
dash_table.DataTable(
id="scores_table",
columns=[],
style_data_conditional=[],
fixed_columns={},
editable=True,
2021-04-20 16:48:52 +00:00
style_table={"minWidth": "100%"},
style_cell={
"minWidth": "100px",
"width": "100px",
"maxWidth": "100px",
"overflow": "hidden",
"textOverflow": "ellipsis",
},
2021-04-20 16:30:12 +00:00
)
],
id="edit",
2021-04-18 08:50:26 +00:00
),
],
2021-04-20 16:30:12 +00:00
),
dcc.Store(id="scores"),
],
)