This NodeJS command-line application accompanies the Export attempts quiz report for Moodle. It helps provide the bulk download feature by taking a file of instructions from the report, and based on the steps in there downloading all the Review sheets as PDF files, and any attachments to responses, and then putting them all in a Zip file.
The PDF generation uses the Puppeteer API to control a headless Chromium. How to use this script is documented within the Export attempts report.
This is a node application, so you need to have npm installed. (I recommend doing that using nvm.)
Standard node thing:
npm install
then you can do
node . instruction-file.txt
to run it.
To only download data for one user, you can do
node . --download-only X1234567 instruction-file.txt
Remember to update the version number in showVersionAndExit before building.
We build the exe version using nexe
, so you need to have that installed. Finding a version that works
can be tricky, but node 14.15.3 currently does.
npm install -g nexe
Then to build:
nexe save-answersheets.js
then you will have a save-answersheets.exe
In order to distribute that
in a way that works, you need that file, and the whole node_modules\puppeteer
folder. I suggest zipping those together.