mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
We don't show unenrolled users in quiz reports normally
This commit is contained in:
parent
c5684cd720
commit
69ef01c00d
1 changed files with 9 additions and 9 deletions
|
@ -54,11 +54,11 @@ class quiz_report extends quiz_default_report {
|
||||||
/// Now the tricky part: if there are people with attempts but they have been unenrolled
|
/// Now the tricky part: if there are people with attempts but they have been unenrolled
|
||||||
/// since making those attempts, count them in as well. DO NOT count course teachers.
|
/// since making those attempts, count them in as well. DO NOT count course teachers.
|
||||||
|
|
||||||
$userswithattempts = get_records_sql('SELECT DISTINCT qa.userid AS id, qa.userid FROM '.$CFG->prefix.'quiz_attempts qa LEFT JOIN '.$CFG->prefix.'user_teachers ut ON qa.userid = ut.userid AND ut.course = '.$course->id.' WHERE ut.id IS NULL AND quiz = '.$quiz->id);
|
//$userswithattempts = get_records_sql('SELECT DISTINCT qa.userid AS id, qa.userid FROM '.$CFG->prefix.'quiz_attempts qa LEFT JOIN '.$CFG->prefix.'user_teachers ut ON qa.userid = ut.userid AND ut.course = '.$course->id.' WHERE ut.id IS NULL AND quiz = '.$quiz->id);
|
||||||
if(!empty($userswithattempts)) {
|
//if(!empty($userswithattempts)) {
|
||||||
$unenrolledusers = array_diff(array_keys($userswithattempts), $users);
|
//$unenrolledusers = array_diff(array_keys($userswithattempts), $users);
|
||||||
$users = array_merge($users, $unenrolledusers);
|
//$users = array_merge($users, $unenrolledusers);
|
||||||
}
|
//}
|
||||||
|
|
||||||
if(empty($users)) {
|
if(empty($users)) {
|
||||||
print_heading($strnoattempts);
|
print_heading($strnoattempts);
|
||||||
|
@ -285,11 +285,11 @@ class quiz_report extends quiz_default_report {
|
||||||
if (!$download) {
|
if (!$download) {
|
||||||
$picture = print_user_picture($attempt->userid, $course->id, $attempt->picture, false, true);
|
$picture = print_user_picture($attempt->userid, $course->id, $attempt->picture, false, true);
|
||||||
|
|
||||||
if(in_array($attempt->userid, $unenrolledusers)) {
|
// if(in_array($attempt->userid, $unenrolledusers)) {
|
||||||
$userlink = '<a class="dimmed" href="'.$CFG->wwwroot.'/user/view.php?id='.$attempt->userid.'&course='.$course->id.'">'.fullname($attempt).'</a>';
|
// $userlink = '<a class="dimmed" href="'.$CFG->wwwroot.'/user/view.php?id='.$attempt->userid.'&course='.$course->id.'">'.fullname($attempt).'</a>';
|
||||||
} else {
|
// } else {
|
||||||
$userlink = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$attempt->userid.'&course='.$course->id.'">'.fullname($attempt).'</a>';
|
$userlink = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$attempt->userid.'&course='.$course->id.'">'.fullname($attempt).'</a>';
|
||||||
}
|
// }
|
||||||
|
|
||||||
$rowdata = array(
|
$rowdata = array(
|
||||||
$picture,
|
$picture,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue