require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->dirroot.'/grade/grading/lib.php');
-$areaid = optional_param('areaid', null, PARAM_INT);
-$contextid = optional_param('contextid', null, PARAM_INT);
-$component = optional_param('component', null, PARAM_COMPONENT);
-$area = optional_param('area', null, PARAM_AREA);
-$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
-$activemethod = optional_param('activemethod', null, PARAM_PLUGIN);
+$areaid = optional_param('areaid', null, PARAM_INT);
+$contextid = optional_param('contextid', null, PARAM_INT);
+$component = optional_param('component', null, PARAM_COMPONENT);
+$area = optional_param('area', null, PARAM_AREA);
+$returnurl = optional_param('returnurl', null, PARAM_LOCALURL);
+$setmethod = optional_param('setmethod', null, PARAM_PLUGIN);
if (!is_null($areaid)) {
// get manager by id
$output = $PAGE->get_renderer('core_grading');
// process the eventual change of the active grading method
-if (!empty($activemethod)) {
+if (!empty($setmethod)) {
require_sesskey();
- if ($activemethod == 'none') {
+ if ($setmethod == 'none') {
// here we expect that noone would actually want to call their plugin as 'none'
- $activemethod = null;
+ $setmethod = null;
}
- $manager->set_active_method($activemethod);
+ $manager->set_active_method($setmethod);
redirect($PAGE->url);
}
$methods = $manager->get_available_methods(false);
$methods['none'] = get_string('gradingmethodnone', 'core_grading');
$selector = new single_select(new moodle_url($targeturl, array('sesskey' => sesskey())),
- 'activemethod', $methods, empty($method) ? 'none' : $method, null, 'activemethodselector');
+ 'setmethod', $methods, empty($method) ? 'none' : $method, null, 'activemethodselector');
$selector->set_label(get_string('changeactivemethod', 'core_grading'));
$selector->set_help_icon('gradingmethod', 'core_grading');