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

Grading method controller represents a plugin used in a particular area
| __construct | ( | stdClass $ | context, |
| $ | component, | ||
| $ | area, | ||
| $ | areaid | ||
| ) |
Do not instantinate this directly, use grading_manager::get_controller()
| stdClass | $context | the context of the form |
| string | $component | the frankenstyle name of the component |
| string | $area | the name of the gradable area |
| int | $areaid | the id of the gradable area record |
Definition at line 70 of file lib.php.

| create_instance | ( | $ | raterid, |
| $ | itemid = null |
||
| ) |
This function is invoked when user (teacher) starts grading. It creates and returns copy of the current ACTIVE instance if it exists. If this is the first grading attempt, a new instance is created. The status of the returned instance is INCOMPLETE
| int | $raterid | |
| int | $itemid |
Deletes the form definition and all the associated data
| delete_plugin_definition | ( | ) | [abstract, protected] |
Deletes all plugin data associated with the given form definiton
Reimplemented in gradingform_rubric_controller.
| extend_navigation | ( | global_navigation $ | navigation, |
| navigation_node $ | node = null |
||
| ) |
Extends the module navigation
This function is called when the context for the page is an activity module with the FEATURE_ADVANCED_GRADING and there is an area with the active grading method set to the given plugin.
| global_navigation | $navigation | global_navigation |
| navigation_node | $node | navigation_node |
Reimplemented in gradingform_rubric_controller.
| extend_settings_navigation | ( | settings_navigation $ | settingsnav, |
| navigation_node $ | node = null |
||
| ) |
Extends the module settings navigation
This function is called when the context for the page is an activity module with the FEATURE_ADVANCED_GRADING, the user has the permission moodle/grade:managegradingforms and there is an area with the active grading method set to the given plugin.
| settings_navigation | $settingsnav | settings_navigation |
| navigation_node | $node | navigation_node |
Reimplemented in gradingform_rubric_controller.
Returns a message why this form is unavailable. Maybe overriden by plugins to give more details.
Definition at line 167 of file lib.php.

| get_active_instances | ( | $ | itemid | ) |
Returns list of ACTIVE instances for the specified $itemid (intentionally does not return instances with status NEEDUPDATE)
| int | $itemid |
| get_areaid | ( | ) |
| get_component | ( | ) |
| get_context | ( | ) |
| get_current_instance | ( | $ | raterid, |
| $ | itemid, | ||
| $ | idonly = false |
||
| ) |
Returns the current instance (either with status ACTIVE or NEEDUPDATE) for this definition for the specified $raterid and $itemid (if multiple raters are allowed, or only for $itemid otherwise).
| int | $raterid | |
| int | $itemid | |
| boolean | $idonly |
| get_definition | ( | $ | force = false | ) |
Returns the grading form definition structure
| boolean | $force | whether to force loading from DB even if it was already loaded |
Definition at line 224 of file lib.php.


| get_definition_copy | ( | gradingform_controller $ | target | ) |
Returns the form definition suitable for cloning into another area
| gradingform_controller | $target | the controller of the new copy |
Reimplemented in gradingform_rubric_controller.
Definition at line 237 of file lib.php.

| get_editor_url | ( | moodle_url $ | returnurl = null | ) |
Returns URL of a page where the grading form can be defined and edited.
| moodle_url | $returnurl | optional URL of a page where the user should be sent once they are finished with editing |
Definition at line 180 of file lib.php.


Formats the definition description for display on page
Reimplemented in gradingform_rubric_controller.
Definition at line 345 of file lib.php.

| get_grade_range | ( | ) | [final] |
| get_instance | ( | $ | instance | ) | [protected] |
Returns the object of type gradingform_XXX_instance (where XXX is the plugin method name)
| mixed | $instance | id or row from grading_isntances table |
| get_method_name | ( | ) | [protected] |
Definition at line 573 of file lib.php.

| get_or_create_instance | ( | $ | instanceid, |
| $ | raterid, | ||
| $ | itemid | ||
| ) |
If instanceid is specified and grading instance exists and it is created by this rater for this item, this instance is returned. Otherwise new instance is created for the specified rater and itemid
| int | $instanceid | |
| int | $raterid | |
| int | $itemid |
Reimplemented in gradingform_rubric_controller.
| is_form_defined | ( | ) |
| is_own_form | ( | $ | userid = null | ) |
Is the grading form owned by the given user?
The form owner is the user who created this instance of the form.
| int | $userid | the user id to check, defaults to the current user |
Definition at line 149 of file lib.php.

| load_definition | ( | ) | [protected] |
Loads the form definition if it exists
The default implementation just tries to load the record from the {grading_definitions} table. The plugins are likely to override this with a more complex query that loads all required data at once.
Reimplemented in gradingform_rubric_controller.
Definition at line 555 of file lib.php.

| render_grade | ( | $ | page, |
| $ | itemid, | ||
| $ | gradinginfo, | ||
| $ | defaultcontent, | ||
| $ | cangrade | ||
| ) |
Returns html code to be included in student's feedback.
| moodle_page | $page | |
| int | $itemid | |
| array | $gradinginfo | result of function grade_get_grades if plugin want to use some of their info |
| string | $defaultcontent | default string to be returned if no active grading is found or for some reason can not be shown to a user |
| boolean | $cangrade | whether current user has capability to grade in this context |
Reimplemented in gradingform_rubric_controller.
| render_preview | ( | moodle_page $ | page | ) | [abstract] |
Returns the HTML code displaying the preview of the grading form
Plugins are forced to override this. Ideally they should delegate the task to their own renderer.
| moodle_page | $page | the target page |
Reimplemented in gradingform_rubric_controller.
| set_grade_range | ( | array $ | graderange | ) | [final] |
| static sql_search_from_tables | ( | $ | gdid | ) | [static] |
Prepare the part of the search query to append to the FROM statement
| string | $gdid | the alias of grading_definitions.id column used by the caller |
Reimplemented in gradingform_rubric_controller.
| static sql_search_where | ( | $ | token | ) | [static] |
Prepare the parts of the SQL WHERE statement to search for the given token
The returned array cosists of the list of SQL comparions and the list of respective parameters for the comparisons. The returned chunks will be joined with other conditions using the OR operator.
| string | $token | token to search for |
Reimplemented in gradingform_rubric_controller.
| update_definition | ( | stdClass $ | definition, |
| $ | usermodified = null |
||
| ) |
Saves the defintion data into the database
The implementation in this base class stores the common data into the record into the {grading_definition} table. The plugins are likely to extend this and save their data into own tables, too.
| stdClass | $definition | data containing values for the {grading_definition} table |
| int | null | $usermodified | optional userid of the author of the definition, defaults to the current user |
Reimplemented in gradingform_rubric_controller.
| const DEFINITION_STATUS_DRAFT = 10 |
| const DEFINITION_STATUS_NULL = 0 |
| const DEFINITION_STATUS_READY = 20 |