Merge branch 'MDL-49474' of git://github.com/jmvedrine/moodle
This commit is contained in:
@@ -69,7 +69,8 @@ class backup_lesson_activity_structure_step extends backup_activity_structure_st
|
||||
// alot goes into it but nothing relational other than course when will
|
||||
// need to be corrected upon restore
|
||||
$lesson = new backup_nested_element('lesson', array('id'), array(
|
||||
'course', 'name', 'practice', 'modattempts', 'usepassword', 'password',
|
||||
'course', 'name', 'intro', 'introformat', 'practice', 'modattempts',
|
||||
'usepassword', 'password',
|
||||
'dependency', 'conditions', 'grade', 'custom', 'ongoing', 'usemaxgrade',
|
||||
'maxanswers', 'maxattempts', 'review', 'nextpagedefault', 'feedback',
|
||||
'minquestions', 'maxpages', 'timelimit', 'retake', 'activitylink',
|
||||
@@ -189,6 +190,7 @@ class backup_lesson_activity_structure_step extends backup_activity_structure_st
|
||||
$timer->annotate_ids('user', 'userid');
|
||||
|
||||
// Annotate the file areas in user by the lesson module.
|
||||
$lesson->annotate_files('mod_lesson', 'intro', null);
|
||||
$lesson->annotate_files('mod_lesson', 'mediafile', null);
|
||||
$page->annotate_files('mod_lesson', 'page_contents', 'id');
|
||||
$answer->annotate_files('mod_lesson', 'page_answers', 'id');
|
||||
|
||||
@@ -54,6 +54,7 @@ class restore_lesson_activity_task extends restore_activity_task {
|
||||
static public function define_decode_contents() {
|
||||
$contents = array();
|
||||
|
||||
$contents[] = new restore_decode_content('lesson', array('intro'), 'lesson');
|
||||
$contents[] = new restore_decode_content('lesson_pages', array('contents'), 'lesson_page');
|
||||
$contents[] = new restore_decode_content('lesson_answers', array('answer', 'response'), 'lesson_answer');
|
||||
|
||||
|
||||
@@ -80,6 +80,11 @@ class restore_lesson_activity_structure_step extends restore_activity_structure_
|
||||
$data->completiontimespent = 0;
|
||||
}
|
||||
|
||||
if (!isset($data->intro)) {
|
||||
$data->intro = '';
|
||||
$data->introformat = FORMAT_HTML;
|
||||
}
|
||||
|
||||
// Compatibility with old backups with maxtime and timed fields.
|
||||
if (!isset($data->timelimit)) {
|
||||
if (isset($data->timed) && isset($data->maxtime) && $data->timed) {
|
||||
@@ -215,7 +220,8 @@ class restore_lesson_activity_structure_step extends restore_activity_structure_
|
||||
'answerid' => $answer->id));
|
||||
}
|
||||
|
||||
// Add lesson mediafile, no need to match by itemname (just internally handled context)
|
||||
// Add lesson files, no need to match by itemname (just internally handled context).
|
||||
$this->add_related_files('mod_lesson', 'intro', null);
|
||||
$this->add_related_files('mod_lesson', 'mediafile', null);
|
||||
// Add lesson page files, by lesson_page itemname
|
||||
$this->add_related_files('mod_lesson', 'page_contents', 'lesson_page');
|
||||
|
||||
Reference in New Issue
Block a user