mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-29479 Cosmetic rename of some methods in grading manager API
This commit is contained in:
parent
6c9e506ca5
commit
8a4acb3aca
2 changed files with 16 additions and 16 deletions
|
@ -155,8 +155,8 @@ if (!empty($add)) {
|
||||||
$areas = $gradingman->get_available_areas();
|
$areas = $gradingman->get_available_areas();
|
||||||
|
|
||||||
foreach ($areas as $areaname => $areatitle) {
|
foreach ($areas as $areaname => $areatitle) {
|
||||||
$gradingman->set_areaname($areaname);
|
$gradingman->set_area($areaname);
|
||||||
$method = $gradingman->get_active_area_method();
|
$method = $gradingman->get_active_method();
|
||||||
$data->_advancedgradingdata['areas'][$areaname] = array(
|
$data->_advancedgradingdata['areas'][$areaname] = array(
|
||||||
'title' => $areatitle,
|
'title' => $areatitle,
|
||||||
'method' => $method,
|
'method' => $method,
|
||||||
|
|
|
@ -31,10 +31,10 @@ defined('MOODLE_INTERNAL') || die();
|
||||||
*
|
*
|
||||||
* @param stdClass $context
|
* @param stdClass $context
|
||||||
* @param string $component the frankenstyle name of the component
|
* @param string $component the frankenstyle name of the component
|
||||||
* @param string $areaname the name of the gradable area
|
* @param string $area the name of the gradable area
|
||||||
* @return grading_manager
|
* @return grading_manager
|
||||||
*/
|
*/
|
||||||
function get_grading_manager($context = null, $component = null, $areaname = null) {
|
function get_grading_manager($context = null, $component = null, $area = null) {
|
||||||
|
|
||||||
$manager = new grading_manager();
|
$manager = new grading_manager();
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ function get_grading_manager($context = null, $component = null, $areaname = nul
|
||||||
$manager->set_component($component);
|
$manager->set_component($component);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_null($areaname)) {
|
if (!is_null($area)) {
|
||||||
$manager->set_areaname($areaname);
|
$manager->set_area($area);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $manager;
|
return $manager;
|
||||||
|
@ -58,8 +58,8 @@ function get_grading_manager($context = null, $component = null, $areaname = nul
|
||||||
*
|
*
|
||||||
* Fully initialized instance of the grading manager operates over a single
|
* Fully initialized instance of the grading manager operates over a single
|
||||||
* gradable area. It is possible to work with a partially initialized manager
|
* gradable area. It is possible to work with a partially initialized manager
|
||||||
* that knows just context and component without known areaname, for example.
|
* that knows just context and component without known area, for example.
|
||||||
* It is also possible to change context, component and areaname of an existing
|
* It is also possible to change context, component and area of an existing
|
||||||
* manager. Such pattern is used when copying form definitions, for example.
|
* manager. Such pattern is used when copying form definitions, for example.
|
||||||
*/
|
*/
|
||||||
class grading_manager {
|
class grading_manager {
|
||||||
|
@ -71,7 +71,7 @@ class grading_manager {
|
||||||
protected $component;
|
protected $component;
|
||||||
|
|
||||||
/** @var string the name of the gradable area */
|
/** @var string the name of the gradable area */
|
||||||
protected $areaname;
|
protected $area;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the context the manager operates on
|
* Sets the context the manager operates on
|
||||||
|
@ -92,12 +92,12 @@ class grading_manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the areaname the manager operates on
|
* Sets the area the manager operates on
|
||||||
*
|
*
|
||||||
* @param string $areaname the name of the gradable area
|
* @param string $area the name of the gradable area
|
||||||
*/
|
*/
|
||||||
public function set_areaname($areaname) {
|
public function set_area($area) {
|
||||||
$this->areaname = $areaname;
|
$this->area = $area;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -151,12 +151,12 @@ class grading_manager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the currently active grading method in the given gradable area
|
* Returns the currently active grading method in the gradable area
|
||||||
*
|
*
|
||||||
* @return string the name of the grading plugin
|
* @return string the name of the grading plugin
|
||||||
*/
|
*/
|
||||||
public function get_active_area_method() {
|
public function get_active_method() {
|
||||||
$this->ensure_isset(array('context', 'component', 'areaname'));
|
$this->ensure_isset(array('context', 'component', 'area'));
|
||||||
// todo - hardcoded value for now
|
// todo - hardcoded value for now
|
||||||
return 'rubric';
|
return 'rubric';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue