Permalink
Browse files

MDL-32102 Course completion - only restore user completion if not add…

…ing to existing course
  • Loading branch information...
1 parent ead4f18 commit cbed6472b4f0ba470dacb3eb6dc1c19414a4b5ce @danmarsden danmarsden committed Apr 22, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 backup/moodle2/restore_final_task.class.php
@@ -60,8 +60,11 @@ public function build() {
$this->add_step(new restore_gradebook_structure_step('gradebook_step','gradebook.xml'));
}
- // Course completion
- $this->add_step(new restore_course_completion_structure_step('course_completion', 'completion.xml'));
+ // Course completion, executed conditionally if restoring to new course
+ if ($this->get_target() !== backup::TARGET_CURRENT_ADDING &&
+ $this->get_target() !== backup::TARGET_EXISTING_ADDING) {
+ $this->add_step(new restore_course_completion_structure_step('course_completion', 'completion.xml'));
+ }
// Review all the module_availability records in backup_ids in order
// to match them with existing modules / grade items.

0 comments on commit cbed647

Please sign in to comment.