mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-29479 List of available grading methods returned properly
This commit is contained in:
parent
f59f488a36
commit
6c9e506ca5
1 changed files with 14 additions and 6 deletions
|
@ -108,17 +108,25 @@ class grading_manager {
|
||||||
* controlled per-context.
|
* controlled per-context.
|
||||||
*
|
*
|
||||||
* Requires the context property to be set in advance.
|
* Requires the context property to be set in advance.
|
||||||
|
*
|
||||||
|
* @param bool $includenone should the 'Simple direct grading' be included
|
||||||
* @return array of the (string)name => (string)localized title of the method
|
* @return array of the (string)name => (string)localized title of the method
|
||||||
*/
|
*/
|
||||||
public function get_available_methods() {
|
public function get_available_methods($includenone = true) {
|
||||||
|
|
||||||
$this->ensure_isset(array('context'));
|
$this->ensure_isset(array('context'));
|
||||||
|
|
||||||
// todo - hardcoded list for now, should read the list of installed grading plugins
|
if ($includenone) {
|
||||||
return array(
|
$list = array('' => get_string('gradingmethodnone', 'core_grading'));
|
||||||
'' => get_string('gradingmethodnone', 'core_grading'),
|
} else {
|
||||||
'rubric' => 'Rubric',
|
$list = array();
|
||||||
);
|
}
|
||||||
|
|
||||||
|
foreach (get_plugin_list('gradingform') as $name => $location) {
|
||||||
|
$list[$name] = get_string('pluginname', 'gradingform_'.$name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue