Moodle  2.2.1
http://www.collinsharper.com
grade_edit_tree Class Reference

Public Member Functions

 __construct ($gtree, $moving=false, $gpr)
 build_html_tree ($element, $totals, $parents, $level, &$row_count)
 get_weight_input ($item, $type)
 format_number ($number)
 element_deletable ($element)
 move_elements ($eids, $returnurl)
 get_deepest_level ($element, $level=0, $deepest_level=1)

Data Fields

 $columns = array()
 $gtree
 $gpr
 $moving
 $deepest_level
 $uses_extra_credit = false
 $uses_weight = false
 $table
 $categories = array()

Detailed Description

Definition at line 18 of file lib.php.


Constructor & Destructor Documentation

__construct ( gtree,
moving = false,
gpr 
)

Constructor

Definition at line 48 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

build_html_tree ( element,
totals,
parents,
level,
&$  row_count 
)

Recursive function for building the table holding the grade categories and items, with CSS indentation and styles.

Parameters:
array$elementThe current tree element being rendered
boolean$totalsWhether or not to print category grade items (category totals)
array$parentsAn array of parent categories for the current element (used for indentation and row classes)
Returns:
string HTML

prepare move target if needed

print the list items now

Definition at line 110 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

element_deletable ( element)

Given an element of the grade tree, returns whether it is deletable or not (only manual grade items are deletable)

Parameters:
array$element
Returns:
bool

Definition at line 397 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

format_number ( number)

Definition at line 383 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_deepest_level ( element,
level = 0,
deepest_level = 1 
)

Recurses through the entire grade tree to find and return the maximum depth of the tree. This should be run only once from the root element (course category), and is used for the indentation of the Name column's cells (colspan)

Parameters:
array$elementAn array of values representing a grade tree's element (all grade items in this case)
int$levelThe level of the current recursion
int$deepest_levelA value passed to each subsequent level of recursion and incremented if $level > $deepest_level
Returns:
int Deepest level

Definition at line 466 of file lib.php.

Here is the caller graph for this function:

get_weight_input ( item,
type 
)

Given a grade_item object, returns a labelled input if an aggregation coefficient (weight or extra credit) applies to it.

Parameters:
grade_item$item
stringtype "extra" or "weight": the type of the column hosting the weight input
Returns:
string HTML

Definition at line 351 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

move_elements ( eids,
returnurl 
)

Given the grade tree and an array of element ids (e.g. c15, i42), and expecting the 'moveafter' URL param, moves the selected items to the requested location. Then redirects the user to the given $returnurl

Parameters:
object$gtreeThe grade tree (a recursive representation of the grade categories and grade items)
array$eids
string$returnurl

Definition at line 427 of file lib.php.

Here is the call graph for this function:


Field Documentation

$categories = array()

Definition at line 44 of file lib.php.

$columns = array()

Definition at line 19 of file lib.php.

$deepest_level

Definition at line 36 of file lib.php.

$gpr

Definition at line 29 of file lib.php.

$gtree

Definition at line 24 of file lib.php.

$moving

Definition at line 34 of file lib.php.

Definition at line 42 of file lib.php.

$uses_extra_credit = false

Definition at line 38 of file lib.php.

$uses_weight = false

Definition at line 40 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations