Skip to content

Commit

Permalink
Merge branch 'MDL-79307' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Jan 3, 2024
2 parents 4a9214f + 4cd9e76 commit 5f9310d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
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;

/**
Expand All @@ -47,6 +49,13 @@ public function execute() {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
$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.';
Expand Down

0 comments on commit 5f9310d

Please sign in to comment.