The Moodle course backup system uses a simple XML file format to store activity data. Moodle core calls the functions in the backuplib.php
file for all of the modules in a course. If backuplib.php
is missing, the backup will execute without errors. However, none of our activities or learner results will be saved. This leads to lost user data! The user doesn't realize that the data is missing until they go to restore the course. The restore functions for an activity are stored in restorelib.php
. Note that the backup and restore system is being completely re-written for Moodle 2.0, but the intention is to make it backward compatible. Activity Foo! uses a modified copy of the 'choice' module's restore code.
Here is an example of the XML for an instance of an activity:
<MOD> <ID>80</ID> <TYPE>foo</TYPE> <INSTANCE>1</INSTANCE> <ADDED>1250743636</ADDED> <SCORE>0</SCORE> <INDENT>0</INDENT...