Differences Between: [Versions 310 and 400] [Versions 311 and 400] [Versions 39 and 400] [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]
Functions used by gradebook plugins and reports.
Copyright: | 2009 Petr Skoda and Nicolas Connault |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 3270 lines (120 kb) |
Included or required: | 1 time |
Referenced: | 31 times |
Includes or requires: | 0 files |
graded_users_iterator:: (18 methods):
__construct()
init()
next_user()
close()
require_active_enrolment()
allow_user_custom_fields()
_push()
_pop()
print_graded_users_selector()
grade_get_graded_users_select()
hide_natural_aggregation_upgrade_notice()
grade_hide_min_max_grade_upgrade_notice()
grade_upgrade_use_min_max_from_grade_grade()
grade_upgrade_use_min_max_from_grade_item()
hide_aggregatesubcats_upgrade_notice()
hide_gradebook_calculations_freeze_notice()
print_natural_aggregation_upgrade_notice()
grade_get_plugin_info()
grade_plugin_info:: (2 methods):
__construct()
print_grade_page_head()
grade_plugin_return:: (2 methods):
__construct()
grade_plugin_return()
name:: (23 methods):
get_options()
get_return_url()
get_form_fields()
add_mform_elements()
add_url_params()
grade_build_nav()
flatten()
locate_element()
category_collapse()
no_outcomes()
category_grade_last()
fill_levels()
can_output_item()
inject_fillers()
inject_colspans()
locate_element()
exporttoxml()
exporttojson()
get_levels()
get_items()
get_item()
grade_button()
grade_extend_settings()
grade_structure:: (13 methods):
get_element_icon()
get_element_header()
get_activity_link()
get_grade_analysis_url()
get_grade_analysis_icon()
get_grade_eid()
get_item_eid()
get_params_for_iconstr()
get_reset_icon()
get_edit_icon()
get_hiding_icon()
get_locking_icon()
get_calculation_icon()
grade_seq:: (2 methods):
__construct()
grade_seq()
name:: (23 methods):
get_options()
get_return_url()
get_form_fields()
add_mform_elements()
add_url_params()
grade_build_nav()
flatten()
locate_element()
category_collapse()
no_outcomes()
category_grade_last()
fill_levels()
can_output_item()
inject_fillers()
inject_colspans()
locate_element()
exporttoxml()
exporttojson()
get_levels()
get_items()
get_item()
grade_button()
grade_extend_settings()
grade_tree:: (2 methods):
__construct()
grade_tree()
name:: (23 methods):
get_options()
get_return_url()
get_form_fields()
add_mform_elements()
add_url_params()
grade_build_nav()
flatten()
locate_element()
category_collapse()
no_outcomes()
category_grade_last()
fill_levels()
can_output_item()
inject_fillers()
inject_colspans()
locate_element()
exporttoxml()
exporttojson()
get_levels()
get_items()
get_item()
grade_button()
grade_extend_settings()
grade_helper:: (13 methods):
get_plugin_strings()
get_aggregation_strings()
get_info_manage_settings()
get_plugins_reports()
get_info_scales()
get_info_outcomes()
get_info_letters()
get_plugins_import()
get_plugins_export()
get_user_field_value()
get_user_profile_fields()
fetch_all_natural_weights_for_course()
reset_caches()
Class: graded_users_iterator - X-Ref
This class iterates over all users that are graded in a course.__construct($course, $grade_items=null, $groupid=0,$sortfield1='lastname', $sortorder1='ASC',$sortfield2='firstname', $sortorder2='ASC') X-Ref |
Constructor param: object $course A course object param: array $grade_items array of grade items, if not specified only user info returned param: int $groupid iterate only group users if present param: string $sortfield1 The first field of the users table by which the array of users will be sorted param: string $sortorder1 The order in which the first sorting field will be sorted (ASC or DESC) param: string $sortfield2 The second field of the users table by which the array of users will be sorted param: string $sortorder2 The order in which the second sorting field will be sorted (ASC or DESC) |
init() X-Ref |
Initialise the iterator return: boolean success |
next_user() X-Ref |
Returns information about the next user return: mixed array of user info, all grades and feedback or null when no more users found |
close() X-Ref |
Close the iterator, do not forget to call this function |
require_active_enrolment($onlyactive = true) X-Ref |
Should all enrolled users be exported or just those with an active enrolment? param: bool $onlyactive True to limit the export to users with an active enrolment |
allow_user_custom_fields($allow = true) X-Ref |
Allow custom fields to be included return: void param: bool $allow Whether to allow custom fields or not |
_push($grade) X-Ref |
Add a grade_grade instance to the grade stack return: void param: grade_grade $grade Grade object |
_pop() X-Ref |
Remove a grade_grade instance from the grade stack return: grade_grade current grade object |
print_graded_users_selector($course, $actionpage, $userid=0, $groupid=0, $includeall=true, $return=false) X-Ref |
Print a selection popup form of the graded users in a course. return: null param: int $course id of the course param: string $actionpage The page receiving the data from the popoup form param: int $userid id of the currently selected user (or 'all' if they are all selected) param: int $groupid id of requested group, 0 means all param: int $includeall bool include all option param: bool $return If true, will return the HTML, otherwise, will print directly |
grade_get_graded_users_select($report, $course, $userid, $groupid, $includeall) X-Ref |
No description |
hide_natural_aggregation_upgrade_notice($courseid) X-Ref |
Hide warning about changed grades during upgrade to 2.8. param: int $courseid The current course id. |
grade_hide_min_max_grade_upgrade_notice($courseid) X-Ref |
Hide warning about changed grades during upgrade from 2.8.0-2.8.6 and 2.9.0. param: int $courseid The current course id. |
grade_upgrade_use_min_max_from_grade_grade($courseid) X-Ref |
Use the grade min and max from the grade_grade. This is reserved for core use after an upgrade. param: int $courseid The current course id. |
grade_upgrade_use_min_max_from_grade_item($courseid) X-Ref |
Use the grade min and max from the grade_item. This is reserved for core use after an upgrade. param: int $courseid The current course id. |
hide_aggregatesubcats_upgrade_notice($courseid) X-Ref |
Hide warning about changed grades during upgrade to 2.8. param: int $courseid The current course id. |
hide_gradebook_calculations_freeze_notice($courseid) X-Ref |
Hide warning about changed grades due to bug fixes param: int $courseid The current course id. |
print_natural_aggregation_upgrade_notice($courseid, $context, $thispage, $return=false) X-Ref |
Print warning about changed grades during upgrade to 2.8. return: nothing or string if $return true param: int $courseid The current course id. param: context $context The course context. param: string $thispage The relative path for the current page. E.g. /grade/report/user/index.php param: boolean $return return as string |
grade_get_plugin_info($courseid, $active_type, $active_plugin) X-Ref |
grade_get_plugin_info return: array param: int $courseid The course id param: string $active_type type of plugin on current page - import, export, report or edit param: string $active_plugin active plugin type - grader, user, cvs, ... |
Class: grade_plugin_info - X-Ref
A simple class containing info about grade plugins.__construct($id, $link, $string, $parent=null) X-Ref |
Constructor return: void param: int $id A unique id for this plugin param: string $link A URL to access this plugin param: string $string The name of this plugin param: object $parent Another grade_plugin_info object, parent of the current one |
print_grade_page_head(int $courseid, string $active_type, ?string $active_plugin = null, $heading = false,bool $return = false, $buttons = false, bool $shownavigation = true, ?string $headerhelpidentifier = null,?string $headerhelpcomponent = null, ?stdClass $user = null, ?action_bar $actionbar = null) X-Ref |
Prints the page headers, breadcrumb trail, page heading, (optional) navigation and for any gradebook page. All gradebook pages MUST use these functions in favour of the usual print_header(), print_header_simple(), print_heading() etc. return: string HTML code or nothing if $return == false param: int $courseid Course id param: string $active_type The type of the current page (report, settings, param: string|null $active_plugin The plugin of the current page (grader, fullview etc...) param: string|bool $heading The heading of the page. Tries to guess if none is given param: boolean $return Whether to return (true) or echo (false) the HTML generated by this function param: string|bool $buttons Additional buttons to display on the page param: boolean $shownavigation should the gradebook navigation be shown? param: string|null $headerhelpidentifier The help string identifier if required. param: string|null $headerhelpcomponent The component for the help string. param: stdClass|null $user The user object for use with the user context header. param: actionbar|null $actionbar The actions bar which will be displayed on the page if $shownavigation is set |
Class: grade_plugin_return - X-Ref
Utility class used for return tracking when using edit and other forms in grade plugins__construct($params = []) X-Ref |
Constructor param: array $params - associative array with return parameters, if not supplied parameter are taken from _GET or _POST |
grade_plugin_return($params = null) X-Ref |
Old syntax of class constructor. Deprecated in PHP7. |
get_options() X-Ref |
Returns return parameters as options array suitable for buttons. return: array options |
get_return_url($default, $extras=null) X-Ref |
Returns return url return: string url param: string $default default url when params not set param: array $extras Extra URL parameters |
get_form_fields() X-Ref |
Returns string with hidden return tracking form elements. return: string |
add_mform_elements(&$mform) X-Ref |
Add hidden elements into mform return: void param: object &$mform moodle form object |
add_url_params(moodle_url $url) X-Ref |
Add return tracking params into url return: moodle_url with return tracking params param: moodle_url $url A URL |
grade_build_nav($path, $pagename=null, $id=null) X-Ref |
Function central to gradebook for building and printing the navigation (breadcrumb trail). return: string param: string $path The path of the calling script (using __FILE__?) param: string $pagename The language string to use as the last part of the navigation (non-link) param: mixed $id Either a plain integer (assuming the key is 'id') or |
flatten(&$element, $category_grade_last, $nooutcomes) X-Ref |
Static recursive helper - makes the grade_item for category the last children return: array param: array &$element The seed of the recursion param: bool $category_grade_last category grade item is the last child param: bool $nooutcomes Whether or not outcomes should be included |
locate_element($eid) X-Ref |
Parses the array in search of a given eid and returns a element object with information about the element it has found. return: object element param: int $eid Gradetree Element ID |
category_collapse(&$element, $collapsed) X-Ref |
Static recursive helper - removes items from collapsed categories return: void param: array &$element The seed of the recursion param: array $collapsed array of collapsed categories |
no_outcomes(&$element) X-Ref |
Static recursive helper - removes all outcomes return: void param: array &$element The seed of the recursion |
category_grade_last(&$element) X-Ref |
Static recursive helper - makes the grade_item for category the last children return: void param: array &$element The seed of the recursion |
fill_levels(&$levels, &$element, $depth) X-Ref |
Static recursive helper - fills the levels array, useful when accessing tree elements of one level return: void param: array &$levels The levels of the grade tree through which to recurse param: array &$element The seed of the recursion param: int $depth How deep are we? |
can_output_item($element) X-Ref |
Determines whether the grade tree item can be displayed. This is particularly targeted for grade categories that have no total (None) when rendering the grade tree. It checks if the grade tree item is of type 'category', and makes sure that the category, or at least one of children, can be output. return: bool True if the grade tree item can be displayed. False, otherwise. param: array $element The grade category element. |
inject_fillers(&$element, $depth) X-Ref |
Static recursive helper - makes full tree (all leafes are at the same level) return: int param: array &$element The seed of the recursion param: int $depth How deep are we? |
inject_colspans(&$element) X-Ref |
Static recursive helper - add colspan information into categories return: int param: array &$element The seed of the recursion |
locate_element($eid) X-Ref |
Parses the array in search of a given eid and returns a element object with information about the element it has found. return: object element param: int $eid Gradetree Element ID |
exporttoxml($root=null, $tabs="\t") X-Ref |
Returns a well-formed XML representation of the grade-tree using recursion. return: string $xml param: array $root The current element in the recursion. If null, starts at the top of the tree. param: string $tabs The control character to use for tabs |
exporttojson($root=null, $tabs="\t") X-Ref |
Returns a JSON representation of the grade-tree using recursion. return: string param: array $root The current element in the recursion. If null, starts at the top of the tree. param: string $tabs Tab characters used to indent the string nicely for humans to enjoy |
get_levels() X-Ref |
Returns the array of levels return: array |
get_items() X-Ref |
Returns the array of grade items return: array |
get_item($itemid) X-Ref |
Returns a specific Grade Item return: grade_item param: int $itemid The ID of the grade_item object |
grade_button($type, $courseid, $object) X-Ref |
Local shortcut function for creating an edit/delete button for a grade_* object. return: string html param: string $type 'edit' or 'delete' param: int $courseid The Course ID param: grade_* $object The grade_* object |
grade_extend_settings($plugininfo, $courseid) X-Ref |
This method adds settings to the settings block for the grade system and its plugins |
Class: grade_structure - X-Ref
General structure representing grade items in courseget_element_icon(&$element, $spacerifnone=false) X-Ref |
Returns icon of element return: string icon or spacer param: array &$element An array representing an element in the grade_tree param: bool $spacerifnone return spacer if no icon found |
get_element_header(&$element, $withlink = false, $icon = true, $spacerifnone = false,$withdescription = false, $fulltotal = false) X-Ref |
Returns name of element optionally with icon and link return: string header param: array &$element An array representing an element in the grade_tree param: bool $withlink Whether or not this header has a link param: bool $icon Whether or not to display an icon with this header param: bool $spacerifnone return spacer if no icon found param: bool $withdescription Show description if defined by this item. param: bool $fulltotal If the item is a category total, returns $categoryname."total" |
get_activity_link($element) X-Ref |
No description |
get_grade_analysis_url(grade_grade $grade) X-Ref |
Returns URL of a page that is supposed to contain detailed grade analysis At the moment, only activity modules are supported. The method generates link to the module's file grade.php with the parameters id (cmid), itemid, itemnumber, gradeid and userid. If the grade.php does not exist, null is returned. return: moodle_url|null URL or null if unable to construct it |
get_grade_analysis_icon(grade_grade $grade) X-Ref |
Returns an action icon leading to the grade analysis page return: string param: grade_grade $grade |
get_grade_eid($grade_grade) X-Ref |
Returns the grade eid - the grade may not exist yet. return: string eid param: grade_grade $grade_grade A grade_grade object |
get_item_eid($grade_item) X-Ref |
Returns the grade_item eid return: string eid param: grade_item $grade_item A grade_item object |
get_params_for_iconstr($element) X-Ref |
Given a grade_tree element, returns an array of parameters used to build an icon for that element. return: array param: array $element An array representing an element in the grade_tree |
get_reset_icon($element, $gpr, $returnactionmenulink = false) X-Ref |
Return a reset icon for the given element. return: string|action_menu_link param: array $element An array representing an element in the grade_tree param: object $gpr A grade_plugin_return object param: bool $returnactionmenulink return the instance of action_menu_link instead of string |
get_edit_icon($element, $gpr, $returnactionmenulink = false) X-Ref |
Return edit icon for give element return: string|action_menu_link param: array $element An array representing an element in the grade_tree param: object $gpr A grade_plugin_return object param: bool $returnactionmenulink return the instance of action_menu_link instead of string |
get_hiding_icon($element, $gpr, $returnactionmenulink = false) X-Ref |
Return hiding icon for give element return: string|action_menu_link param: array $element An array representing an element in the grade_tree param: object $gpr A grade_plugin_return object param: bool $returnactionmenulink return the instance of action_menu_link instead of string |
get_locking_icon($element, $gpr) X-Ref |
Return locking icon for given element return: string param: array $element An array representing an element in the grade_tree param: object $gpr A grade_plugin_return object |
get_calculation_icon($element, $gpr, $returnactionmenulink = false) X-Ref |
Return calculation icon for given element return: string|action_menu_link param: array $element An array representing an element in the grade_tree param: object $gpr A grade_plugin_return object param: bool $returnactionmenulink return the instance of action_menu_link instead of string |
__construct($courseid, $category_grade_last=false, $nooutcomes=false) X-Ref |
Constructor, retrieves and stores array of all grade_category and grade_item objects for the given courseid. Full objects are instantiated. Ordering sequence is fixed if needed. param: int $courseid The course id param: bool $category_grade_last category grade item is the last child param: bool $nooutcomes Whether or not outcomes should be included |
grade_seq($courseid, $category_grade_last=false, $nooutcomes=false) X-Ref |
Old syntax of class constructor. Deprecated in PHP7. |
get_options() X-Ref |
Returns return parameters as options array suitable for buttons. return: array options |
get_return_url($default, $extras=null) X-Ref |
Returns return url return: string url param: string $default default url when params not set param: array $extras Extra URL parameters |
get_form_fields() X-Ref |
Returns string with hidden return tracking form elements. return: string |
add_mform_elements(&$mform) X-Ref |
Add hidden elements into mform return: void param: object &$mform moodle form object |
add_url_params(moodle_url $url) X-Ref |
Add return tracking params into url return: moodle_url with return tracking params param: moodle_url $url A URL |
grade_build_nav($path, $pagename=null, $id=null) X-Ref |
Function central to gradebook for building and printing the navigation (breadcrumb trail). return: string param: string $path The path of the calling script (using __FILE__?) param: string $pagename The language string to use as the last part of the navigation (non-link) param: mixed $id Either a plain integer (assuming the key is 'id') or |
flatten(&$element, $category_grade_last, $nooutcomes) X-Ref |
Static recursive helper - makes the grade_item for category the last children return: array param: array &$element The seed of the recursion param: bool $category_grade_last category grade item is the last child param: bool $nooutcomes Whether or not outcomes should be included |
locate_element($eid) X-Ref |
Parses the array in search of a given eid and returns a element object with information about the element it has found. return: object element param: int $eid Gradetree Element ID |
category_collapse(&$element, $collapsed) X-Ref |
Static recursive helper - removes items from collapsed categories return: void param: array &$element The seed of the recursion param: array $collapsed array of collapsed categories |
no_outcomes(&$element) X-Ref |
Static recursive helper - removes all outcomes return: void param: array &$element The seed of the recursion |
category_grade_last(&$element) X-Ref |
Static recursive helper - makes the grade_item for category the last children return: void param: array &$element The seed of the recursion |
fill_levels(&$levels, &$element, $depth) X-Ref |
Static recursive helper - fills the levels array, useful when accessing tree elements of one level return: void param: array &$levels The levels of the grade tree through which to recurse param: array &$element The seed of the recursion param: int $depth How deep are we? |
can_output_item($element) X-Ref |
Determines whether the grade tree item can be displayed. This is particularly targeted for grade categories that have no total (None) when rendering the grade tree. It checks if the grade tree item is of type 'category', and makes sure that the category, or at least one of children, can be output. return: bool True if the grade tree item can be displayed. False, otherwise. param: array $element The grade category element. |
inject_fillers(&$element, $depth) X-Ref |
Static recursive helper - makes full tree (all leafes are at the same level) return: int param: array &$element The seed of the recursion param: int $depth How deep are we? |
inject_colspans(&$element) X-Ref |
Static recursive helper - add colspan information into categories return: int param: array &$element The seed of the recursion |
locate_element($eid) X-Ref |
Parses the array in search of a given eid and returns a element object with information about the element it has found. return: object element param: int $eid Gradetree Element ID |
exporttoxml($root=null, $tabs="\t") X-Ref |
Returns a well-formed XML representation of the grade-tree using recursion. return: string $xml param: array $root The current element in the recursion. If null, starts at the top of the tree. param: string $tabs The control character to use for tabs |
exporttojson($root=null, $tabs="\t") X-Ref |
Returns a JSON representation of the grade-tree using recursion. return: string param: array $root The current element in the recursion. If null, starts at the top of the tree. param: string $tabs Tab characters used to indent the string nicely for humans to enjoy |
get_levels() X-Ref |
Returns the array of levels return: array |
get_items() X-Ref |
Returns the array of grade items return: array |
get_item($itemid) X-Ref |
Returns a specific Grade Item return: grade_item param: int $itemid The ID of the grade_item object |
grade_button($type, $courseid, $object) X-Ref |
Local shortcut function for creating an edit/delete button for a grade_* object. return: string html param: string $type 'edit' or 'delete' param: int $courseid The Course ID param: grade_* $object The grade_* object |
grade_extend_settings($plugininfo, $courseid) X-Ref |
This method adds settings to the settings block for the grade system and its plugins |
Class: grade_tree - X-Ref
This class represents a complete tree of categories, grade_items and final grades,__construct($courseid, $fillers=true, $category_grade_last=false,$collapsed=null, $nooutcomes=false) X-Ref |
Constructor, retrieves and stores a hierarchical array of all grade_category and grade_item objects for the given courseid. Full objects are instantiated. Ordering sequence is fixed if needed. param: int $courseid The Course ID param: bool $fillers include fillers and colspans, make the levels var "rectangular" param: bool $category_grade_last category grade item is the last child param: array $collapsed array of collapsed categories param: bool $nooutcomes Whether or not outcomes should be included |
grade_tree($courseid, $fillers=true, $category_grade_last=false,$collapsed=null, $nooutcomes=false) X-Ref |
Old syntax of class constructor. Deprecated in PHP7. |
get_options() X-Ref |
Returns return parameters as options array suitable for buttons. return: array options |
get_return_url($default, $extras=null) X-Ref |
Returns return url return: string url param: string $default default url when params not set param: array $extras Extra URL parameters |
get_form_fields() X-Ref |
Returns string with hidden return tracking form elements. return: string |
add_mform_elements(&$mform) X-Ref |
Add hidden elements into mform return: void param: object &$mform moodle form object |
add_url_params(moodle_url $url) X-Ref |
Add return tracking params into url return: moodle_url with return tracking params param: moodle_url $url A URL |
grade_build_nav($path, $pagename=null, $id=null) X-Ref |
Function central to gradebook for building and printing the navigation (breadcrumb trail). return: string param: string $path The path of the calling script (using __FILE__?) param: string $pagename The language string to use as the last part of the navigation (non-link) param: mixed $id Either a plain integer (assuming the key is 'id') or |
flatten(&$element, $category_grade_last, $nooutcomes) X-Ref |
Static recursive helper - makes the grade_item for category the last children return: array param: array &$element The seed of the recursion param: bool $category_grade_last category grade item is the last child param: bool $nooutcomes Whether or not outcomes should be included |
locate_element($eid) X-Ref |
Parses the array in search of a given eid and returns a element object with information about the element it has found. return: object element param: int $eid Gradetree Element ID |
category_collapse(&$element, $collapsed) X-Ref |
Static recursive helper - removes items from collapsed categories return: void param: array &$element The seed of the recursion param: array $collapsed array of collapsed categories |
no_outcomes(&$element) X-Ref |
Static recursive helper - removes all outcomes return: void param: array &$element The seed of the recursion |
category_grade_last(&$element) X-Ref |
Static recursive helper - makes the grade_item for category the last children return: void param: array &$element The seed of the recursion |
fill_levels(&$levels, &$element, $depth) X-Ref |
Static recursive helper - fills the levels array, useful when accessing tree elements of one level return: void param: array &$levels The levels of the grade tree through which to recurse param: array &$element The seed of the recursion param: int $depth How deep are we? |
can_output_item($element) X-Ref |
Determines whether the grade tree item can be displayed. This is particularly targeted for grade categories that have no total (None) when rendering the grade tree. It checks if the grade tree item is of type 'category', and makes sure that the category, or at least one of children, can be output. return: bool True if the grade tree item can be displayed. False, otherwise. param: array $element The grade category element. |
inject_fillers(&$element, $depth) X-Ref |
Static recursive helper - makes full tree (all leafes are at the same level) return: int param: array &$element The seed of the recursion param: int $depth How deep are we? |
inject_colspans(&$element) X-Ref |
Static recursive helper - add colspan information into categories return: int param: array &$element The seed of the recursion |
locate_element($eid) X-Ref |
Parses the array in search of a given eid and returns a element object with information about the element it has found. return: object element param: int $eid Gradetree Element ID |
exporttoxml($root=null, $tabs="\t") X-Ref |
Returns a well-formed XML representation of the grade-tree using recursion. return: string $xml param: array $root The current element in the recursion. If null, starts at the top of the tree. param: string $tabs The control character to use for tabs |
exporttojson($root=null, $tabs="\t") X-Ref |
Returns a JSON representation of the grade-tree using recursion. return: string param: array $root The current element in the recursion. If null, starts at the top of the tree. param: string $tabs Tab characters used to indent the string nicely for humans to enjoy |
get_levels() X-Ref |
Returns the array of levels return: array |
get_items() X-Ref |
Returns the array of grade items return: array |
get_item($itemid) X-Ref |
Returns a specific Grade Item return: grade_item param: int $itemid The ID of the grade_item object |
grade_button($type, $courseid, $object) X-Ref |
Local shortcut function for creating an edit/delete button for a grade_* object. return: string html param: string $type 'edit' or 'delete' param: int $courseid The Course ID param: grade_* $object The grade_* object |
grade_extend_settings($plugininfo, $courseid) X-Ref |
This method adds settings to the settings block for the grade system and its plugins |
Class: grade_helper - X-Ref
Grade helper classget_plugin_strings() X-Ref |
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') return: array |
get_aggregation_strings() X-Ref |
Gets strings describing the available aggregation methods. return: array |
get_info_manage_settings($courseid) X-Ref |
Get grade_plugin_info object for managing settings if the user can return: grade_plugin_info[] param: int $courseid |
get_plugins_reports($courseid) X-Ref |
Returns an array of plugin reports as grade_plugin_info objects return: array param: int $courseid |
get_info_scales($courseid) X-Ref |
Get information on scales return: grade_plugin_info param: int $courseid |
get_info_outcomes($courseid) X-Ref |
Get information on outcomes return: grade_plugin_info param: int $courseid |
get_info_letters($courseid) X-Ref |
Get information on letters return: array param: int $courseid |
get_plugins_import($courseid) X-Ref |
Get information import plugins return: array param: int $courseid |
get_plugins_export($courseid) X-Ref |
Get information export plugins return: array param: int $courseid |
get_user_field_value($user, $field) X-Ref |
Returns the value of a field from a user record return: string value of the field param: stdClass $user object param: stdClass $field object |
get_user_profile_fields($courseid, $includecustomfields = false) X-Ref |
Returns an array of user profile fields to be included in export return: array An array of stdClass instances with customid, shortname, datatype, default and fullname fields param: int $courseid param: bool $includecustomfields |
fetch_all_natural_weights_for_course($courseid) X-Ref |
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. return: array of itemid -> aggregationcoef2 param: int $courseid |
reset_caches() X-Ref |
Resets all static caches. return: void |