Skip to content

Commit

Permalink
quiz reports MDL-22847 Cannot delete quiz attempts when a group is se…
Browse files Browse the repository at this point in the history
…lected.
  • Loading branch information
timhunt committed Jun 23, 2010
1 parent e1d8a75 commit cd0a2ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mod/quiz/report/overview/report.php
Expand Up @@ -622,7 +622,7 @@ function delete_selected_attempts($quiz, $cm, $attemptids, $groupstudents){
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,
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/report/responses/report.php
Expand Up @@ -115,7 +115,7 @@ function display($quiz, $cm, $course) {
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,
Expand Down

0 comments on commit cd0a2ed

Please sign in to comment.