Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions classes/event/course_module_viewed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
namespace mod_echolink\event;
defined('MOODLE_INTERNAL') || die();
class course_module_viewed extends \core\event\course_module_viewed {
protected function init() {
$this->data['crud'] = 'c';
$this->data['edulevel'] = self::LEVEL_PARTICIPATING;
$this->data['objecttable'] = 'echolink';
}
}
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2016050501; // The current module version (Date: YYYYMMDDXX)
$plugin->version = 2016050502; // The current module version (Date: YYYYMMDDXX)
$plugin->requires = 2011112900; // Requires this Moodle version
$plugin->component = 'mod_echolink'; // Full name of the plugin (used for diagnostics)
$plugin->cron = 0;
10 changes: 8 additions & 2 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@
$context = context_module::instance($cm->id);
require_capability('mod/echolink:view', $context);

add_to_log($course->id, 'echolink', 'view', 'view.php?id='.$cm->id, $echolink->id, $cm->id);

// Log this request.
$params = array(
'objectid' => $course->id,
'context' => $context
);
$event = \mod_echolink\event\course_module_viewed::create($params);
$event->add_record_snapshot('echolink', $echolink);
$event->trigger();

// Update 'viewed' state if required by completion system
$completion = new completion_info($course);
Expand Down