This script automates the generation of individual student feedback PDFs, based on a spreadsheet (in CSV format) containing each student's personal details, marks and feedback. It can also email the feedback PDFs to students as they are generated.
Refer to the COOK10001 example Excel sheet and JSON file.
I recommend that you work from the JSON file without comments. MarksToPDF will accept comments in the config JSON file, but JSON validators like https://jsonlint.com won't work if you have comments.
If the tool reports a syntax error in the JSON, use https://jsonlint.com to debug the JSON.
You will need Node.js and npm installed. I have had success running the script on the Windows Subsystem for Linux on Windows 10, but I expect it would work well on other systems, even with older versions of Node.js.
-
Before running the script for the first time, run
npm install
to fetch dependencies. -
Prepare a CSV file with student marks. This should contain one row for every student (rows with no student number, or an invalid student number, will be ignored). The row containing the maximum available marks for each question should come before the first student row. If you are going to use the email functionality, make sure there is a column that contains student email addresses.
-
If there are students who should not receive feedback (e.g. suspected of academic misconduct), you can either delete their rows from the CSV, or mask the email addresses by prefixing them with XXXX or similar.
-
Prepare a configuration JSON file. There are various example JSON files included, which contain documentation explaining what is required. If you need advice, or you want to do something that does not appear possible, please contact Alan Thomas [email protected].
-
Familiarise yourself with the script's four command-line parameters. See the following documentation:
usage: node markstopdf [--ids 123456,345678,...] [--mail n] --config config.json --csv marks.csv
--ids list,of,ids optional: only generate PDFs for the given student IDs
--mail 1, --mail 2 optional: whether to email the generated PDFs
--mail 1: send all the emails to the subject coordinator
--mail 2: actually send an email to each student
--config config.json required: the JSON configuration file for this assignment
--csv marks.csv required: the CSV file containing the marks data
- Run the script. A typical invocation to generate PDFs without emailing them might look like:
$ node markstopdf.js --config info20003-2018-s1-a1.json --csv a1studentmarks.csv
If you have any questions or feedback, contact Alan Thomas [email protected].