Moodle  2.2.1
http://www.collinsharper.com
grading_manager Class Reference
Inheritance diagram for grading_manager:

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

Detailed Description

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.

Definition at line 89 of file lib.php.


Member Function Documentation

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.

Parameters:
string$componentnormalized component name
Returns:
array of (string)areacode => (string)localized title of the area

Definition at line 278 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static available_methods ( includenone = true) [static]

Returns the list of installed grading plugins together, optionally extended with a simple direct grading.

Parameters:
bool$includenoneshould the 'Simple direct grading' be included
Returns:
array of the (string)name => (string)localized title of the method

Definition at line 238 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
string$methodthe name of the plugin we create the area for
Returns:
int the new area id

Definition at line 574 of file lib.php.

Here is the call graph for this function:

static delete_all_for_context ( contextid) [static]

Removes all data associated with the given context

This is called by context::delete_content()

Parameters:
int$contextidcontext id

Definition at line 595 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
global_navigation$navigation
navigation_node$modulenode

Definition at line 466 of file lib.php.

Here is the call graph for this function:

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.

Parameters:
settings_navigation$settingsnavsettings_navigation
navigation_node$modulenodenavigation_node

Definition at line 417 of file lib.php.

Here is the call graph for this function:

Returns the controller for the active method if it is available

Returns:
null|grading_controller

Definition at line 529 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns the currently active grading method in the gradable area

Returns:
string|null the name of the grading plugin of null if it has not been set

Definition at line 328 of file lib.php.

Here is the caller graph for this function:

get_area ( )
Returns:
string grading manager area name

Definition at line 141 of file lib.php.

Here is the caller graph for this function:

Returns the localized title of the currently set area

Returns:
string

Definition at line 197 of file lib.php.

Here is the call graph for this function:

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.

Returns:
array of (string)areacode => (string)localized title of the area

Definition at line 302 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters:
bool$includenoneshould the 'Simple direct grading' be included
Returns:
array of the (string)name => (string)localized title of the method

Definition at line 264 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
string grading manager component

Definition at line 123 of file lib.php.

Here is the caller graph for this function:

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.

Returns:
string

Definition at line 164 of file lib.php.

Here is the call graph for this function:

Returns:
stdClass grading manager context

Definition at line 106 of file lib.php.

Here is the caller graph for this function:

get_controller ( method)

Returns the given method's controller in the gradable area

Parameters:
string$methodthe method name, eg 'rubric' (must be available)
Returns:
grading_controller

Definition at line 484 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_management_url ( moodle_url returnurl = null)

Returns the URL of the grading area management page

Parameters:
moodle_url$returnurloptional URL of the page where the user should be sent back to
Returns:
moodle_url

Definition at line 545 of file lib.php.

Here is the caller graph for this function:

load ( areaid)

Loads the gradable area info from the database

Parameters:
int$areaid

Definition at line 222 of file lib.php.

Here is the call graph for this function:

set_active_method ( method)

Sets the currently active grading method in the gradable area

Parameters:
string$methodthe method name, eg 'rubric' (must be available)
Returns:
bool true if the method changed or was just set, false otherwise

Definition at line 356 of file lib.php.

Here is the call graph for this function:

set_area ( area)

Sets the area the manager operates on

Parameters:
string$areathe name of the gradable area

Definition at line 150 of file lib.php.

Here is the caller graph for this function:

set_component ( component)

Sets the component the manager operates on

Parameters:
string$componentthe frankenstyle name of the component

Definition at line 132 of file lib.php.

Here is the call graph for this function:

set_context ( stdClass $  context)

Sets the context the manager operates on

Parameters:
stdClass$context

Definition at line 115 of file lib.php.

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.

Parameters:
string$needle
Returns:
array

Definition at line 629 of file lib.php.

Here is the caller graph for this function:


Field Documentation

$area [protected]

Definition at line 98 of file lib.php.

$component [protected]

Definition at line 95 of file lib.php.

$context [protected]

Definition at line 92 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations