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:
tjhunt 2007-06-23 10:39:28 +00:00
parent 6be58b1c18
commit ccac7305ea

View File

@ -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);
}