Public Member Functions |
| | grade_tree ($courseid, $fillers=true, $category_grade_last=false, $collapsed=null, $nooutcomes=false) |
| | category_collapse (&$element, $collapsed) |
| | no_outcomes (&$element) |
| | category_grade_last (&$element) |
| | fill_levels (&$levels, &$element, $depth) |
| | inject_fillers (&$element, $depth) |
| | inject_colspans (&$element) |
| | locate_element ($eid) |
| | exporttoxml ($root=null, $tabs="\t") |
| | exporttojson ($root=null, $tabs="\t") |
| | get_levels () |
| | get_items () |
| | get_item ($itemid) |
Data Fields |
| | $top_element |
| | $levels |
| | $items |
Detailed Description
Definition at line 1701 of file lib.php.
Member Function Documentation
Static recursive helper - removes items from collapsed categories
- Parameters:
-
| array | &$element | The seed of the recursion |
| array | $collapsed | array of collapsed categories |
- Returns:
- void
Definition at line 1783 of file lib.php.
Static recursive helper - makes the grade_item for category the last children
- Parameters:
-
| array | &$element | The seed of the recursion |
- Returns:
- void
Definition at line 1836 of file lib.php.
Returns a JSON representation of the grade-tree using recursion.
- Parameters:
-
| array | $root | The current element in the recursion. If null, starts at the top of the tree. |
| string | $tabs | Tab characters used to indent the string nicely for humans to enjoy |
- Returns:
- string
Definition at line 2073 of file lib.php.
Returns a well-formed XML representation of the grade-tree using recursion.
- Parameters:
-
| array | $root | The current element in the recursion. If null, starts at the top of the tree. |
| string | $tabs | The control character to use for tabs |
- Returns:
- string $xml
Definition at line 2022 of file lib.php.
Static recursive helper - fills the levels array, useful when accessing tree elements of one level
- Parameters:
-
| array | &$levels | The levels of the grade tree through which to recurse |
| array | &$element | The seed of the recursion |
| int | $depth | How deep are we? |
- Returns:
- void
Definition at line 1863 of file lib.php.
Returns the array of grade items
- Returns:
- array
Definition at line 2139 of file lib.php.
Returns the array of levels
- Returns:
- array
Definition at line 2130 of file lib.php.
| grade_tree |
( |
$ |
courseid, |
|
|
$ |
fillers = true, |
|
|
$ |
category_grade_last = false, |
|
|
$ |
collapsed = null, |
|
|
$ |
nooutcomes = false |
|
) |
| |
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.
- Parameters:
-
| int | $courseid | The Course ID |
| bool | $fillers | include fillers and colspans, make the levels var "rectangular" |
| bool | $category_grade_last | category grade item is the last child |
| array | $collapsed | array of collapsed categories |
| bool | $nooutcomes | Whether or not outcomes should be included |
Definition at line 1731 of file lib.php.
Static recursive helper - add colspan information into categories
- Parameters:
-
| array | &$element | The seed of the recursion |
- Returns:
- int
Definition at line 1947 of file lib.php.
Static recursive helper - makes full tree (all leafes are at the same level)
- Parameters:
-
| array | &$element | The seed of the recursion |
| int | $depth | How deep are we? |
- Returns:
- int
Definition at line 1901 of file lib.php.
Parses the array in search of a given eid and returns a element object with information about the element it has found.
- Parameters:
-
| int | $eid | Gradetree Element ID |
- Returns:
- object element
Definition at line 1965 of file lib.php.
Static recursive helper - removes all outcomes
- Parameters:
-
| array | &$element | The seed of the recursion |
- Returns:
- void
Definition at line 1814 of file lib.php.
Field Documentation
2D array of grade items and categories
Definition at line 1713 of file lib.php.
The basic representation of the tree as a hierarchical, 3-tiered array.
Definition at line 1707 of file lib.php.
The documentation for this class was generated from the following file:
- C:/xampp/htdocs/moodle/grade/lib.php