You are here: Start FH-Linz Moodle: Download an entire assignment
Moodle: Download an entire assignment PDF Print E-mail
Written by Andreas Böhler   
Wednesday, 28 April 2010 18:07

I'm a tutor at my university, correcting and marking programming assignments. Usually, students hand-in their assignments by Moodle. However, the current stable release requires to click on each student's assignment in order to download the file. Then, once on your harddrive, you still need to extract the data and manually match the files up with the student. This is a boring task and very time-consuming.

Finally, I wrote a simple python-parser that downloads and extracts all files for me.


The script is simple: It logs on to moodle, retrieves the assignment overview requested, parses the file, finds the file belonging to each student, downloads it and extracts it if it's a .zip or .rar archive. For every student, an own subfolder is created and the files are extracted into a directory corresponding to the assignment ID.

The assignment ID is the value you see appended to the URL when you click on an assignment. The URL looks something like: 

In this case, the ID is 9352. Call as follows:


Written and tested on Arch Linux, Python 2.6.5.

Lots of HTML stuff is hardcoded, so it's not very flexible and will probably break with your version of moodle! For now, it's fine for me. Get the attachment!


Download this file ([Simple Moodle Assignment Parser & Retriever]3 Kb
Comments (0)
Write comment
Your Contact Details:
[b] [i] [u] [url] [quote] [code] [img]   
Please input the anti-spam code that you can read in the image.
Last Updated on Wednesday, 28 April 2010 18:18
Template is Powered by © 2008 | CSS 2.1 | XHTML 1.0