Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | List of all members
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_calculation_icon ($element, $gpr, $returnactionmenulink=false)
 Return calculation icon for given element. More...
 
 get_edit_icon ($element, $gpr, $returnactionmenulink=false)
 Return edit icon for give element. More...
 
 get_element_header (&$element, $withlink=false, $icon=true, $spacerifnone=false, $withdescription=false, $fulltotal=false)
 Returns name of element optionally with icon and link. More...
 
 get_element_icon (&$element, $spacerifnone=false)
 Returns icon of element. More...
 
 get_grade_analysis_icon (grade_grade $grade)
 Returns an action icon leading to the grade analysis page. More...
 
 get_grade_analysis_url (grade_grade $grade)
 Returns URL of a page that is supposed to contain detailed grade analysis. More...
 
 get_grade_eid ($grade_grade)
 Returns the grade eid - the grade may not exist yet. More...
 
 get_hiding_icon ($element, $gpr, $returnactionmenulink=false)
 Return hiding icon for give element. More...
 
 get_item_eid ($grade_item)
 Returns the grade_item eid. More...
 
 get_locking_icon ($element, $gpr)
 Return locking icon for given element. More...
 
 get_params_for_iconstr ($element)
 Given a grade_tree element, returns an array of parameters used to build an icon for that element. More...
 
 get_reset_icon ($element, $gpr, $returnactionmenulink=false)
 Return a reset icon for the given element. More...
 

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). More...
 

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_calculation_icon()

grade_structure::get_calculation_icon (   $element,
  $gpr,
  $returnactionmenulink = false 
)

Return calculation icon for given element.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
bool$returnactionmenulinkreturn the instance of action_menu_link instead of string
Return values
string|action_menu_link

◆ get_edit_icon()

grade_structure::get_edit_icon (   $element,
  $gpr,
  $returnactionmenulink = false 
)

Return edit icon for give element.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
bool$returnactionmenulinkreturn the instance of action_menu_link instead of string
Return values
string|action_menu_link

◆ get_element_header()

grade_structure::get_element_header ( $element,
  $withlink = false,
  $icon = true,
  $spacerifnone = false,
  $withdescription = false,
  $fulltotal = false 
)

Returns name of element optionally with icon and link.

Parameters
array&$elementAn array representing an element in the grade_tree
bool$withlinkWhether or not this header has a link
bool$iconWhether or not to display an icon with this header
bool$spacerifnonereturn spacer if no icon found
bool$withdescriptionShow description if defined by this item.
bool$fulltotalIf the item is a category total, returns $categoryname."total" instead of "Category total" or "Course total"
Return values
stringheader

◆ get_element_icon()

grade_structure::get_element_icon ( $element,
  $spacerifnone = false 
)

Returns icon of element.

Parameters
array&$elementAn array representing an element in the grade_tree
bool$spacerifnonereturn spacer if no icon found
Return values
stringicon or spacer

◆ get_grade_analysis_icon()

grade_structure::get_grade_analysis_icon ( grade_grade  $grade)

Returns an action icon leading to the grade analysis page.

Parameters
grade_grade$grade
Return values
string

◆ 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 
)

Return hiding icon for give element.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
bool$returnactionmenulinkreturn the instance of action_menu_link instead of string
Return values
string|action_menu_link

◆ 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 
)

Return locking icon for given element.

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

◆ 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 
)

Return a reset icon for the given element.

Parameters
array$elementAn array representing an element in the grade_tree
object$gprA grade_plugin_return object
bool$returnactionmenulinkreturn the instance of action_menu_link instead of string
Return values
string|action_menu_link

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: