MDL-71909 assignfeedback_editpdf: Do not queue conversions when not on

Before this change conversion tasks would be queued for assignments that
did not have the pdf annotation method enabled.

The change will also prevent queing when the plugin is disabled.
This commit is contained in:
Neill Magill
2023-07-26 08:43:39 +01:00
parent b4cd63746a
commit 3a06a2f7dd
2 changed files with 37 additions and 0 deletions
@@ -51,6 +51,14 @@ class observer {
* @param \mod_assign\event\base $event The submission created/updated event.
*/
protected static function queue_conversion($event) {
$assign = $event->get_assign();
$plugin = $assign->get_feedback_plugin_by_type('editpdf');
if (!$plugin->is_visible() || !$plugin->is_enabled()) {
// The plugin is not enabled on this assignment instance, so nothing should be queued.
return;
}
$data = [
'submissionid' => $event->other['submissionid'],
'submissionattempt' => $event->other['submissionattempt'],