Changing default assignment settings for Moodle Turnitin integration

The direct turnitin integration for Moodle is great, but there are a few tweaks necessary to set it up correctly. The default settings for a new assignment created through Moodle do not match the defaults in turnitin.com, and unlike turnitin.com there is not an option to save a selection of default settings (as far as I can tell through reading turnitin's limited documentation). However, even on turnitin.com, the defaults you save are course-wide not institution-wide, so not so helpful if your institutions policies are different to the turnitin defaults.

This is where using the integration gives you advantage over using turnitin.com, because you have access to the code! Open MOODLEDIR\mod\turnitintool\mod_form.php in a text editor, and you should find several lines of code like this:

$mform->setDefault('allowlate', 0);

You should be able to work out what most of them relate to by the first word after the open brackets - this word is the "name" attribute of the form element, the value following is the value to be used as default. So using the example above, if you wanted to change it so by default it allowed late submissions (I don't understand why this wouldn't be the default!), change the value at the end of this line to a 1.

I hope this helps some people, as I couldn't find any existing instructions on how to do this. I'd rather not hack the code of the plugin, as it is bound to come back and bite me after a future upgrade, but as far as I can tell - it's the only way to do it. If I've missed something really obvious here, please let me know in the comments.