MDL-56810 unoconv: task fails if user removed

If the user is removed from a course after a submission has been made,
the task will crash and never continue.  This removes submissions from
the cron task if the user isn't enrolled in the course.
This commit is contained in:
Matt Davidson
2016-12-13 14:56:52 +00:00
committed by Dan Poltawski
parent ce47bacfe9
commit cc15b9d46f
@@ -92,14 +92,18 @@ class convert_submissions extends scheduled_task {
mtrace('Convert ' . count($users) . ' submission attempt(s) for assignment ' . $assignmentid);
foreach ($users as $userid) {
document_services::get_page_images_for_attempt($assignment,
$userid,
$attemptnumber,
true);
document_services::get_page_images_for_attempt($assignment,
$userid,
$attemptnumber,
false);
try {
document_services::get_page_images_for_attempt($assignment,
$userid,
$attemptnumber,
true);
document_services::get_page_images_for_attempt($assignment,
$userid,
$attemptnumber,
false);
} catch (\moodle_exception $e) {
mtrace('Conversion failed with error:' . $e->errorcode);
}
}
$DB->delete_records('assignfeedback_editpdf_queue', array('id' => $record->id));