If you hadn't already installed the plugin, you'll need to login as an admin and navigate to "http://www.example.com/admin/index.php" (replacing “www.example.com” with your own domain). Once there you can follow on from step 6 of the [user installation guide](installation.md).
## Adding Events
Assuming you've installed using the [instructions above](#setup), you can 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 [plugin design](readme.md#plugin-design) you should understand what each of these directories are responsible for. Each of the parts have their own documentation on their respective Github repositories (linked below).
You obviously need to have [Moodle](https://moodle.org/) installed first and you need to be logged in as an Admin.
# Installation
This page contains a guide for users wanting to install the plugin. You obviously need to have [Moodle](https://moodle.org/) installed first and you need to be logged in as an Admin.
1. Download the plugin. [Click here to begin download](../xapi.zip?raw=true).
2. Go to "http://www.example.com/admin/tool/installaddon/index.php" (replacing “www.example.com” with your own domain).
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
Assuming you've already [installed](installation.md), you'll need to follow the steps below to begin developing.
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`.
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).