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

Public Member Functions

 __construct ($courseid, $gpr, $context, $page=null)
 process_data ($data)
 process_action ($target, $action)
 get_lang_string ($strcode, $section=null)
 get_numusers ($groups=true)

Static Public Member Functions

 get_pref ($pref, $objectid=null)
 set_pref ($pref, $pref_value='default', $itemid=null)

Data Fields

 $courseid
 $course
 $gpr
 $context
 $gtree
 $prefs = array()
 $gradebookroles
 $baseurl
 $pbarurl
 $page
 $lang_strings = array()
 $currentgroup
 $groupmode
 $group_selector

Protected Member Functions

 setup_groups ()
 get_sort_arrow ($direction='move', $sortlink=null)
 blank_hidden_total ($courseid, $course_item, $finalgrade)

Protected Attributes

 $groupsql
 $groupwheresql
 $groupwheresql_params = array()

Detailed Description

Definition at line 30 of file lib.php.


Constructor & Destructor Documentation

__construct ( courseid,
gpr,
context,
page = 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)

Reimplemented in grade_report_user.

Definition at line 142 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

blank_hidden_total ( courseid,
course_item,
finalgrade 
) [protected]

Optionally blank out course/category totals if they contain any hidden items

Parameters:
string$courseidthe course id
string$course_iteman instance of grade_item
string$finalgradethe grade for the course_item
Returns:
string The new final grade

Definition at line 349 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_lang_string ( strcode,
section = null 
)

First checks the cached language strings, then returns match if found, or uses get_string() to get it from the DB, caches it then returns it.

Parameters:
string$strcode
string$sectionOptional language section
Returns:
string

Definition at line 260 of file lib.php.

Here is the caller graph for this function:

get_numusers ( groups = true)

Fetches and returns a count of all the users that will be shown on this page.

Parameters:
boolean$groupsinclude groups limit
Returns:
int Count of users

Definition at line 272 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_pref ( pref,
objectid = null 
) [static]

Given the name of a user preference (without grade_report_ prefix), locally saves then returns the value of that preference. If the preference has already been fetched before, the saved value is returned. If the preference is not set at the User level, the $CFG equivalent is given (site default). (Can be called statically, but then doesn't benefit from caching)

Parameters:
string$prefThe name of the preference (do not include the grade_report_ prefix)
int$objectidAn optional itemid or categoryid to check for a more fine-grained preference
Returns:
mixed The value of the preference

Definition at line 180 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_sort_arrow ( direction = 'move',
sortlink = null 
) [protected]

Returns an arrow icon inside an tag, for the purpose of sorting a column.

Parameters:
string$direction
moodle_url$sort_link
stringHTML

Definition at line 333 of file lib.php.

Here is the call graph for this function:

process_action ( target,
action 
) [abstract]

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

Parameters:
string$targetSortorder
string$actionWhich action to take (edit, delete etc...)
Returns:

Reimplemented in grade_report_grader, grade_report_user, and grade_report_overview.

process_data ( data) [abstract]

Handles form data sent by this report for this report. Abstract method to implement in all children.

Parameters:
array$data
Returns:
mixed True or array of errors

Reimplemented in grade_report_user, grade_report_overview, and grade_report_grader.

set_pref ( pref,
pref_value = 'default',
itemid = null 
) [static]

Uses set_user_preferences() to update the value of a user preference. If 'default' is given as the value, the preference will be removed in favour of a higher-level preference.

Parameters:
string$pref_nameThe name of the preference.
mixed$pref_valueThe value of the preference.
int$itemidAn optional itemid to which the preference will be assigned
Returns:
bool Success or failure.

Definition at line 228 of file lib.php.

Here is the call graph for this function:

setup_groups ( ) [protected]

Sets up this object's group variables, mainly to restrict the selection of users to display.

find out current groups mode

Definition at line 309 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:


Field Documentation

string $baseurl

base url for sorting by first/last name.

Reimplemented in grade_report_user.

Definition at line 76 of file lib.php.

int $context

The context.

Definition at line 52 of file lib.php.

The course.

Definition at line 41 of file lib.php.

int $courseid

The courseid.

Definition at line 35 of file lib.php.

int $currentgroup

The current group being displayed.

Definition at line 102 of file lib.php.

object $gpr

Grade plugin return tracking object.

Definition at line 46 of file lib.php.

string $gradebookroles

The roles for this report.

Definition at line 70 of file lib.php.

string $group_selector

A HTML select element used to select the current group.

Definition at line 114 of file lib.php.

int $groupmode

Current course group mode

Definition at line 108 of file lib.php.

string $groupsql [protected]

An SQL fragment used to add linking information to the group tables.

Definition at line 120 of file lib.php.

string $groupwheresql [protected]

An SQL constraint to append to the queries used by this object to build the report.

Definition at line 126 of file lib.php.

array $groupwheresql_params = array() [protected]

The ordered params for $groupwheresql

Definition at line 132 of file lib.php.

object $gtree

The grade_tree object.

Reimplemented in grade_report_user.

Definition at line 58 of file lib.php.

array $lang_strings = array()

Array of cached language strings (using get_string() all the time takes a long time!).

Definition at line 94 of file lib.php.

int $page

Current page (for paging).

Definition at line 88 of file lib.php.

string $pbarurl

base url for paging.

Reimplemented in grade_report_user.

Definition at line 82 of file lib.php.

array $prefs = array()

User preferences related to this report.

Definition at line 64 of file lib.php.


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