mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-12-20 23:41:20 +00:00
Parse mark selection
This commit is contained in:
parent
eb09b793c6
commit
89a0d295fe
1 changed files with 17 additions and 4 deletions
|
@ -20,6 +20,7 @@ from .model_dependent_funs import (
|
||||||
generate_new_password_field,
|
generate_new_password_field,
|
||||||
initActiveSemesterMenuLinks,
|
initActiveSemesterMenuLinks,
|
||||||
mark_field,
|
mark_field,
|
||||||
|
parse_selection_mark_field,
|
||||||
user_info_fields,
|
user_info_fields,
|
||||||
)
|
)
|
||||||
from .model_independent_funs import randomPassword, reportBadAttempt
|
from .model_independent_funs import randomPassword, reportBadAttempt
|
||||||
|
@ -101,13 +102,25 @@ class AssistantGroupExperimentView(SecureAssistantModelView):
|
||||||
]
|
]
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
|
try:
|
||||||
for ind, appointment in enumerate(appointments):
|
for ind, appointment in enumerate(appointments):
|
||||||
appointment.date = appointment_fields[ind].data
|
appointment.date = appointment_fields[ind].data
|
||||||
|
|
||||||
|
for ind, experiment_mark in enumerate(experiment_marks):
|
||||||
|
experiment_mark.oral_mark = parse_selection_mark_field(oral_experiment_mark_fields[ind])
|
||||||
|
experiment_mark.protocol_mark = parse_selection_mark_field(protocol_experiment_mark_fields[ind])
|
||||||
|
|
||||||
group_experiment.note = form.note.data
|
group_experiment.note = form.note.data
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
red = url_for("index") + "assistant/group_experiment"
|
||||||
|
return redirect(red)
|
||||||
|
except Exception as ex:
|
||||||
|
flash(str(ex), "error")
|
||||||
|
|
||||||
|
db.session.rollback()
|
||||||
|
|
||||||
return self.render(
|
return self.render(
|
||||||
"assistant_group_experiment_form.html",
|
"assistant_group_experiment_form.html",
|
||||||
form=form,
|
form=form,
|
||||||
|
|
Loading…
Reference in a new issue