|
Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
|
Grade helper class. More...
Static Public Member Functions | |
| static | fetch_all_natural_weights_for_course ($courseid) |
| This helper method gets a snapshot of all the weights for a course. | |
| static | get_activity_link (array $element) |
| Returns a link to activity. | |
| static | get_aggregation_strings () |
| Gets strings describing the available aggregation methods. | |
| static | get_element_header (array $element, bool $withlink=false, bool $icon=true, bool $spacerifnone=false, bool $withdescription=false, bool $fulltotal=false, ?moodle_url $sortlink=null) |
| Returns name of element optionally with icon and link. | |
| static | get_element_icon (array $element, bool $spacerifnone=false) |
| Returns icon of element. | |
| static | get_element_type_string (array $element) |
| Returns the string that describes the type of the element. | |
| static | get_info_letters ($courseid) |
| Get information on letters. | |
| static | get_info_manage_settings ($courseid) |
| Get grade_plugin_info object for managing settings if the user can. | |
| static | get_info_outcomes ($courseid) |
| Get information on outcomes. | |
| static | get_info_scales ($courseid) |
| Get information on scales. | |
| static | get_lang_string (string $strcode, ?string $section=null) |
| First checks the cached language strings, then returns match if found, or uses get_string() to get it from the DB, caches it then returns it. | |
| static | get_plugin_strings () |
| Gets strings commonly used by the describe plugins. | |
| static | get_plugins_export ($courseid) |
| Get information export plugins. | |
| static | get_plugins_import ($courseid) |
| Get information import plugins. | |
| static | get_plugins_reports ($courseid) |
| Returns an array of plugin reports as grade_plugin_info objects. | |
| static | get_user_field_value ($user, $field) |
| Returns the value of a field from a user record. | |
| static | get_user_profile_fields ($courseid, $includecustomfields=false) |
| Returns an array of user profile fields to be included in export. | |
| static | reset_caches () |
| Resets all static caches. | |
Static Protected Attributes | |
| static array | $aggregationstrings = null |
| Cached grade aggregation strings. | |
| static array false | $exportplugins = null |
| Cached grade export plugins {. | |
| static array false | $gradereportpreferences = null |
| Cached grade report plugins preferences {. | |
| static array false | $gradereports = null |
| Cached grade report plugins {. | |
| static array false | $importplugins = null |
| Cached grade import plugins {. | |
| static array | $langstrings = [] |
| Cached grade tree plugin strings. | |
| static grade_plugin_info false | $letterinfo = null |
| Cached leftter info {. | |
| static grade_plugin_info false | $managesetting = null |
| Cached manage settings info {. | |
| static grade_plugin_info false | $outcomeinfo = null |
| Cached outcome info {. | |
| static array | $pluginstrings = null |
| Cached grade plugin strings. | |
| static grade_plugin_info false | $scaleinfo = null |
| Cached scale info {. | |
Grade helper class.
This class provides several helpful functions that work irrespective of any current state.
|
static |
This helper method gets a snapshot of all the weights for a course.
It is used as a quick method to see if any wieghts have been automatically adjusted.
| int | $courseid |
| array | of itemid -> aggregationcoef2 |
|
static |
Returns a link to activity.
| array | $element | An array representing an element in the grade_tree |
| moodle_url|null | link to activity or null if not found |
|
static |
Gets strings describing the available aggregation methods.
| array |
|
static |
Returns name of element optionally with icon and link.
| array | $element | An array representing an element in the grade_tree |
| bool | $withlink | Whether or not this header has a link |
| bool | $icon | Whether or not to display an icon with this header |
| bool | $spacerifnone | return spacer if no icon found |
| bool | $withdescription | Show description if defined by this item. |
| bool | $fulltotal | If the item is a category total, returns $categoryname."total" instead of "Category total" or "Course total" |
| moodle_url | null | $sortlink | Link to sort column. |
| string | header |
|
static |
Returns icon of element.
| array | $element | An array representing an element in the grade_tree |
| bool | $spacerifnone | return spacer if no icon found |
| string | icon or spacer |
|
static |
Returns the string that describes the type of the element.
| array | $element | An array representing an element in the grade_tree |
| string | The string that describes the type of the grade element |
|
static |
Get information on letters.
| int | $courseid |
| array |
|
static |
Get grade_plugin_info object for managing settings if the user can.
| int | $courseid |
| grade_plugin_info[] |
|
static |
Get information on outcomes.
| int | $courseid |
| grade_plugin_info[]|false |
|
static |
|
static |
First checks the cached language strings, then returns match if found, or uses get_string() to get it from the DB, caches it then returns it.
| string | $strcode | |
| string | null | $section | Optional language section |
| string |
|
static |
Gets strings commonly used by the describe plugins.
report => get_string('view'), scale => get_string('scales'), outcome => get_string('outcomes', 'grades'), letter => get_string('letters', 'grades'), export => get_string('export', 'grades'), import => get_string('import'), settings => get_string('settings')
| array |
|
static |
Get information export plugins.
| int | $courseid |
| array |
|
static |
Get information import plugins.
| int | $courseid |
| array |
|
static |
Returns an array of plugin reports as grade_plugin_info objects.
| int | $courseid |
| array |
|
static |
Returns the value of a field from a user record.
| stdClass | $user | object |
| stdClass | $field | object |
| string | value of the field |
|
static |
Returns an array of user profile fields to be included in export.
| int | $courseid | |
| bool | $includecustomfields |
| array | An array of stdClass instances with customid, shortname, datatype, default and fullname fields |
|
static |
Resets all static caches.
| void |
|
staticprotected |
Cached grade export plugins {.
|
staticprotected |
Cached grade report plugins preferences {.
|
staticprotected |
Cached grade report plugins {.
|
staticprotected |
Cached grade import plugins {.
|
staticprotected |
Cached leftter info {.
|
staticprotected |
Cached manage settings info {.
|
staticprotected |
Cached outcome info {.
|
staticprotected |
Cached scale info {.