Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250620) (7d9030acd6e)
grade_structure Class Reference

General structure representing grade items in course. More...

Inheritance diagram for grade_structure:
grade_seq grade_tree

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)
 
 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)
 
 get_edit_link (array $element, object $gpr)
 Returns a link leading to the edit grade/grade item/category page.
 
 get_element_header ()
 
 get_element_icon ()
 
 get_element_type_string ()
 
 get_grade_action_menu (grade_grade $grade)
 Returns an action menu for the grade.
 
 get_grade_analysis_icon (grade_grade $grade)
 
 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)
 
 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)
 
 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)
 
 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).
 

Detailed Description

General structure representing grade items in course.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ get_advanced_grading_link()

grade_structure::get_advanced_grading_link ( array $element,
object $gpr )

Returns link to the advanced grading page.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
Return values
string|null

◆ get_calculation_icon()

grade_structure::get_calculation_icon ( $element,
$gpr,
$returnactionmenulink = false )
Deprecated
since Moodle 4.2 - The row is not shown anymore - we have {
See also
core\output\action_menu}.

◆ get_cell_action_menu()

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.

Parameters
array$elementArray with cell info.
string$modeMode - gradeitem or user
grade_plugin_return$gpr
moodle_url | null$baseurl
Return values
string

◆ get_delete_link()

grade_structure::get_delete_link ( array $element,
object $gpr )

Returns a link to delete a given element.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
Return values
string|null

◆ get_duplicate_link()

grade_structure::get_duplicate_link ( array $element,
object $gpr )

Returns a link to duplicate a given element.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
Return values
string|null

◆ get_edit_calculation_link()

grade_structure::get_edit_calculation_link ( array $element,
object $gpr )

Returns link to edit calculation for a grade item.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
Return values
string|null

◆ get_edit_icon()

grade_structure::get_edit_icon ( $element,
$gpr,
$returnactionmenulink = false )
Deprecated
since Moodle 4.2 - The row is not shown anymore - we have {
See also
core\output\action_menu}.

◆ get_edit_link()

grade_structure::get_edit_link ( array $element,
object $gpr )

Returns a link leading to the edit grade/grade item/category page.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
Return values
string|null

◆ get_element_header()

grade_structure::get_element_header ( )
Deprecated
since Moodle 4.4 - please use {
See also
grade_helper::get_element_header()}

◆ get_element_icon()

grade_structure::get_element_icon ( )
Deprecated
since Moodle 4.4 - please use {
See also
grade_helper::get_element_icon()}

◆ get_element_type_string()

grade_structure::get_element_type_string ( )
Deprecated
since Moodle 4.4 - please use {
See also
grade_helper::get_element_type_string()}

◆ get_grade_action_menu()

grade_structure::get_grade_action_menu ( grade_grade $grade)

Returns an action menu for the grade.

Parameters
grade_grade$gradeA grade_grade object
Return values
string

◆ get_grade_analysis_icon()

grade_structure::get_grade_analysis_icon ( grade_grade $grade)
Deprecated
since Moodle 4.2 - The row is not shown anymore - we have {
See also
core\output\action_menu}.

◆ get_grade_analysis_link()

grade_structure::get_grade_analysis_link ( grade_grade $grade)

Returns a link leading to the grade analysis page.

Parameters
grade_grade$grade
Return values
string|null

◆ get_grade_analysis_url()

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.

Return values
moodle_url|nullURL or null if unable to construct it

◆ get_grade_eid()

grade_structure::get_grade_eid ( $grade_grade)

Returns the grade eid - the grade may not exist yet.

Parameters
grade_grade$grade_gradeA grade_grade object
Return values
stringeid

◆ get_hiding_icon()

grade_structure::get_hiding_icon ( $element,
$gpr,
$returnactionmenulink = false )
Deprecated
since Moodle 4.2 - The row is not shown anymore - we have {
See also
core\output\action_menu}.

◆ get_hiding_link()

grade_structure::get_hiding_link ( array $element,
object $gpr )

Returns a link with url to hide/unhide grade/grade item/grade category.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
Return values
string|null

◆ get_item_eid()

grade_structure::get_item_eid ( $grade_item)

Returns the grade_item eid.

Parameters
grade_item$grade_itemA grade_item object
Return values
stringeid

◆ get_locking_icon()

grade_structure::get_locking_icon ( $element,
$gpr )
Deprecated
since Moodle 4.2 - The row is not shown anymore - we have {
See also
core\output\action_menu}.

◆ get_locking_link()

grade_structure::get_locking_link ( array $element,
object $gpr )

Returns link to lock/unlock grade/grade item/grade category.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
Return values
string|null

◆ get_params_for_iconstr()

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.

Parameters
array$elementAn array representing an element in the grade_tree
Return values
array

◆ get_reset_icon()

grade_structure::get_reset_icon ( $element,
$gpr,
$returnactionmenulink = false )
Deprecated
since Moodle 4.2 - The row is not shown anymore - we have {
See also
core\output\action_menu}.

◆ get_reset_weights_link()

grade_structure::get_reset_weights_link ( array $element,
object $gpr )

Returns a link to reset weights for the given element.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
Return values
string|null

◆ get_sorting_link()

grade_structure::get_sorting_link ( moodle_url $sortlink,
object $gpr,
string $direction = 'asc' )

Returns link to sort grade item column.

Parameters
moodle_url$sortlinkA base link for sorting
object$gprA grade_plugin_return object
string$directionDirection od sorting
Return values
string

◆ set_grade_status_icons()

grade_structure::set_grade_status_icons ( array $element)

Sets status icons for the grade.

Parameters
array$elementarray with grade item info
Return values
string|nullstatus icons container HTML

Member Data Documentation

◆ $modinfo

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.


The documentation for this class was generated from the following file: