Compare commits

..

No commits in common. "3250a600c92ce46a5d75e7d74f669d01e223f572" and "1fe76657534e9ba13e8da5be5abaf316e626524b" have entirely different histories.

3 changed files with 6 additions and 62 deletions

View File

@ -19,8 +19,6 @@ main {
margin: auto; margin: auto;
} }
/* Exam analysis */
#select { #select {
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -41,20 +39,3 @@ main {
width: 45vw; width: 45vw;
margin: auto; margin: auto;
} }
/* Create new exam */
#new-exam {
display: flex;
flex-flow: row;
justify-content: space-between;
}
#new-exam label {
width: 20%;
display: flex;
flex-flow: column;
justify-content: space-between;
}

View File

@ -135,19 +135,7 @@ def add_exercise(n_clicks, children):
if n_clicks is None: if n_clicks is None:
return children return children
element_table = pd.DataFrame(columns=[c["id"] for c in QUESTION_COLUMNS]) element_table = pd.DataFrame(columns=[c["id"] for c in QUESTION_COLUMNS])
element_table = element_table.append( element_table = element_table.append(pd.Series(name=0))
pd.Series(
data={
"id": 1,
"competence": "Rechercher",
"theme": "",
"comment": "",
"score_rate": 1,
"is_leveled": 1,
},
name=0,
)
)
new_exercise = html.Div( new_exercise = html.Div(
children=[ children=[
html.Div( html.Div(
@ -174,7 +162,7 @@ def add_exercise(n_clicks, children):
editable=True, editable=True,
row_deletable=True, row_deletable=True,
dropdown={ dropdown={
"competence": { "Competence": {
"options": [ "options": [
{"label": i, "value": i} for i in config["competences"] {"label": i, "value": i} for i in config["competences"]
] ]
@ -217,19 +205,7 @@ def add_element(n_clicks, elements):
return elements return elements
df = pd.DataFrame.from_records(elements) df = pd.DataFrame.from_records(elements)
df = df.append( df = df.append(pd.Series(name=n_clicks))
pd.Series(
data={
"id": len(df) + 1,
"competence": "",
"theme": "",
"comment": "",
"score_rate": 1,
"is_leveled": 1,
},
name=n_clicks,
)
)
return df.to_dict("records") return df.to_dict("records")
@ -276,6 +252,7 @@ def store_exam(tribe, exam_name, date, term, exercices, elements, elements_id):
ex_elements = elements[index] ex_elements = elements[index]
exam.add_exercise(name, ex_elements) exam.add_exercise(name, ex_elements)
print(yaml.dump(exam.to_dict()))
return exam.to_dict() return exam.to_dict()

View File

@ -127,22 +127,12 @@ layout = html.Div(
dash_table.DataTable( dash_table.DataTable(
id="scores_table", id="scores_table",
columns=[ columns=[
{"id": "id", "name": "Question"}, {"id": c, "name": c} for c in NO_ST_COLUMNS.values()
{
"id": "competence",
"name": "Competence",
},
{"id": "theme", "name": "Domaine"},
{"id": "comment", "name": "Commentaire"},
{"id": "score_rate", "name": "Bareme"},
{"id": "is_leveled", "name": "Est_nivele"},
], ],
style_cell={ style_cell={
"whiteSpace": "normal", "whiteSpace": "normal",
"height": "auto", "height": "auto",
}, },
fixed_columns={"headers": True, "data": 7},
style_table={"minWidth": "100%"},
style_data_conditional=[], style_data_conditional=[],
editable=True, editable=True,
), ),
@ -389,11 +379,7 @@ def update_scores_table(csv, add_element, data):
) )
stack = stack.append(infos) stack = stack.append(infos)
return ( return (
[ [{"id": c, "name": c} for c in stack.columns],
{"id": c, "name": c}
for c in stack.columns
if c not in ["Trimestre", "Nom", "Date"]
],
stack.to_dict("records"), stack.to_dict("records"),
highlight_value(stack), highlight_value(stack),
) )