From 17d339ea8e73a6f1fddb20306b55ee34512c7364 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 1 Dec 2011 16:29:10 +0000 Subject: [PATCH] MDL-27314 quiz attempts cannot be deleted in separate groups mode. --- mod/quiz/report/overview/report.php | 4 ++-- mod/quiz/report/responses/report.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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; }