|
Moodle
2.2.1
http://www.collinsharper.com
|

Public Member Functions | |
| get_context () | |
| set_context (stdClass $context) | |
| get_component () | |
| set_component ($component) | |
| get_area () | |
| set_area ($area) | |
| get_component_title () | |
| get_area_title () | |
| load ($areaid) | |
| get_available_methods ($includenone=true) | |
| get_available_areas () | |
| get_active_method () | |
| set_active_method ($method) | |
| extend_settings_navigation (settings_navigation $settingsnav, navigation_node $modulenode=null) | |
| extend_navigation (global_navigation $navigation, navigation_node $modulenode=null) | |
| get_controller ($method) | |
| get_active_controller () | |
| get_management_url (moodle_url $returnurl=null) | |
| create_shared_area ($method) | |
Static Public Member Functions | |
| static | available_methods ($includenone=true) |
| static | available_areas ($component) |
| static | delete_all_for_context ($contextid) |
| static | tokenize ($needle) |
Protected Attributes | |
| $context | |
| $component | |
| $area | |
General class providing access to common grading features
Grading manager provides access to the particular grading method controller in that area.
Fully initialized instance of the grading manager operates over a single gradable area. It is possible to work with a partially initialized manager that knows just context and component without known area, for example. It is also possible to change context, component and area of an existing manager. Such pattern is used when copying form definitions, for example.
| static available_areas | ( | $ | component | ) | [static] |
Returns the list of gradable areas provided by the given component
This performs a callback to the library of the relevant plugin to obtain the list of supported areas.
| string | $component | normalized component name |
Definition at line 278 of file lib.php.


| static available_methods | ( | $ | includenone = true | ) | [static] |
Returns the list of installed grading plugins together, optionally extended with a simple direct grading.
| bool | $includenone | should the 'Simple direct grading' be included |
Definition at line 238 of file lib.php.


| create_shared_area | ( | $ | method | ) |
Creates a new shared area to hold a grading form template
Shared area are implemented as virtual gradable areas at the system level context with the component set to core_grading and unique random area name.
| string | $method | the name of the plugin we create the area for |
Definition at line 574 of file lib.php.

| static delete_all_for_context | ( | $ | contextid | ) | [static] |
Removes all data associated with the given context
This is called by context::delete_content()
| int | $contextid | context id |
Definition at line 595 of file lib.php.


| extend_navigation | ( | global_navigation $ | navigation, |
| navigation_node $ | modulenode = null |
||
| ) |
Extends the module navigation with the advanced grading information
This function is called when the context for the page is an activity module with the FEATURE_ADVANCED_GRADING.
| global_navigation | $navigation | |
| navigation_node | $modulenode |
Definition at line 466 of file lib.php.

| extend_settings_navigation | ( | settings_navigation $ | settingsnav, |
| navigation_node $ | modulenode = null |
||
| ) |
Extends the settings navigation with the grading settings
This function is called when the context for the page is an activity module with the FEATURE_ADVANCED_GRADING and the user has the permission moodle/grade:managegradingforms.
| settings_navigation | $settingsnav | settings_navigation |
| navigation_node | $modulenode | navigation_node |
Definition at line 417 of file lib.php.

| get_area | ( | ) |
| get_area_title | ( | ) |
Returns the list of gradable areas in the given context and component
This performs a callback to the library of the relevant plugin to obtain the list of supported areas.
Definition at line 302 of file lib.php.


| get_available_methods | ( | $ | includenone = true | ) |
Returns the list of available grading methods in the given context
Currently this is just a static list obtained from self::available_methods(). In the future, the list of available methods may be controlled per-context.
Requires the context property to be set in advance.
| bool | $includenone | should the 'Simple direct grading' be included |
Definition at line 264 of file lib.php.


| get_component | ( | ) |
Returns a text describing the context and the component
At the moment this works for gradable areas in course modules. In the future, this method should be improved so it works for other contexts (blocks, gradebook items etc) or subplugins.
Definition at line 164 of file lib.php.

| get_context | ( | ) |
| get_controller | ( | $ | method | ) |
| get_management_url | ( | moodle_url $ | returnurl = null | ) |
Returns the URL of the grading area management page
| moodle_url | $returnurl | optional URL of the page where the user should be sent back to |
Definition at line 545 of file lib.php.

| load | ( | $ | areaid | ) |
| set_active_method | ( | $ | method | ) |
| set_area | ( | $ | area | ) |
| set_component | ( | $ | component | ) |
| set_context | ( | stdClass $ | context | ) |
| static tokenize | ( | $ | needle | ) | [static] |
Helper method to tokenize the given string
Splits the given string into smaller strings. This is a helper method for full text searching in grading forms. If the given string is surrounded with double quotes, the resulting array consists of a single item containing the quoted content.
Otherwise, string like 'grammar, english language' would be tokenized into the three tokens 'grammar', 'english', 'language'.
One-letter tokens like are dropped in non-phrase mode. Repeated tokens are returned just once.
| string | $needle |
Definition at line 629 of file lib.php.
