diff --git a/mod/quiz/report/overview/report.php b/mod/quiz/report/overview/report.php index 5ba30b8015b..c80453b8f3e 100644 --- a/mod/quiz/report/overview/report.php +++ b/mod/quiz/report/overview/report.php @@ -634,11 +634,11 @@ class quiz_overview_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; } - if ($groupstudents && !array_key_exists($attempt->userid, $groupstudents)) { + if ($groupstudents && !in_array($attempt->userid, $groupstudents)) { // Additional check in groups mode. continue; } diff --git a/mod/quiz/report/responses/report.php b/mod/quiz/report/responses/report.php index b296fd68185..1c7fe7579b4 100644 --- a/mod/quiz/report/responses/report.php +++ b/mod/quiz/report/responses/report.php @@ -114,11 +114,11 @@ class quiz_responses_report extends quiz_default_report { // Ensure the attempt exists, and belongs to this quiz. If not skip. continue; } - if ($attemptsmode != QUIZ_REPORT_ATTEMPTS_ALL && !array_key_exists($attempt->userid, $students)) { + if ($attemptsmode != QUIZ_REPORT_ATTEMPTS_ALL && !in_array($attempt->userid, $students)) { // Ensure the attempt belongs to a student included in the report. If not skip. continue; } - if ($groupstudents && !array_key_exists($attempt->userid, $groupstudents)) { + if ($groupstudents && !in_array($attempt->userid, $groupstudents)) { // Additional check in groups mode. continue; }