Skip to content
Snippets Groups Projects
readme.md 6.21 KiB
Newer Older
- [Drag and Drop Moodle installation](installation.md)
Ryan Smith's avatar
Ryan Smith committed
- [Supported Events](#supported-events)
- [Plugin Design](#plugin-design)
- [Adding Events](#adding-events)
- [Plugin Release Process](#plugin-release-process)

## Supported Events
Moodle Event Name | xAPI Recipe Example
--- | ---
\core\event\course_viewed | [CourseViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/CourseViewed.json)
\mod_page\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
\mod_quiz\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
\mod_url\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
\mod_folder\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
\mod_book\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
\mod_scorm\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
Ryan Smith's avatar
Ryan Smith committed
\mod_forum\event\user_report_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
\mod_forum\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
\mod_resource\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
\mod_quiz\event\attempt_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json)
Ryan Smith's avatar
Ryan Smith committed
\mod_quiz\event\attempt_preview_started | [AttemptStarted](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/AttemptStarted.json)
\mod_quiz\event\attempt_reviewed | [AttemptCompleted](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/AttemptCompleted.json)
Ryan Smith's avatar
Ryan Smith committed
\mod_quiz\event\attempt_abandoned | [AttemptCompleted](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/AttemptCompleted.json)
Ryan Smith's avatar
Ryan Smith committed
\core\event\user_loggedin | [UserLoggedin](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/UserLoggedin.json)
\core\event\user_loggedout | [UserLoggedout](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/UserLoggedout.json)
\mod_assign\event\submission_graded | [AssignmentGraded](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/AssignmentGraded.json)
\mod_assign\event\assessable_submitted  | [AssignmentSubmitted](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/AssignmentSubmitted.json)
Ryan Smith's avatar
Ryan Smith committed
\mod_forum\event\discussion_viewed  | [DiscussionViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/DiscussionViewed.json)
Ryan Smith's avatar
Ryan Smith committed
\core\event\user_created | [UserRegistered](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/UserRegistered.json)
\core\event\user_enrolment_created | [EnrolmentCreated](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/EnrolmentCreated.json)
Ryan Smith's avatar
Ryan Smith committed
\mod_scorm\event\sco_launched | [ScormLaunched](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ScormLaunched.json)
Ryan Smith's avatar
Ryan Smith committed

## Plugin Design
The plugin [controls and configures](../classes/log/store.php) the three parts listed below.

- [Moodle Log Expander](https://github.com/LearningLocker/Moodle-Log-Expander)
- [Moodle to xAPI Translator](https://github.com/LearningLocker/Moodle-xAPI-Translator)
- [xAPI Recipe Emitter](https://github.com/LearningLocker/xAPI-Recipe-Emitter)

The plugin uses the three parts listed above in the following way.

1. The plugin passes raw event data from the logstore_standard_log to the Expander.
2. The Expander expands events with data from your Moodle Database.
3. The plugin passes the expanded events from step 2 to the Translator.
4. The Translator translates expanded events to xAPI recipe options.
5. The plugin passes the translated events from step 4 to the Emitter.
6. The Emitter constructs the translated events as xAPI statements and emits them to the [configured LRS](installation.md#configuration).

These parts have been separated into their own repositories to improve their reusability since these parts will be used in other projects.

## Adding Events
Ryan Smith's avatar
Ryan Smith committed
Assuming you've already [installed](installation.md), you'll need to follow the steps below to begin developing.
Ryan Smith's avatar
Ryan Smith committed

Ryan Smith's avatar
Ryan Smith committed
From the root directory of Moodle run `cd admin/tool/log/store/xapi; php -r "readfile('https://getcomposer.org/installer');" | php; rm -rf vendor; php composer.phar install --prefer-source`.
Ryan Smith's avatar
Ryan Smith committed

You'll now be able to modify and test events by updating the code inside the "vendor/learninglocker/moodle-log-expander", "vendor/learninglocker/moodle-xapi-translator", and "vendor/learninglocker/xapi-recipe-emitter" directories. If you've read the section on [plugin design](#plugin-design) you should understand what each of these directories are responsible for in this plugin. Each of the parts have their own documentation on their respective Github repositories (linked below).

- [Moodle Log Expander](https://github.com/LearningLocker/Moodle-Log-Expander/blob/master/docs/readme.md#adding-events)
- [Moodle to xAPI Translator](https://github.com/LearningLocker/Moodle-xAPI-Translator/blob/master/docs/readme.md#adding-events)
- [xAPI Recipe Emitter](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/readme.md#adding-events)

## Plugin Release Process
This process has been documented for collaborators (users that have write access to the repository) who are releasing new versions of this plugin.

Ryan Smith's avatar
Ryan Smith committed
1. Modify the version.php file.
1. Commit and push the changes made.
Ryan Smith's avatar
Ryan Smith committed
1. Run `sh build.sh` on the branch to be released.
Ryan Smith's avatar
Ryan Smith committed
1. Create release on Github.
Ryan Smith's avatar
Ryan Smith committed
  1. Document patches.
Ryan Smith's avatar
Ryan Smith committed
  1. Document minor changes.
  1. Document major changes.
  1. Document migrations and additional notes.