quiz reports MDL-22847 Cannot delete quiz attempts when a group is selected.
This commit is contained in:
@@ -622,7 +622,7 @@ class quiz_overview_report extends quiz_default_report {
|
||||
global $DB, $COURSE;
|
||||
foreach($attemptids as $attemptid) {
|
||||
$attempt = $DB->get_record('quiz_attempts', array('id' => $attemptid));
|
||||
if ($groupstudents && !in_array($attempt->userid, $groupstudents)) {
|
||||
if ($groupstudents && !array_key_exists($attempt->userid, $groupstudents)) {
|
||||
continue;
|
||||
}
|
||||
add_to_log($COURSE->id, 'quiz', 'delete attempt', 'report.php?id=' . $cm->id,
|
||||
|
||||
@@ -115,7 +115,7 @@ class quiz_responses_report extends quiz_default_report {
|
||||
require_capability('mod/quiz:deleteattempts', $context);
|
||||
foreach ($attemptids as $attemptid) {
|
||||
$attempt = $DB->get_record('quiz_attempts', array('id' => $attemptid));
|
||||
if ($groupstudents && !in_array($attempt->userid, $groupstudents)) {
|
||||
if ($groupstudents && !array_key_exists($attempt->userid, $groupstudents)) {
|
||||
continue;
|
||||
}
|
||||
add_to_log($course->id, 'quiz', 'delete attempt', 'report.php?id=' . $cm->id,
|
||||
|
||||
Reference in New Issue
Block a user