### Eclipse Workspace Patch 1.0
#P Moodle 2
Index: mod/lesson/backup/moodle2/restore_lesson_stepslib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/mod/lesson/backup/moodle2/restore_lesson_stepslib.php,v
retrieving revision 1.6
diff -u -r1.6 restore_lesson_stepslib.php
--- mod/lesson/backup/moodle2/restore_lesson_stepslib.php	18 Sep 2010 12:31:20 -0000	1.6
+++ mod/lesson/backup/moodle2/restore_lesson_stepslib.php	9 Feb 2011 21:03:07 -0000
@@ -181,6 +181,16 @@
         }
         $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

