Skip to content

Commit

Permalink
MDL-68733 quiz editing: be more careful deleting random question tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Bence Molnar authored and timhunt committed May 19, 2020
1 parent ea5c0c6 commit 3427a6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mod/quiz/editrandom.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
// Now, delete the remaining records.
if (!empty($recordstokeep)) {
list($select, $params) = $DB->get_in_or_equal($recordstokeep, SQL_PARAMS_QM, 'param', false);
$DB->delete_records_select('quiz_slot_tags', "id $select", $params);
$DB->delete_records_select('quiz_slot_tags', "slotid = {$slot->id} AND id $select", $params);
} else {
$DB->delete_records('quiz_slot_tags', array('slotid' => $slot->id));
}
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2580,7 +2580,7 @@ function($carry, $slottag) use ($slottags, $tagsbyid, $tagsbyname) {
}
}

$carry[$slottag->slotid][] = $slottag;
$carry[$slottag->slotid][$slottag->id] = $slottag;
return $carry;
},
$emptytagids
Expand Down

0 comments on commit 3427a6e

Please sign in to comment.