Download all Moodle Workshop submissions in one zip

Moodle's Workshop has no download all button. Our free report plugin zips every submission, a folder per student with the text, images and files, plus a CSV.

Drawing of a hand lifting a stack of cobalt and grey folders out of an open cardboard box.

Short answer: Moodle’s Assignment has a “Download all submissions” button and Workshop does not. Our free plugin, Workshop submissions download (report_workshopdownload), adds More > Download submissions to every workshop. One click gives a zip with a folder per student, named “Lastname Firstname - Title”, holding the text as a web page, its images and the attached files, plus a spreadsheet of every submission with its grade.

Teachers have asked for this in the Moodle tracker since 2013: MDL-40879 has 75 votes and is still open. The comments describe the same week: 50 to 150 students, each submission opened one at a time to read offline, print, or send to a plagiarism checker. The workarounds people posted take a course backup apart with XML scripts. We found no plugin for it in the Moodle plugins directory.

What is in the zip?

Peer review climate essays submissions.zip
  submissions.csv
  Benali Amira - Water cycle in arid regions/
    submission.html        the text, readable offline
    files/chart.png        images used in the text
    attachments/essay.pdf  attached files
  Hart Tom - Rivers and flooding/
    ...
  • submissions.csv: folder, author, title, last modified, grade for submission (out of the workshop’s maximum, an override wins), and how many assessments it has received so far. Dates are written year first so the column sorts.
  • Two submissions with the same name get “(2)”. Characters Windows refuses in folder names are removed.

Does it respect groups and anonymous marking?

Yes. In separate groups, a teacher without “Access all groups” gets only their own groups, and nothing when they are in no group. If a role cannot see author names in that workshop, folders become “Submission 1”, “Submission 2” and no names appear in the pages or the spreadsheet. Every download is logged with the number of submissions.

What it does not do yet

Version 0.1 downloads submissions and their grades, not the assessments or feedback. The zip is built when you click, so a workshop with several gigabytes of attachments can run into your server’s time or disk limits. Filters such as maths notation are not applied to the offline pages.

The code is on GitHub, for Moodle 4.5 to 5.3.

How we built it

  1. Workshop keeps a submission’s text in the workshop_submissions table, its images in the file area submission_content and its attachments in submission_attachment, both keyed by the submission id. The plugin reads them with Workshop’s own get_submissions() and the file API, and streams the files into the zip without copying them in memory.
  2. Only a report or a local plugin can add a link to an activity’s page; we used a report, which Moodle lists in the activity’s More menu.
  3. One trap: Moodle’s group menu returns “0” both for “all participants” and for a teacher who is in no group. Treating 0 as “everyone” would hand that teacher every submission, so the page checks “Access all groups” first, and a test proves it.
  4. Spreadsheet safety: a title starting with = could run as a formula in Excel, so those cells get a leading apostrophe.
  5. Tests: 15 PHPUnit tests (folder names, duplicates, hidden names, groups, grades, the zip itself, the log event) and 5 Behat scenarios with an accessibility check, on Moodle 4.5 to 5.3.

Need a plugin like this for your own Moodle?

Describe it in DevLMS Studio and watch it built and tested in a real Moodle, or ask our team for a fixed price.

Open DevLMS Studio