diff --git a/recopytex/dashboard/create_exam/app.py b/recopytex/dashboard/create_exam/app.py index 1e2d146..8bbdb8e 100644 --- a/recopytex/dashboard/create_exam/app.py +++ b/recopytex/dashboard/create_exam/app.py @@ -135,7 +135,19 @@ def add_exercise(n_clicks, children): if n_clicks is None: return children element_table = pd.DataFrame(columns=[c["id"] for c in QUESTION_COLUMNS]) - element_table = element_table.append(pd.Series(name=0)) + element_table = element_table.append( + pd.Series( + data={ + "id": 1, + "competence": "Rechercher", + "theme": "", + "comment": "", + "score_rate": 1, + "is_leveled": 1, + }, + name=0, + ) + ) new_exercise = html.Div( children=[ html.Div( @@ -162,7 +174,7 @@ def add_exercise(n_clicks, children): editable=True, row_deletable=True, dropdown={ - "Competence": { + "competence": { "options": [ {"label": i, "value": i} for i in config["competences"] ] @@ -205,7 +217,19 @@ def add_element(n_clicks, elements): return elements df = pd.DataFrame.from_records(elements) - df = df.append(pd.Series(name=n_clicks)) + df = df.append( + pd.Series( + data={ + "id": len(df) + 1, + "competence": "", + "theme": "", + "comment": "", + "score_rate": 1, + "is_leveled": 1, + }, + name=n_clicks, + ) + ) return df.to_dict("records")