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

Public Member Functions

 graded_users_iterator ($course, $grade_items=null, $groupid=0, $sortfield1='lastname', $sortorder1='ASC', $sortfield2='firstname', $sortorder2='ASC')
 init ()
 next_user ()
 close ()
 _push ($grade)
 _pop ()

Data Fields

 $course
 $grade_items
 $groupid
 $users_rs
 $grades_rs
 $gradestack
 $sortfield1
 $sortorder1
 $sortfield2
 $sortorder2

Detailed Description

This class iterates over all users that are graded in a course. Returns detailed info about users and their grades.

Author:
Petr Skoda <skodak@moodle.org> http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Definition at line 35 of file lib.php.


Member Function Documentation

_pop ( )

_pop

Returns:
object current grade object

Definition at line 275 of file lib.php.

Here is the caller graph for this function:

_push ( grade)

_push

Parameters:
grade_grade$gradeGrade object
Returns:
void

Definition at line 265 of file lib.php.

Here is the caller graph for this function:

close ( )

Close the iterator, do not forget to call this function.

Returns:
void

Definition at line 245 of file lib.php.

Here is the caller graph for this function:

graded_users_iterator ( course,
grade_items = null,
groupid = 0,
sortfield1 = 'lastname',
sortorder1 = 'ASC',
sortfield2 = 'firstname',
sortorder2 = 'ASC' 
)

Constructor

Parameters:
object$courseA course object
array$grade_itemsarray of grade items, if not specified only user info returned
int$groupiditerate only group users if present
string$sortfield1The first field of the users table by which the array of users will be sorted
string$sortorder1The order in which the first sorting field will be sorted (ASC or DESC)
string$sortfield2The second field of the users table by which the array of users will be sorted
string$sortorder2The order in which the second sorting field will be sorted (ASC or DESC)

Definition at line 58 of file lib.php.

init ( )

Initialise the iterator

Returns:
boolean success

Definition at line 76 of file lib.php.

Here is the call graph for this function:

next_user ( )

Returns information about the next user

Returns:
mixed array of user info, all grades and feedback or null when no more users found

Definition at line 178 of file lib.php.

Here is the call graph for this function:


Field Documentation

Definition at line 36 of file lib.php.

$grade_items

Definition at line 37 of file lib.php.

$grades_rs

Definition at line 40 of file lib.php.

$gradestack

Definition at line 41 of file lib.php.

$groupid

Definition at line 38 of file lib.php.

$sortfield1

Definition at line 42 of file lib.php.

$sortfield2

Definition at line 44 of file lib.php.

$sortorder1

Definition at line 43 of file lib.php.

$sortorder2

Definition at line 45 of file lib.php.

$users_rs

Definition at line 39 of file lib.php.


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