diff --git a/mod/quiz/report/attemptsreport.php b/mod/quiz/report/attemptsreport.php index f26b2ec7071..6c7ab35ea9e 100644 --- a/mod/quiz/report/attemptsreport.php +++ b/mod/quiz/report/attemptsreport.php @@ -360,7 +360,7 @@ abstract class quiz_attempt_report extends quiz_default_report { // Ensure the attempt exists, and belongs to this quiz. If not skip. continue; } - if ($allowed && !array_key_exists($attempt->userid, $allowed)) { + if ($allowed && !in_array($attempt->userid, $allowed)) { // Ensure the attempt belongs to a student included in the report. If not skip. continue; }