Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
|
General structure representing grade items in course. More...
Public Member Functions | |
get_advanced_grading_link (array $element, object $gpr) | |
Returns link to the advanced grading page. | |
get_calculation_icon ($element, $gpr, $returnactionmenulink=false) | |
Return calculation icon for given element. | |
get_cell_action_menu (array $element, string $mode, grade_plugin_return $gpr, ?moodle_url $baseurl=null) | |
Returns an action menu for the grade. | |
get_delete_link (array $element, object $gpr) | |
Returns a link to delete a given element. | |
get_duplicate_link (array $element, object $gpr) | |
Returns a link to duplicate a given element. | |
get_edit_calculation_link (array $element, object $gpr) | |
Returns link to edit calculation for a grade item. | |
get_edit_icon ($element, $gpr, $returnactionmenulink=false) | |
Return edit icon for give element. | |
get_edit_link (array $element, object $gpr) | |
Returns a link leading to the edit grade/grade item/category page. | |
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. | |
get_element_icon (&$element, $spacerifnone=false) | |
Returns icon of element. | |
get_element_type_string (array $element) | |
Returns the string that describes the type of the element. | |
get_grade_action_menu (grade_grade $grade) | |
Returns an action menu for the grade. | |
get_grade_analysis_icon (grade_grade $grade) | |
Returns an action icon leading to the grade analysis page. | |
get_grade_analysis_link (grade_grade $grade) | |
Returns a link leading to the grade analysis page. | |
get_grade_analysis_url (grade_grade $grade) | |
Returns URL of a page that is supposed to contain detailed grade analysis. | |
get_grade_eid ($grade_grade) | |
Returns the grade eid - the grade may not exist yet. | |
get_hiding_icon ($element, $gpr, $returnactionmenulink=false) | |
Return hiding icon for give element. | |
get_hiding_link (array $element, object $gpr) | |
Returns a link with url to hide/unhide grade/grade item/grade category. | |
get_item_eid ($grade_item) | |
Returns the grade_item eid. | |
get_locking_icon ($element, $gpr) | |
Return locking icon for given element. | |
get_locking_link (array $element, object $gpr) | |
Returns link to lock/unlock grade/grade item/grade category. | |
get_params_for_iconstr ($element) | |
Given a grade_tree element, returns an array of parameters used to build an icon for that element. | |
get_reset_icon ($element, $gpr, $returnactionmenulink=false) | |
Return a reset icon for the given element. | |
get_reset_weights_link (array $element, object $gpr) | |
Returns a link to reset weights for the given element. | |
get_sorting_link (moodle_url $sortlink, object $gpr, string $direction='asc') | |
Returns link to sort grade item column. | |
set_grade_status_icons (array $element) | |
Sets status icons for the grade. | |
Public Attributes | |
$context | |
$courseid | |
$items | |
1D array of grade items only | |
course_modinfo | $modinfo |
Reference to modinfo for current course (for performance, to save retrieving it from courseid every time). | |
General structure representing grade items in course.
grade_structure::get_advanced_grading_link | ( | array | $element, |
object | $gpr ) |
Returns link to the advanced grading page.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string|null |
grade_structure::get_calculation_icon | ( | $element, | |
$gpr, | |||
$returnactionmenulink = false ) |
Return calculation icon for given element.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
bool | $returnactionmenulink | return the instance of action_menu_link instead of string |
string|action_menu_link |
grade_structure::get_cell_action_menu | ( | array | $element, |
string | $mode, | ||
grade_plugin_return | $gpr, | ||
?moodle_url | $baseurl = null ) |
Returns an action menu for the grade.
array | $element | Array with cell info. |
string | $mode | Mode - gradeitem or user |
grade_plugin_return | $gpr | |
moodle_url | null | $baseurl |
string |
grade_structure::get_delete_link | ( | array | $element, |
object | $gpr ) |
Returns a link to delete a given element.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string|null |
grade_structure::get_duplicate_link | ( | array | $element, |
object | $gpr ) |
Returns a link to duplicate a given element.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string|null |
grade_structure::get_edit_calculation_link | ( | array | $element, |
object | $gpr ) |
Returns link to edit calculation for a grade item.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string|null |
grade_structure::get_edit_icon | ( | $element, | |
$gpr, | |||
$returnactionmenulink = false ) |
Return edit icon for give element.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
bool | $returnactionmenulink | return the instance of action_menu_link instead of string |
string|action_menu_link |
grade_structure::get_edit_link | ( | array | $element, |
object | $gpr ) |
Returns a link leading to the edit grade/grade item/category page.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string|null |
grade_structure::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.
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 |
grade_structure::get_element_icon | ( | & | $element, |
$spacerifnone = false ) |
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 |
grade_structure::get_element_type_string | ( | array | $element | ) |
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 |
grade_structure::get_grade_action_menu | ( | grade_grade | $grade | ) |
Returns an action menu for the grade.
grade_grade | $grade | A grade_grade object |
string |
grade_structure::get_grade_analysis_icon | ( | grade_grade | $grade | ) |
Returns an action icon leading to the grade analysis page.
grade_grade | $grade |
string |
grade_structure::get_grade_analysis_link | ( | grade_grade | $grade | ) |
Returns a link leading to the grade analysis page.
grade_grade | $grade |
string|null |
grade_structure::get_grade_analysis_url | ( | grade_grade | $grade | ) |
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.
moodle_url|null | URL or null if unable to construct it |
grade_structure::get_grade_eid | ( | $grade_grade | ) |
Returns the grade eid - the grade may not exist yet.
grade_grade | $grade_grade | A grade_grade object |
string | eid |
grade_structure::get_hiding_icon | ( | $element, | |
$gpr, | |||
$returnactionmenulink = false ) |
Return hiding icon for give element.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
bool | $returnactionmenulink | return the instance of action_menu_link instead of string |
string|action_menu_link |
grade_structure::get_hiding_link | ( | array | $element, |
object | $gpr ) |
Returns a link with url to hide/unhide grade/grade item/grade category.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string|null |
grade_structure::get_item_eid | ( | $grade_item | ) |
Returns the grade_item eid.
grade_item | $grade_item | A grade_item object |
string | eid |
grade_structure::get_locking_icon | ( | $element, | |
$gpr ) |
Return locking icon for given element.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string |
grade_structure::get_locking_link | ( | array | $element, |
object | $gpr ) |
Returns link to lock/unlock grade/grade item/grade category.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string|null |
grade_structure::get_params_for_iconstr | ( | $element | ) |
Given a grade_tree element, returns an array of parameters used to build an icon for that element.
array | $element | An array representing an element in the grade_tree |
array |
grade_structure::get_reset_icon | ( | $element, | |
$gpr, | |||
$returnactionmenulink = false ) |
Return a reset icon for the given element.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
bool | $returnactionmenulink | return the instance of action_menu_link instead of string |
string|action_menu_link |
grade_structure::get_reset_weights_link | ( | array | $element, |
object | $gpr ) |
Returns a link to reset weights for the given element.
array | $element | An array representing an element in the grade_tree |
object | $gpr | A grade_plugin_return object |
string|null |
grade_structure::get_sorting_link | ( | moodle_url | $sortlink, |
object | $gpr, | ||
string | $direction = 'asc' ) |
Returns link to sort grade item column.
moodle_url | $sortlink | A base link for sorting |
object | $gpr | A grade_plugin_return object |
string | $direction | Direction od sorting |
string |
grade_structure::set_grade_status_icons | ( | array | $element | ) |
Sets status icons for the grade.
array | $element | array with grade item info |
string|null | status icons container HTML |
course_modinfo grade_structure::$modinfo |
Reference to modinfo for current course (for performance, to save retrieving it from courseid every time).
Not actually set except for the grade_tree type.