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: http://moodle.your-site.com/mod/assignment/submissions.php?id=9352 

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

./parse_moodle.py -u YOUR_LOGIN -p YOUR_PASSWORD -i 9352

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!

 

Attachments:
Download this file (parse_moodle.py)parse_moodle.py[Simple Moodle Assignment Parser & Retriever]3 Kb
Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):S
:!::?::idea::arrow:
Security
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 www.schaffenskraft.info © 2008 | CSS 2.1 | XHTML 1.0