diff --git a/version.php b/version.php index b761ab0..88c30b1 100755 --- a/version.php +++ b/version.php @@ -11,7 +11,7 @@ defined('MOODLE_INTERNAL') || die(); $module->component = 'mod_game'; // Full name of the plugin (used for diagnostics) -$module->version = 2014061002; // The current module version (Date: YYYYMMDDXX) +$module->version = 2014061003; // The current module version (Date: YYYYMMDDXX) $module->requires = 2010112400; // Requires Moodle 2.0 $module->cron = 0; // Period for cron to check this module (secs) -$module->release = '3.18.10.2'; +$module->release = '3.18.10.3'; diff --git a/view.php b/view.php index 4fd0bd5..f2785a3 100755 --- a/view.php +++ b/view.php @@ -46,9 +46,13 @@ $canattempt = true; } - /// Log this request. - add_to_log($course->id, 'game', 'view', "view.php?id=$cm->id", $game->id, $cm->id); + if( game_use_events()) + { + require( 'classes/event/course_module_viewed.php'); + \mod_game\event\course_module_viewed::viewed($game, $context)->trigger(); + }else + add_to_log($course->id, 'game', 'view', "view.php?id=$cm->id", $game->id, $cm->id); // Mark as viewed $completion=new completion_info($course);