Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-29447 quiz course reset does not reset the quiz_grades table.

Thank to Jean-Michel Vedrine for working out the basic idea of the fix.
  • Loading branch information...
commit 0d3a08237333302bf904d6a73c4d6a2043fe5ba2 1 parent 3973662
@timhunt timhunt authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 mod/quiz/lib.php
View
4 mod/quiz/lib.php
@@ -1269,12 +1269,14 @@ function quiz_reset_userdata($data) {
'error' => false);
// Remove all grades from gradebook
+ $DB->delete_records_select('quiz_grades',
+ 'quiz IN (SELECT id FROM {quiz} WHERE course = ?)', array($data->courseid));
if (empty($data->reset_gradebook_grades)) {
quiz_reset_gradebook($data->courseid);
}
$status[] = array(
'component' => $componentstr,
- 'item' => get_string('attemptsdeleted', 'quiz'),
+ 'item' => get_string('gradesdeleted', 'quiz'),
'error' => false);
}
Please sign in to comment.
Something went wrong with that request. Please try again.