diff --git a/question/question.php b/question/question.php index e63c603b63e..e96da88b894 100644 --- a/question/question.php +++ b/question/question.php @@ -202,7 +202,9 @@ if ($mform->is_cancelled()){ close_window(); } else { $nexturl = new moodle_url($returnurl); - $nexturl->param('lastchanged', $question->id); + if (!empty($question->id)) { + $nexturl->param('lastchanged', $question->id); + } redirect($nexturl->out()); } } elseif ($fromform = $mform->get_data()) {