2

We are using Moodle 3.1.1 and trying to find a way to "Mark activity Complete" (via a link or button) from within each activity instead of going back to main course/topics page and checking the "Mark complete" checkbox next to each Activity.

The only way I could think of is to create a custom button with same functionality as the checkboxes for "Mark complete" on course/topics page. But again should that be done as a plugin or just a custom code enhancement within Moodle? If yes, any steps in that direction would be helpful as I'm not that aware of Moodle development.

Is there a simpler way to do this? Any suggestions would be really helpful.

Thanks in advance!

1 Answers1

0

Here is the simplest way, which just generates the same checkbox that you see on the course page:

global $COURSE, $PAGE;
$completioninfo = new completion_info($COURSE);
if ($PAGE->cm) {
    $course_renderer = $this->page->get_renderer('core', 'course');
    $checkbox = $course_renderer->course_section_cm_completion($COURSE, $completioninfo, $PAGE->cm);
}

echo $checkbox;

Add that to your theme's layout/template file(s) so that it will appear on activity pages.

ncy
  • 1
  • 2