danmarsden/moodle-plagiarism_turnitin — pull request #7 by mattgibson (2011-11-10 14:27:51+00:00)
Title: Fixes for some cron errors and a change to how files are stored and retrieved.

Hi Dan.

I got some errors in cron when my dev machine had stuff in the event queue for a module I'd deleted. This fixes them by skipping and deleting any turnitin files that are orphaned.

I have also changed the turnitin files table to use the file pathname hash, not the contents hash. This allows direct retrieval of the files without any faffing about looping over all the area files and also acts as a unique identifier, whereas content hash can be duplicated if the same file is uploaded in two places, so it's not that useful.

I've changed all the places that referred to the contenthash, but you may need to double check this as I'm not 100% familiar with the code and may have not noticed something.

The upgrade seems to work for me but it may need a bit of testing to make sure.

Matt