Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 310 and 401] [Versions 39 and 401]

Provides support for the conversion of moodle1 backup to the moodle2 format

Copyright: 2011 Rossiani Wijaya <rwijaya@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 303 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

moodle1_mod_lesson_handler:: (9 methods):
  get_paths()
  process_lesson()
  on_lesson_pages_start()
  process_lesson_page()
  process_lesson_answer()
  on_lesson_page_end()
  on_lesson_pages_end()
  on_lesson_end()
  write_single_page_xml()


Class: moodle1_mod_lesson_handler  - X-Ref

Lesson conversion handler

get_paths()   X-Ref
Declare the paths in moodle.xml we are able to convert

The method returns list of {@link convert_path} instances.
For each path returned, the corresponding conversion method must be
defined.

Note that the path /MOODLE_BACKUP/COURSE/MODULES/MOD/LESSON does not
actually exist in the file. The last element with the module name was
appended by the moodle1_converter class.

return: array of {@link convert_path} instances

process_lesson($data)   X-Ref
This is executed every time we have one /MOODLE_BACKUP/COURSE/MODULES/MOD/LESSON
data available


on_lesson_pages_start()   X-Ref
No description

process_lesson_page($data)   X-Ref
This is executed every time we have one /MOODLE_BACKUP/COURSE/MODULES/MOD/LESSON/PAGES/PAGE
data available


process_lesson_answer($data)   X-Ref
This is executed every time we have one /MOODLE_BACKUP/COURSE/MODULES/MOD/LESSON/PAGES/PAGE/ANSWERS/ANSWER
data available


on_lesson_page_end()   X-Ref
No description

on_lesson_pages_end()   X-Ref
No description

on_lesson_end()   X-Ref
This is executed when we reach the closing </MOD> tag of our 'lesson' path


write_single_page_xml($page, $prevpageid=0, $nextpageid=0)   X-Ref
writes out the given page into the open xml handle

param: type $page
param: type $prevpageid
param: type $nextpageid