Permalink
Browse files

Merge branch 'MDL-60014-master-catcherror-nopermission-annotatepdfcro…

  • Loading branch information...
dmonllao committed Jul 3, 2018
2 parents 772ae9d + 88c77c8 commit 2af5c8e7ef642424c8100d3b53b8f43d2f9a2b3c
Showing with 13 additions and 17 deletions.
  1. +13 −17 mod/assign/feedback/editpdf/classes/task/convert_submissions.php
@@ -92,20 +92,18 @@ public function execute() {
}
mtrace('Convert ' . count($users) . ' submission attempt(s) for assignment ' . $assignmentid);
$keepinqueue = false;
foreach ($users as $userid) {
$combineddocument = document_services::get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber);
$status = $combineddocument->get_status();
switch ($combineddocument->get_status()) {
case combined_document::STATUS_READY:
case combined_document::STATUS_PENDING_INPUT:
// The document has not been converted yet or is somehow still ready.
$keepinqueue = true;
continue;
}
foreach ($users as $userid) {
try {
$combineddocument = document_services::get_combined_pdf_for_attempt($assignment, $userid, $attemptnumber);
$status = $combineddocument->get_status();
switch ($combineddocument->get_status()) {
case combined_document::STATUS_READY:
case combined_document::STATUS_PENDING_INPUT:
// The document has not been converted yet or is somehow still ready.
continue;
}
document_services::get_page_images_for_attempt(
$assignment,
$userid,
@@ -120,14 +118,12 @@ public function execute() {
);
} catch (\moodle_exception $e) {
mtrace('Conversion failed with error:' . $e->errorcode);
$keepinqueue = true;
}
}
if (!$keepinqueue) {
// Remove from queue unless requested not to.
$DB->delete_records('assignfeedback_editpdf_queue', array('id' => $record->id));
}
// Remove from queue.
$DB->delete_records('assignfeedback_editpdf_queue', array('id' => $record->id));
}
}

0 comments on commit 2af5c8e

Please sign in to comment.