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

Public Member Functions

 __construct ($courseid, $gpr, $context, $page=null, $sortitemid=null)
 process_data ($data)
 load_users ()
 load_final_grades ()
 get_toggles_html ()
 print_toggle ($type)
 get_left_rows ()
 get_right_rows ()
 get_grade_table ()
 get_left_icons_row ($rows=array(), $colspan=1)
 get_left_range_row ($rows=array(), $colspan=1)
 get_left_avg_row ($rows=array(), $colspan=1, $groupavg=false)
 get_right_icons_row ($rows=array())
 get_right_range_row ($rows=array())
 get_right_avg_row ($rows=array(), $grouponly=false)
 process_action ($target, $action)
 is_fixed_students ()
 get_sort_arrows (array $extrafields=array())

Data Fields

 $grades
 $gradeserror = array()
 $sortitemid
 $sortorder
 $userselect
 $userselectparams = array()
 $collapsed
 $rowcount = 0
 $canviewhidden
 $preferencespage = false

Protected Member Functions

 get_icons ($element)
 get_collapsing_icon ($element)

Protected Attributes

 $feedback_trunc_length = 50

Detailed Description

Definition at line 31 of file lib.php.


Constructor & Destructor Documentation

__construct ( courseid,
gpr,
context,
page = null,
sortitemid = null 
)

Constructor. Sets local copies of user preferences and initialises grade_tree.

Parameters:
int$courseid
object$gprgrade plugin return tracking object
string$context
int$pageThe current page being viewed (when report is paged)
int$sortitemidThe id of the grade_item by which to sort the table

Definition at line 104 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

get_collapsing_icon ( element) [protected]

Given a category element returns collapsing +/- icon if available

Parameters:
object$object
Returns:
string HTML

Definition at line 1490 of file lib.php.

Here is the call graph for this function:

Depending on the style of report (fixedstudents vs traditional one-table), arranges the rows of data in one or two tables, and returns the output of these tables in HTML

Returns:
string HTML

Definition at line 1059 of file lib.php.

Here is the call graph for this function:

get_icons ( element) [protected]

Given a grade_category, grade_item or grade_grade, this function figures out the state of the object and builds then returns a div with the icons needed for the grader report.

Parameters:
array$object
Returns:
string HTML

Definition at line 1444 of file lib.php.

Here is the call graph for this function:

get_left_avg_row ( rows = array(),
colspan = 1,
groupavg = false 
)

Builds and return the headers for the rows of averages, for the left part of the grader report.

Parameters:
array$rowsThe Array of rows for the left part of the report
int$colspanThe number of columns this cell has to span
bool$groupavgIf true, returns the row for group averages, otherwise for overall averages
Returns:
array Array of rows for the left part of the report

Definition at line 1151 of file lib.php.

get_left_icons_row ( rows = array(),
colspan = 1 
)

Builds and return the row of icons for the left side of the report. It only has one cell that says "Controls"

Parameters:
array$rowsThe Array of rows for the left part of the report
int$colspanThe number of columns this cell has to span
Returns:
array Array of rows for the left part of the report

Definition at line 1102 of file lib.php.

get_left_range_row ( rows = array(),
colspan = 1 
)

Builds and return the header for the row of ranges, for the left part of the grader report.

Parameters:
array$rowsThe Array of rows for the left part of the report
int$colspanThe number of columns this cell has to span
Returns:
array Array of rows for the left part of the report

Definition at line 1125 of file lib.php.

Builds and returns the rows that will make up the left part of the grader report This consists of student names and icons, links to user reports and id numbers, as well as header cells for these columns. It also includes the fillers required for the categories displayed on the right side of the report.

Returns:
array Array of html_table_row objects

Definition at line 554 of file lib.php.

Here is the call graph for this function:

get_right_avg_row ( rows = array(),
grouponly = false 
)

Builds and return the row of averages for the right part of the grader report.

Parameters:
array$rowsWhether to return only group averages or all averages.
bool$grouponlyWhether to return only group averages or all averages.
Returns:
array Array of rows for the right part of the report

Definition at line 1263 of file lib.php.

Here is the call graph for this function:

get_right_icons_row ( rows = array())

Builds and return the row of icons when editing is on, for the right part of the grader report.

Parameters:
array$rowsThe Array of rows for the right part of the report
Returns:
array Array of rows for the right part of the report

Definition at line 1200 of file lib.php.

get_right_range_row ( rows = array())

Builds and return the row of ranges for the right part of the grader report.

Parameters:
array$rowsThe Array of rows for the right part of the report
Returns:
array Array of rows for the right part of the report

Definition at line 1227 of file lib.php.

Builds and returns the rows that will make up the right part of the grader report

Returns:
array Array of html_table_row objects

Definition at line 682 of file lib.php.

Here is the call graph for this function:

get_sort_arrows ( array extrafields = array())

Refactored function for generating HTML of sorting links with matching arrows. Returns an array with 'studentname' and 'idnumber' as keys, with HTML ready to inject into a table header cell.

Parameters:
array$extrafieldsArray of extra fields being displayed, such as user idnumber
Returns:
array An associative array of HTML sorting links+arrows

Definition at line 1596 of file lib.php.

Here is the call graph for this function:

Builds and returns a div with on/off toggles.

Returns:
string HTML code

Definition at line 463 of file lib.php.

Here is the call graph for this function:

Returns whether or not to display fixed students column. Includes a browser check, because IE6 doesn't support the scrollbar.

Returns:
bool

Definition at line 1576 of file lib.php.

Here is the call graph for this function:

we supply the userids in this query, and get all the grades pulls out all the grades, this does not need to worry about paging

Definition at line 424 of file lib.php.

pulls out the userids of the users to be display, and sorts them

Definition at line 333 of file lib.php.

Here is the call graph for this function:

print_toggle ( type)

Shortcut function for printing the grader report toggles.

Parameters:
string$typeThe type of toggle
bool$returnWhether to return the HTML string rather than printing it
Returns:
void

Definition at line 503 of file lib.php.

Here is the call graph for this function:

process_action ( target,
action 
)

Processes a single action against a category, grade_item or grade.

Parameters:
string$targeteid ({type}{id}, e.g. c4 for category4)
string$actionWhich action to take (edit, delete etc...)
Returns:

Reimplemented from grade_report.

Definition at line 1525 of file lib.php.

Here is the call graph for this function:

process_data ( data)

Processes the data sent by the form (grades and feedbacks). Caller is responsible for all access control checks

Parameters:
array$dataform submission (with magic quotes)
Returns:
array empty array if success, array of warnings if something fails.

Reimplemented from grade_report.

Definition at line 156 of file lib.php.

Here is the call graph for this function:


Field Documentation

$canviewhidden

Capability check caching

Definition at line 85 of file lib.php.

array $collapsed

List of collapsed categories from user preference

Definition at line 74 of file lib.php.

int $feedback_trunc_length = 50 [protected]

Length at which feedback will be truncated (to the nearest word) and an ellipsis be added. TODO replace this by a report preference

Definition at line 94 of file lib.php.

array $grades

The final grades.

Definition at line 36 of file lib.php.

array $gradeserror = array()

Array of errors for bulk grades updating.

Definition at line 42 of file lib.php.

$preferencespage = false

Definition at line 87 of file lib.php.

int $rowcount = 0

A count of the rows, used for css classes.

Definition at line 80 of file lib.php.

int $sortitemid

The id of the grade_item by which this report will be sorted.

Definition at line 50 of file lib.php.

int $sortorder

Sortorder used in the SQL selections.

Definition at line 56 of file lib.php.

string $userselect

An SQL fragment affecting the search for users.

Definition at line 62 of file lib.php.

array $userselectparams = array()

The bound params for $userselect

Definition at line 68 of file lib.php.


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