Course Archiver

Admin tools ::: tool_coursearchiver
Maintained by Matthew Davidson
Archive and remove past courses with this handy tool that can also be used to send notifications to course teachers, hide courses in bulk, and has the ability for course teachers to opt out of the archiving.
Latest release:
561 sites
176 downloads
67 fans
Current versions available: 1

Course Archiver

This tool is used to search for courses, notify the course owners, and mass hide or archive (backup and remove) courses. The courses are stored with Moodle's backup file extension ".mbz". These files can then be manually found in the user defined folder and can be restored using Moodle's built in restore feature.

Install

copy the coursearchiver folder into the admin/tool folder.

Settings

Folder path

A folder created within the moodledata folder. The tool will create this folder, however it is recommended that the folder be created outside the moodledata folder, and a shortcut be placed in the moodledata folder.

Course Hide Email

This is the template email that will be sent to the owners of the selected courses to notify them that their course(s) will be hidden. There are two required variables in the email %to (name of the recipient) and %courses (a list of courses with mailto hyperlinks to notify the site administrator that the user wishes to opt out)

Course Archive Email

This is the template email that will be sent to the owners of the selected courses to notify them that their course(s) will be archived. There are two required variables in the email %to (name of the recipient) and %courses (a list of courses with mailto hyperlinks to notify the site administrator that the user wishes to opt out)

Course opt out persistence

A course can be opted out of the archival process and future archiver searches. This setting determines how many months the opt out with last.

Archive deletion delay

When an archived file is selected for deletion, the actual removal of the file will be delayed by x days.

Archive search limiter

Archives can get very large. This limits the amount of records returned to screen at one time.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4

Contributors

Matthew Davidson (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Tue, Oct 13, 2015, 12:11 AM
  • Tue, Oct 13, 2015, 3:29 AM
    I like the idea of your plugin. Besides the coding checker issues reported above, here are some other considerations:

    1) Your CSS styles in styles.css are too general. You have .error_text, .bar, and .progress_bar. These might have CSS style conflicts with other themes. So you might be affecting other areas of Moodle outside your own plugin. Consider namespacing your styles by prefixing your tool name in front of the style names.
    2) Your LICENSE file says GPL2, but Moodle now uses GPL3.
    3) For get_courses_and_their_owners(): https://github.com/Syxton/moodle-admin_coursearchiver/blob/master/classes/processor.php#L321 You are using a hard-coded roleid of 3. I am not sure which role you are looking for. Use role shortname or use role archetype, or have the roleid be a config setting. You are using the roleid of 3 in other areas as well.
  • Tue, Oct 13, 2015, 10:14 PM
    I have worked to fix everything you have mentioned. How can I get the plugins bot to run again?
  • Thu, Oct 29, 2015, 5:14 PM

    Hi Matthew. I just encountered an issue with cross-db compatibility and reported it to your tracker. I'll mark the plugin as needing more work now to see if we can sort that out. Thanks for your patience with the review and approval process.

  • Tue, Nov 3, 2015, 4:27 AM
    David, Thanks for letting me know. I just made an additional change that will fix the issues in postgres.
  • Fri, Nov 6, 2015, 1:22 AM
    Matthew, looks like you addressed all of David's and my concerns. I am not sure how to re-invoke the CI bot, but maybe it is automatic when you upload a new version.

    You can always run the code checkers yourself:
    * https://moodle.org/plugins/view/local_codechecker
    * https://moodle.org/plugins/view/local_moodlecheck

    Otherwise, looks good to go.
  • Fri, Nov 6, 2015, 8:11 AM
  • Fri, Nov 6, 2015, 8:14 AM

    Hi guys. CI bot prechecker is not executed automatically yet (but I hope it will be soon). In any case, thanks Matthew for the fixes, and thanks Rex for the peer-review. I am happy to approve this now. You are cleared to land, welcome to the Plugins directory!

  • Thu, Dec 31, 2015, 1:04 AM
    Silly question: I like the idea of this plugin. But the documentation is scant. For example, how do you un-archive?
  • Sun, Jan 17, 2016, 11:52 PM
    Thanks for a great plugin. Just one suggestion ... the resulting backup file in using archiving a course has a .zip extension. Anyway to change the extension to .mbz (the 'standard' extension of Moodle backup files)? With Moodle 2.9, for example, the backup is really a tar.gz ... not a zip. If testing the backup file created (the .zip) with unzip tool, it will report an error. If testing the extract of the .zip file using tar however, it extracts as expected ... a true moodle backup. Again ... great plugin! Thanks for creating and sharing.
  • Fri, Jan 27, 2017, 5:40 AM
    Hi, this looks like a very useful plugin! One problem though: I'm using Moodle 2.8 (Build: 20141113) and during installation I get the error "requires Moodle version 2015050500". Is that correct? I'm using the latest version of the plugin 3.x (Build: 2016090200) (2016090200) for Moodle 2.8, 2.9, 3.0, 3.1.... Any ideas?
  • Fri, Jan 27, 2017, 5:44 AM
    I'm sorry you are having this issue. I have a planned update to come soon. In the meantime, it will work in 2.8. In the version.php change the $plugin->requires to 2014111000;
  • Tue, Sep 5, 2017, 10:51 PM
    Hi, I am using Moodle 3.3 and the tool works fine, but somehow I cannot "select all" courses (only if I select the courses manually) and if I have a bunch of courses to archive or to delete, like 2000 or so, I can´t check every course manually, is there another way to select all courses? It´s step2.php.
  • Tue, Sep 5, 2017, 11:21 PM
    @tamas erdelyi Few questions: When you click the Select All button, it may take some. Other than waiting, what browser are you using? So I can try to fully duplicate your issue.
Please login to post comments