Fixed form cancellation handling

Previously, a cancelled form was processed as if all rubric definition
was removed.
This commit is contained in:
David Mudrak 2011-10-18 16:26:06 +02:00
parent 98a73bb7ac
commit a990240b31

View File

@ -48,8 +48,11 @@ $PAGE->requires->js('/grade/grading/form/rubric/js/rubriceditor.js');
//TODO freeze rubric editor if needed
$mform = new gradingform_rubric_editrubric(null, array('areaid' => $areaid, 'freezerubric' => optional_param('freeze', 0, PARAM_INT)));
$mform->set_data($controller->get_definition_for_editing());
if ($mform->is_submitted() && $mform->is_validated()) {
$data = $mform->get_data();
if ($mform->is_cancelled()) {
// todo process editing cancel in a better way
redirect($manager->get_management_url());
} else if ($data = $mform->get_data()) {
$data = $controller->postupdate_definition_data($data);
$controller->update_definition($data);
redirect($PAGE->url);