openwebwork / wwassignment

moodle webwork assignment activity module
Other
0 stars 7 forks source link

Ver3.1 #3

Closed mgage closed 7 years ago

mgage commented 7 years ago

This pull request updates the way that the cron jobs for uploading grades are triggered. This new method will work with Moodle 3.x

The old method watched for modifications to the moodle log file. The moodle logging mechanism has changed and no longer modifies the original log file hence the wwassignment cron job assumed no changes were made and it would not run. This new version watches the standard_logfile that is regularly updated by moodle.

To test (without setting debug flags). Create a moodle course with links to a webwork assignment. Check that the grades for that webwork assignment are all 0. Then do some of the assignment problems (you can do this as a professor if you wish, but it should also be tested with students). Recheck the grade book. If the grades have not already been transferred you can speed up the process by typing

cd /opt/htdocs/moodle/admin/cli php cron.php

in order to trigger the cron job from the command line.

There will be an item in the resulting listing that indicates that the the cron job for wwassignment has run (there should be no errors listed). The grades in the moodle gradebook should now be updated.

To see more detail you can set DEBUG and TRACE flags to 1 at the top of the file wwassignment/locallib. The messages will appear in the php_error log file. You can find it's location with

php -i |grep log

You can also uncomment lines that define LOG in webwork2/lib/WebworkSOAP.pm which will print progress messages to the apache error_log