Skip to content

Commit

Permalink
MDL-55955 mod_quiz: ensure duplicated override events are removed
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Dec 22, 2016
1 parent 5100c48 commit cc4fba8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mod/quiz/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1194,8 +1194,11 @@ function quiz_update_events($quiz, $override = null) {
'instance'=>$quiz->id);
if (!empty($override)) {
// Only load events for this override.
$conds['groupid'] = isset($override->groupid)? $override->groupid : 0;
$conds['userid'] = isset($override->userid)? $override->userid : 0;
if (isset($override->userid)) {
$conds['userid'] = $override->userid;
} else {
$conds['groupid'] = $override->groupid;
}
}
$oldevents = $DB->get_records('event', $conds);

Expand Down

0 comments on commit cc4fba8

Please sign in to comment.