mirror of
https://github.com/moodle/moodle.git
synced 2025-03-17 22:20:00 +01:00
Make a library function for deleting quiz attempts, rather than having duplicated code - Followup: make sure we only delete preview attempts. Merged from OU Moodle.
This commit is contained in:
parent
6be58b1c18
commit
ccac7305ea
@ -174,7 +174,7 @@
|
||||
if (!$attempt) {
|
||||
// Delete any previous preview attempts belonging to this user.
|
||||
if ($oldattempts = get_records_select('quiz_attempts', "quiz = '$quiz->id'
|
||||
AND userid = '$USER->id'")) {
|
||||
AND userid = '$USER->id' AND preview = 1")) {
|
||||
foreach ($oldattempts as $oldattempt) {
|
||||
quiz_delete_attempt($oldattempt, $quiz);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user