diff --git a/lib.php b/lib.php index 01b24ff..aed8be8 100644 --- a/lib.php +++ b/lib.php @@ -40,6 +40,7 @@ function opencast_supports($feature) { case FEATURE_MOD_INTRO: case FEATURE_SHOW_DESCRIPTION: case FEATURE_BACKUP_MOODLE2: + case FEATURE_COMPLETION_TRACKS_VIEWS: return true; default: return null; diff --git a/view.php b/view.php index c33a8a7..141d5f3 100644 --- a/view.php +++ b/view.php @@ -29,6 +29,7 @@ require_once(__DIR__ . '/lib.php'); require_once($CFG->dirroot . '/course/modlib.php'); require_once($CFG->libdir . '/gradelib.php'); +require_once($CFG->libdir.'/completionlib.php'); global $OUTPUT, $DB, $PAGE; @@ -86,6 +87,10 @@ $event->add_record_snapshot('opencast', $moduleinstance); $event->trigger(); +// Completion. +$completion = new completion_info($course); +$completion->set_module_viewed($cm); + if ($moduleinstance->type == opencasttype::EPISODE) { output_helper::output_episode($moduleinstance->ocinstanceid, $moduleinstance->opencastid, $moduleinstance->id); } else if ($moduleinstance->type == opencasttype::SERIES) {