Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-38282_24' of git://github.com/timhunt/moodle into M…

…OODLE_24_STABLE
  • Loading branch information...
commit fa1a43c43eac3e0acc53ef578ae13536e76a6a6c 2 parents 099b798 + 97f7bfc
@damyon damyon authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 mod/quiz/edit.php
View
7 mod/quiz/edit.php
@@ -277,8 +277,11 @@ function module_specific_controls($totalnumber, $recurse, $category, $cmid, $cmo
if ($remove && confirm_sesskey()) {
// Remove a question from the quiz.
// We require the user to have the 'use' capability on the question,
- // so that then can add it back if they remove the wrong one by mistake.
- quiz_require_question_use($remove);
+ // so that then can add it back if they remove the wrong one by mistake,
+ // but, if the question is missing, it can always be removed.
+ if ($DB->record_exists('question', array('id' => $remove))) {
+ quiz_require_question_use($remove);
+ }
quiz_remove_question($quiz, $remove);
quiz_delete_previews($quiz);
quiz_update_sumgrades($quiz);
Please sign in to comment.
Something went wrong with that request. Please try again.