|
@@ -220,7 +220,17 @@ function gradeimporter_update_grades ($submission, $userid = 0, $nullifnone = tr
|
|
|
|
|
|
function gradeimporter_reset_gradebook ($courseid, $type = '') {
|
|
function gradeimporter_reset_gradebook ($courseid, $type = '') {
|
|
global $CFG, $DB;
|
|
global $CFG, $DB;
|
|
|
|
+ $tp = $CFG->prefix;
|
|
// Select all grades on gradebook and reset them
|
|
// Select all grades on gradebook and reset them
|
|
|
|
+ $sql = "SELECT gs.*
|
|
|
|
+ FROM {$tp}gradeimporter_submission as gs
|
|
|
|
+ JOIN {$tp}gradeimporter as g ON g.id = gs.gradeimporterid
|
|
|
|
+ WHERE g.course = $courseid";
|
|
|
|
+
|
|
|
|
+ $submissions = $DB->get_records_sql($sql);
|
|
|
|
+ foreach ($submissions as $submission) {
|
|
|
|
+ gradeimporter_grade_item_update($submission, 'reset');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function gradeimporter_get_user_grades($submission, $userid) {
|
|
function gradeimporter_get_user_grades($submission, $userid) {
|