Moodle  2.2.1
http://www.collinsharper.com
grade_tree Class Reference
Inheritance diagram for grade_tree:
Collaboration diagram for grade_tree:

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

category_collapse ( &$  element,
collapsed 
)

Static recursive helper - removes items from collapsed categories

Parameters:
array&$elementThe seed of the recursion
array$collapsedarray of collapsed categories
Returns:
void

Definition at line 1783 of file lib.php.

Here is the caller graph for this function:

category_grade_last ( &$  element)

Static recursive helper - makes the grade_item for category the last children

Parameters:
array&$elementThe seed of the recursion
Returns:
void

Definition at line 1836 of file lib.php.

Here is the caller graph for this function:

exporttojson ( root = null,
tabs = "\t" 
)

Returns a JSON representation of the grade-tree using recursion.

Parameters:
array$rootThe current element in the recursion. If null, starts at the top of the tree.
string$tabsTab characters used to indent the string nicely for humans to enjoy
Returns:
string

Definition at line 2073 of file lib.php.

exporttoxml ( root = null,
tabs = "\t" 
)

Returns a well-formed XML representation of the grade-tree using recursion.

Parameters:
array$rootThe current element in the recursion. If null, starts at the top of the tree.
string$tabsThe control character to use for tabs
Returns:
string $xml

Definition at line 2022 of file lib.php.

fill_levels ( &$  levels,
&$  element,
depth 
)

Static recursive helper - fills the levels array, useful when accessing tree elements of one level

Parameters:
array&$levelsThe levels of the grade tree through which to recurse
array&$elementThe seed of the recursion
int$depthHow deep are we?
Returns:
void

Definition at line 1863 of file lib.php.

Here is the caller graph for this function:

get_item ( itemid)

Returns a specific Grade Item

Parameters:
int$itemidThe ID of the grade_item object
Returns:
grade_item

Definition at line 2150 of file lib.php.

get_items ( )

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$courseidThe Course ID
bool$fillersinclude fillers and colspans, make the levels var "rectangular"
bool$category_grade_lastcategory grade item is the last child
array$collapsedarray of collapsed categories
bool$nooutcomesWhether or not outcomes should be included

Definition at line 1731 of file lib.php.

Here is the call graph for this function:

inject_colspans ( &$  element)

Static recursive helper - add colspan information into categories

Parameters:
array&$elementThe seed of the recursion
Returns:
int

Definition at line 1947 of file lib.php.

Here is the caller graph for this function:

inject_fillers ( &$  element,
depth 
)

Static recursive helper - makes full tree (all leafes are at the same level)

Parameters:
array&$elementThe seed of the recursion
int$depthHow deep are we?
Returns:
int

Definition at line 1901 of file lib.php.

Here is the caller graph for this function:

locate_element ( eid)

Parses the array in search of a given eid and returns a element object with information about the element it has found.

Parameters:
int$eidGradetree Element ID
Returns:
object element

Definition at line 1965 of file lib.php.

Here is the call graph for this function:

no_outcomes ( &$  element)

Static recursive helper - removes all outcomes

Parameters:
array&$elementThe seed of the recursion
Returns:
void

Definition at line 1814 of file lib.php.

Here is the caller graph for this function:


Field Documentation

Grade items

Reimplemented from grade_structure.

Definition at line 1719 of file lib.php.

array $levels

2D array of grade items and categories

Definition at line 1713 of file lib.php.

object $top_element

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:
 All Data Structures Namespaces Files Functions Variables Enumerations