You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Back up part of a course (#57). backupCourse(courseId, destDir, { sections, activities }) backs up only the given sections (with everything in them) and activities or resources, without people's data or the course's own parts (groups, blocks, badges, events…); the driver reads the file back and refuses it if it holds more than asked.
Restore it at a chosen place (#57). restoreCourse into an existing course returns the new sectionIds and activityIds, and takes sectionId (every restored activity into that section) or afterSectionId (the backup's sections as new sections after that one). Before the wizard, a backup from a newer Moodle, or with activity types the site doesn't offer, is refused instead of being restored partly and silently.
Know what a backup holds (#58). backupContents(file) reads a .mbz locally, with no browser or session: type, Moodle version, origin, sections, activities, plugins needed, whether it has users' data, each activity's dependencies outside the backup (restrictions, links, grade category), and what in it still identifies a person or a site (identifies). Restoring into an existing course also returns warnings naming the restrictions and links left broken.
Anonymous backups (#59). anonymizeBackup(file, destFile) writes a copy of a backup that names no person (user ids, authors, creators, modifiers…) and no site or course of origin, leaving content, settings and files as they are. A backup of part of a course is anonymous by default (anonymous: false keeps the metadata). See the backup page for what a neutral origin changes in a restore.
The moodle command gains backup-contents and anonymize-backup, which need no site or profile.
Several sites in one browser: documented in the browser concepts page (one profile can hold sessions for several sites; two accounts on one site need separate profiles).
Fixes
startQuizAttempt starts a quiz with a time limit (#56): it confirms Moodle's preflight dialog instead of waiting for a navigation that never comes, and also handles quizzes that open the attempt in a secure pop-up window. A quiz with a password is refused with a clear QuizError, and Moodle's own refusal message now reaches the error.
Internal
BackupError moved to the shared errors module; it's still exported the same way.
The .mbz reading and writing uses Node's zlib with a small tar reader and writer: no new dependency.