netspotau/moodle-mod_assign — pull request #2 by davosmith (2012-03-20 21:40:06+00:00)
Title: Mod assign extra hooks

I've made a few small additions to the code which I hope are useful (there are a couple of hooks I'd like to add to allow submission plugins to do some processing when a student submits their work for grading, but I'll do them another night). The changes included in this patch are:

* Allowing plugins (both sorts) to preprocess the settings form data before the form is displayed (essential if any plugin wants to add a filemanager or editor element to the settings form)
* Checking for 'sesskey' when the user submits their work for grading (to prevent a malicious link from causing them to submit their work unintentionally)
* Ignore requests to submit assignments for marking when they are already submitted (this could happen if the user refreshes their page after submitting, or has multiple browser windows open at the same time and could cause extra notification emails to be sent, as well as spurious log entries; and would also be problematic if the extra hooks I've suggested at the top of this message were implemented).
* Ask the user to confirm when they are submitting for grading (the 'edit my submission' and 'submit assignment' buttons are very close together, and, from experience, I know how annoying it would be to have lots of students asking for their work to be reverted to draft, when they clicked on the submit button by accident).

I hope these patches are suitable and I'll let you know of anything else I come across whilst updating my uploadpdf plugin to work with mod_assign.