Permalink
Browse files

Merge pull request #16 from marinaglancy/wip-MDL-29483-rubric

MDL-29483: advanced grading methods support on assignment module, grading
  • Loading branch information...
2 parents 671ec8f + fc05f22 commit d1bc8178326625d51fcd5d05559c3ed5a3877630 @mudrd8mz mudrd8mz committed Oct 24, 2011
Oops, something went wrong.
@@ -46,16 +46,18 @@
$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());
+$mform = new gradingform_rubric_editrubric(null, array('areaid' => $areaid, 'context' => $context, 'freezerubric' => optional_param('freeze', 0, PARAM_INT)));
+$data = $controller->get_definition_for_editing();
+$returnurl = optional_param('returnurl', $manager->get_management_url(), PARAM_LOCALURL);
+$data->returnurl = $returnurl;
+$mform->set_data($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);
+ redirect($returnurl);
+} else if ($mform->is_submitted() && $mform->is_validated()) {
+ $data = $mform->get_data();
$controller->update_definition($data);
- redirect($PAGE->url);
+ redirect($returnurl);
}
echo $OUTPUT->header();
@@ -44,13 +44,15 @@ public function definition() {
$form->addElement('hidden', 'areaid');
$form->setType('areaid', PARAM_INT);
+ $form->addElement('hidden', 'returnurl');
+
// name
$form->addElement('text', 'name', get_string('name', 'gradingform_rubric'), array('size'=>52));
$form->addRule('name', get_string('required'), 'required');
$form->setType('name', PARAM_TEXT);
// description
- $options = array();
+ $options = gradingform_rubric_controller::description_form_field_options($this->_customdata['context']);
$form->addElement('editor', 'description_editor', get_string('description', 'gradingform_rubric'), null, $options);
$form->setType('description_editor', PARAM_RAW);
@@ -83,6 +83,7 @@ M.gradingform_rubriceditor.editmode = function(el, editmode) {
}
ta.get('parentNode').one('.plainvalue').setStyle('display', 'none')
ta.setStyle('display', 'block').setStyle('width', width).setStyle('height', height)
+ ta.focus()
}
}
Oops, something went wrong.

0 comments on commit d1bc817

Please sign in to comment.