Course Backup
From Dokeos
Contents |
What is it?
This development allows to:
- create a backup of a course (as a zip-file)
- import a backup into a course
- copy course content between courses
- remove content from a course
For each of these actions, you can select some course resources or simply perform the action on all available resources. When you select a resource, all linked resources are also included in the action you take.
Course resources currently supported:
- announcements
- forums
- calendar events
- documents
- tests
- links
- learnpaths
- course description
PHP objects
Courses and Resources
There's a Course object which represents a Dokeos course and contains all resources (documents, links,...) from the corresponding Dokeos course. For every resources supported by this tool, there's a corresponding object (php-class) to store the contents of that resources.
CourseBuilder
The CourseBuilder makes it possible to create a Course object from a given Dokeos course.
CourseArchiver
The CourseArchiver can write a Course object to a zip-file and read a Course object from such a zip-file. When creating such a zip-file the archiver writes the whole Course object to a file (called course_info.dat) and copies all documents to the zip-file.
When reading from a zip, the Course object is restored from course_info.dat.
The documents are then unzipped and put into a temporary folder ( called dokeos/archives/CourseArchiver_something/ ) where the CourseRestorer class' methods will come and take the files it is looking for.
CourseRestorer
The CourseRestorer allows you to copy all resources from a Course object to a certain Dokeos course. By default the CourseRestorer places all its resources in the current Dokeos course (i.e. restoring from a uploaded backup). It is possible to specify a destination course (when copying resources to another course). It is also possible to specify what should be done with documenst with the same filename as existing documents.
- overwrite those files
- rename the imported files ( file.pdf becomes file_1.pdf )
- don't import the new files
The CourseRestorer also keeps the links between different resources (learnpath

