added names of unenrolled students to drop-down list of users names for which a report can be generated
This commit is contained in:
+22
-2
@@ -459,6 +459,17 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
|
||||
'existingstudents' => get_string('existingstudents')
|
||||
);
|
||||
$users = get_records_sql("
|
||||
SELECT
|
||||
u.id, u.firstname, u.lastname
|
||||
FROM
|
||||
{$CFG->prefix}user AS u,
|
||||
{$CFG->prefix}hotpot_attempts AS ha
|
||||
WHERE
|
||||
u.id = ha.userid AND ha.hotpot=$hotpot->id
|
||||
ORDER BY
|
||||
u.lastname
|
||||
");
|
||||
$students = get_records_sql("
|
||||
SELECT
|
||||
u.id, u.firstname, u.lastname
|
||||
FROM
|
||||
@@ -469,8 +480,17 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
|
||||
ORDER BY
|
||||
u.lastname
|
||||
");
|
||||
if ($users) {
|
||||
$menus['reportusers'][''] = '------'; // separator
|
||||
if (!empty($students)) {
|
||||
$menus['reportusers']['separator01'] = '------';
|
||||
foreach ($students as $id=>$user) {
|
||||
if (isset($users[$id])) {
|
||||
$menus['reportusers']["$id"] = fullname($user);
|
||||
unset($users[$id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($users)) {
|
||||
$menus['reportusers']['separator02'] = '------';
|
||||
foreach ($users as $id=>$user) {
|
||||
$menus['reportusers']["$id"] = fullname($user);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user