category grades and course grades should not be dependent on restore_userdata_selectee

This commit is contained in:
toyomoyo 2007-08-20 06:20:53 +00:00
parent 7e09821038
commit f9bb6a98d8
2 changed files with 5 additions and 2 deletions

View File

@ -1514,7 +1514,10 @@
// back up the other stuff here // back up the other stuff here
// mod grades should only be backed up if selected // mod grades should only be backed up if selected
if ($grade_item->itemtype == 'mod' && backup_userdata_selected($preferences,$grade_item->itemmodule,$grade_item->iteminstance)) { if ($grade_item->itemtype == 'mod' && !backup_userdata_selected($preferences,$grade_item->itemmodule,$grade_item->iteminstance)) {
// do not write grades if a mod grade_item is being restored
// but userdata is not selected
} else {
$status = backup_gradebook_grades_info($bf,$preferences,$grade_item->id); $status = backup_gradebook_grades_info($bf,$preferences,$grade_item->id);
$status = backup_gradebook_grades_text_info($bf,$preferences,$grade_item->id); $status = backup_gradebook_grades_text_info($bf,$preferences,$grade_item->id);
} }

View File

@ -1576,7 +1576,7 @@
} }
// no need to restore grades/grades_text if user data is not selected // no need to restore grades/grades_text if user data is not selected
if (!restore_userdata_selected($restore, $dbrec->itemmodule, $iteminstance)) { if ($dbrec->itemtype == 'mod' && !restore_userdata_selected($restore, $dbrec->itemmodule, $iteminstance)) {
// module instance not selected when restored using granular // module instance not selected when restored using granular
// skip this item // skip this item
$counteritems++; $counteritems++;