diff --git a/mod_form.php b/mod_form.php index 2c9fd29..90f2bda 100644 --- a/mod_form.php +++ b/mod_form.php @@ -44,17 +44,21 @@ public function definition() { global $PAGE, $CFG; - $PAGE->requires->jquery(); - - $module = [ - 'name' => 'mod_coursework', - 'fullpath' => '/mod/coursework/mod_form.js', - 'requires' => [ - 'node', - 'ajax', - ]]; - - $PAGE->requires->js_init_call('M.mod_coursework.init', [], true, $module); + // Don't include jQuery when not on this module's settings page, for + // example, if on the default activity completion page. See MDL-78528. + if ($PAGE->pagetype === 'mod-coursework-mod') { + $PAGE->requires->jquery(); + + $module = [ + 'name' => 'mod_coursework', + 'fullpath' => '/mod/coursework/mod_form.js', + 'requires' => [ + 'node', + 'ajax', + ]]; + + $PAGE->requires->js_init_call('M.mod_coursework.init', [], true, $module); + } $this->set_form_attributes();