Moodle: 3.5 / Theme: Boost
Hi all,
I'm investigating a method of including standard submission text (regulations, advice on document compression etc.) into the Assignment activity. I understand that I can add this manually per assignment activity or within the integrity statement, but that isn't ideal for what I wish to do.
As it stands, I've managed to override (specifically) the edit submission page with the following code ('theme/boost/renderers.php') - This is taken from 'mod/assign/renderer.php', using the 'Overriding a Renderer' guidance note.
include_once($CFG->dirroot . '/mod/assign/renderer.php');
class theme_boost_mod_assign_renderer extends mod_assign_renderer { public function render_assign_header(assign_header $header) { $o = ''; if ($header->subpage) { $this->page->navbar->add($header->subpage); } $this->page->set_title(get_string('pluginname', 'assign')); $this->page->set_heading($this->page->course->fullname); $o .= $this->output->header(); $heading = format_string($header->assign->name, false, array('context' => $header->context)); $o .= $this->output->heading($heading); if ($header->preface) { $o .= $header->preface; } // Additions global $PAGE; if($PAGE->pagetype === "mod-assign-editsubmission") { $header->postfix = "Common Submission Instructions"; } // Additions End if ($header->showintro) { $o .= $this->output->box_start('generalbox boxaligncenter', 'intro'); $o .= format_module_intro('assign', $header->assign, $header->coursemoduleid); $o .= $header->postfix; $o .= $this->output->box_end(); } return $o; } }
I'm essentially assigning content to the existing postfix property of the header. My question is whether this is a correct method for achieving my goal, and what drawbacks I might encounter.
I have another query open for a different root, which implements a block across a category, and inclusive of all assignments:
https://moodle.org/mod/forum/discuss.php?d=388124
Many thanks,
Anthony