Skip to content

Commit

Permalink
Merge branch 'MDL-25553_lesson_jumpto_wip' of git://github.com/stronk…
Browse files Browse the repository at this point in the history
…7/moodle
  • Loading branch information
skodak committed Feb 14, 2011
2 parents 47a13ff + bd9e662 commit a60a943
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mod/lesson/backup/moodle2/restore_lesson_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,17 @@ protected function after_execute() {
}
$rs->close();

// Remap all the restored 'jumpto' fields now that we have all the pages and their mappings
$rs = $DB->get_recordset('lesson_answers', array('lessonid' => $this->task->get_activityid()),
'', 'id, jumpto');
foreach ($rs as $answer) {
if ($answer->jumpto > 0) {
$answer->jumpto = $this->get_mappingid('lesson_page', $answer->jumpto);
$DB->update_record('lesson_answers', $answer);
}
}
$rs->close();

// TODO: somewhere at the end of the restore... when all the activities have been restored
// TODO: we need to decode the lesson->activitylink that points to another activity in the course
// TODO: great functionality that breaks self-contained principles, grrr
Expand Down

0 comments on commit a60a943

Please sign in to comment.