Merge branch 'MDL-38282' of git://github.com/timhunt/moodle

This commit is contained in:
Damyon Wiese 2013-03-05 16:06:31 +08:00
commit ce91af8114

View File

@ -277,8 +277,11 @@ $remove = optional_param('remove', false, PARAM_INT);
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);