Skip to content

Commit

Permalink
add default completion option view
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetom committed Nov 27, 2024
1 parent 7849f2a commit 98abd03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 98abd03

Please sign in to comment.