Merge branch 'MDL-63870_36' of https://github.com/timhunt/moodle into MOODLE_36_STABLE

This commit is contained in:
Eloy Lafuente (stronk7)
2019-01-23 00:09:37 +01:00
+2 -2
View File
@@ -2313,8 +2313,8 @@ function quiz_validate_new_attempt(quiz $quizobj, quiz_access_manager $accessman
// Check to see if a new preview was requested.
if ($quizobj->is_preview_user() && $forcenew) {
// To force the creation of a new preview, we mark the current attempt (if any)
// as finished. It will then automatically be deleted below.
$DB->set_field('quiz_attempts', 'state', quiz_attempt::FINISHED,
// as abandoned. It will then automatically be deleted below.
$DB->set_field('quiz_attempts', 'state', quiz_attempt::ABANDONED,
array('quiz' => $quizobj->get_quizid(), 'userid' => $USER->id));
}