This class iterates over all users that are graded in a course.
More...
|
| __construct ($course, $grade_items=null, $groupid=0, $sortfield1='lastname', $sortorder1='ASC', $sortfield2='firstname', $sortorder2='ASC') |
| Constructor. More...
|
|
| allow_user_custom_fields ($allow=true) |
| Allow custom fields to be included. More...
|
|
| close () |
| Close the iterator, do not forget to call this function.
|
|
| init () |
| Initialise the iterator. More...
|
|
| next_user () |
| Returns information about the next user. More...
|
|
| require_active_enrolment ($onlyactive=true) |
| Should all enrolled users be exported or just those with an active enrolment? More...
|
|
|
| $allowusercustomfields = false |
| Enable user custom fields.
|
|
| $course |
| The couse whose users we are interested in.
|
|
| $grade_items |
| An array of grade items or null if only user data was requested.
|
|
| $grades_rs |
| A recordset of user grades (grade_grade instances)
|
|
| $gradestack |
| Array used when moving to next user while iterating through the grades recordset.
|
|
| $groupid |
| The group ID we are interested in. More...
|
|
| $onlyactive = false |
| Should users whose enrolment has been suspended be ignored?
|
|
| $sortfield1 |
| The first field of the users table by which the array of users will be sorted.
|
|
| $sortfield2 |
| The second field of the users table by which the array of users will be sorted.
|
|
| $sortorder1 |
| Should sortfield1 be ASC or DESC.
|
|
| $sortorder2 |
| Should sortfield2 be ASC or DESC.
|
|
| $suspendedusers = array() |
| List of suspended users in course. More...
|
|
| $users_rs |
| A recordset of graded users.
|
|
This class iterates over all users that are graded in a course.
Returns detailed info about users and their grades.
- Author
- Petr Skoda skoda.nosp@m.k@mo.nosp@m.odle..nosp@m.org
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ __construct()
graded_users_iterator::__construct |
( |
|
$course, |
|
|
|
$grade_items = null , |
|
|
|
$groupid = 0 , |
|
|
|
$sortfield1 = 'lastname' , |
|
|
|
$sortorder1 = 'ASC' , |
|
|
|
$sortfield2 = 'firstname' , |
|
|
|
$sortorder2 = 'ASC' |
|
) |
| |
Constructor.
- Parameters
-
object | $course | A course object |
array | $grade_items | array of grade items, if not specified only user info returned |
int | $groupid | iterate only group users if present |
string | $sortfield1 | The first field of the users table by which the array of users will be sorted |
string | $sortorder1 | The order in which the first sorting field will be sorted (ASC or DESC) |
string | $sortfield2 | The second field of the users table by which the array of users will be sorted |
string | $sortorder2 | The order in which the second sorting field will be sorted (ASC or DESC) |
◆ allow_user_custom_fields()
graded_users_iterator::allow_user_custom_fields |
( |
|
$allow = true | ) |
|
Allow custom fields to be included.
- Parameters
-
bool | $allow | Whether to allow custom fields or not |
- Return values
-
◆ init()
graded_users_iterator::init |
( |
| ) |
|
Initialise the iterator.
- Return values
-
◆ next_user()
graded_users_iterator::next_user |
( |
| ) |
|
Returns information about the next user.
- Return values
-
mixed | array of user info, all grades and feedback or null when no more users found |
◆ require_active_enrolment()
graded_users_iterator::require_active_enrolment |
( |
|
$onlyactive = true | ) |
|
Should all enrolled users be exported or just those with an active enrolment?
- Parameters
-
bool | $onlyactive | True to limit the export to users with an active enrolment |
◆ $groupid
graded_users_iterator::$groupid |
|
protected |
The group ID we are interested in.
0 means all groups.
◆ $suspendedusers
graded_users_iterator::$suspendedusers = array() |
|
protected |
List of suspended users in course.
This includes users whose enrolment status is suspended or enrolment has expired or not started.
The documentation for this class was generated from the following file: