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.
This commit is contained in:
Tim Hunt
2011-10-04 22:47:44 +01:00
parent 228d24fd97
commit 8dd9ccf475
+3 -1
View File
@@ -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);
}