Merge branch 'MDL-79307-403' of https://github.com/paulholden/moodle into MOODLE_403_STABLE

This commit is contained in:
Sara Arjona
2024-01-03 17:18:21 +01:00
2 changed files with 10 additions and 0 deletions
@@ -20,7 +20,9 @@ use core\task\adhoc_task;
use core\task\manager;
use assignfeedback_editpdf\document_services;
use assignfeedback_editpdf\combined_document;
use assignfeedback_editpdf\pdf;
use context_module;
use moodle_exception;
use assign;
/**
@@ -47,6 +49,13 @@ class convert_submission extends adhoc_task {
return;
}
// Early exit if ghostscript isn't correctly configured.
$result = pdf::test_gs_path(false);
if ($result->status !== pdf::GSPATH_OK) {
$statusstring = get_string('test_' . $result->status, 'assignfeedback_editpdf');
throw new moodle_exception('pathtogserror', 'assignfeedback_editpdf', '', $statusstring, $result->status);
}
$cm = get_coursemodule_from_instance('assign', $submission->assignment, 0, false, MUST_EXIST);
$context = context_module::instance($cm->id);
$assign = new assign($context, null, null);
@@ -59,6 +59,7 @@ $string['generatefeedback'] = 'Generate feedback PDF';
$string['gotopage'] = 'Go to page';
$string['green'] = 'Green';
$string['gsimage'] = 'Ghostscript test image';
$string['pathtogserror'] = 'The configured path to ghostscript is not correctly set: {$a}';
$string['pathtogspathdesc'] = 'Please note that annotate PDF requires the path to ghostscript to be set in {$a}.';
$string['highlight'] = 'Highlight';
$string['jsrequired'] = 'JavaScript is required to annotate a PDF. Please enable JavaScript in your browser to use this feature.';