danmarsden / moodle-plagiarism_urkund

Ouriginal plagiarism plugin for Moodle (previously called Urkund)
https://ouriginal.com/
12 stars 19 forks source link

"final" submissions don't work (sometimes?) because of missing constant 'ASSIGNSUBMISSION_FILE_FILEAREA' #37

Closed thepurpleblob closed 9 years ago

thepurpleblob commented 9 years ago

We found that files 'finalised' but student pressing submit button did not get sent to Urkund. Checking cron logs...

finalise

Notice: Use of undefined constant ASSIGNSUBMISSION_FILE_FILEAREA - assumed     'ASSIGNSUBMISSION_FILE_FILEAREA' in /var/www/html/moodle/plagiarism/urkund/lib.php on line 555

This would make sense as this would prevent the files being read from the assignment file area. The plugin links mod/assign/locallib.php just before this but this constant is not defined in that file. It's defined in mod/assign/submission/file/locallib.php - which should be included by the constructor in assignments class but for some reason has not been.

This works on our test box but not on our production box.

I'm not sure if this is a local issue (assignment works fine) or something very subtle in the way these plugins work or with permissions on our server.

Anyway - do you think this might be made more robust as a lot of steps have to work properly for that constant to exist and it's game over if it does not.

EDIT: Before you ask what I would ask. We checked file permissions et al very carefully and cannot see any obvious reason for this sub-plugin to be skipped during cron execution. Thinking about it some more, should the code for the assignment file uploads not simply include mod/assign/submission/file/locallib.php directly to avoid any possible issues.

danmarsden commented 9 years ago

Thanks for tracking that one down Howard! easy to add another include, I've done that and published the new version in the moodle.org plugins db