-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from talis/event-logging
Update for Moodle 3.0
- Loading branch information
Showing
10 changed files
with
130 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
2.x-activity-module/mod/aspirelists/classes/event/aspirelists_launch.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
namespace aspirelists\event; | ||
|
||
defined('MOODLE_INTERNAL' || die); | ||
/** | ||
* Class aspire_lists_launch | ||
* Provides a hook into the Moodle Event system for logging events. | ||
* This class implements the key functions needed to provide compatibility with https://docs.moodle.org/dev/Event_2 | ||
* This class represents the event of a user launching an aspire list LTI link. | ||
* @package aspirelists\event | ||
*/ | ||
class aspire_lists_launch extends \core\event\base { | ||
/** @var array */ | ||
var $legacy_log_data; | ||
|
||
protected function init() { | ||
$this->data['objecttable'] = 'aspirelists'; | ||
$this->data['edulevel'] = self::LEVEL_PARTICIPATING; | ||
$this->data['crud'] = 'r'; | ||
} | ||
|
||
public static function get_name() { | ||
return get_string('eventAspireLaunch', 'aspirelists'); | ||
} | ||
|
||
public function get_description() { | ||
return "The user with id {$this->userid} Launched an LTI link with id {$this->objectid}."; | ||
} | ||
|
||
public function get_legacy_logdata() { | ||
return $this->legacy_log_data; | ||
} | ||
|
||
/** | ||
* easily set our old add_to_log data | ||
* @param array $data | ||
*/ | ||
public function set_legacy_logdata(array $data) { | ||
$this->legacy_log_data = $data; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
2.x-activity-module/mod/aspirelists/classes/event/course_module_viewed.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
namespace aspirelists\event; | ||
defined('MOODLE_INTERNAL' || die); | ||
|
||
/** | ||
* Class course_module_viewed | ||
* This provides an extension to the core course_module_viewed event to easily set legacy log data. | ||
* @package aspirelists\event | ||
*/ | ||
class course_module_viewed extends \core\event\course_module_viewed { | ||
/** @var array */ | ||
var $legacy_log_data; | ||
|
||
protected function init() { | ||
$this->data['objecttable'] = 'aspirelists'; | ||
$this->data['edulevel'] = self::LEVEL_PARTICIPATING; | ||
$this->data['crud'] = 'r'; | ||
parent::init(); | ||
} | ||
|
||
public function get_legacy_logdata() { | ||
return $this->legacy_log_data; | ||
} | ||
|
||
/** | ||
* easily set our old add_to_log data | ||
* @param array $data | ||
*/ | ||
public function set_legacy_logdata(array $data) { | ||
$this->legacy_log_data = $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters