diff --git a/README.md b/README.md index 31cece7b53bd9c69a883bc1aaf251ed8c6475b92..543cd4ffff41704f9893aebdf37c36726cb02656 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ -# [Moodle Logstore xAPI](https://github.com/jlowe64/moodle-logstore-xapi) +# [Moodle Logstore xAPI](https://moodle.org/plugins/view/logstore_xapi) > Emits events from the [Moodle](https://moodle.org/) Logstore as [xAPI](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md) statements. [](https://travis-ci.org/jlowe64/moodle-logstore_xapi) +[](https://moodle.org/plugins/view/logstore_xapi) [](https://gitter.im/LearningLocker/learninglocker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -- [Installation](docs/installation.md). -- [Read documentation](docs/readme.md). -- [Report bugs, enhancements, and questions](contributing.md#issue-templates). +- [Installation](docs/installation.md) +- [Report bugs, enhancements, and questions](contributing.md#issue-templates) +- [Supported events](docs/events.md) +- [Developer documentation](docs/developers.md) +- [Plugin design](docs/design.md) diff --git a/docs/design.md b/docs/design.md new file mode 100644 index 0000000000000000000000000000000000000000..2865dd57db8178a9fdb02a1119d95c6ef576441b --- /dev/null +++ b/docs/design.md @@ -0,0 +1,18 @@ +# Plugin Design +This page documents how the plugin is designed. 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. + diff --git a/docs/developers.md b/docs/developers.md new file mode 100644 index 0000000000000000000000000000000000000000..9bd09a7d8a639d7cdf967850f7df02bfe41ea90d --- /dev/null +++ b/docs/developers.md @@ -0,0 +1,33 @@ +# Developers +This page contains documentation for developers (people who would like to contribute code to the project). + +- [Setup](#setup) +- [Adding events](#adding-events) +- [Release process](#release-process) + +## Setup +From the root directory of your Moodle installation run the script below. +```sh +cd admin/tool/log/store; rm -rf xapi; git clone git@github.com:jlowe64/moodle-logstore_xapi.git xapi; php -r "readfile('https://getcomposer.org/installer');" | php; rm -rf vendor; php composer.phar install --prefer-source; +``` + +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). + +- [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) + +## 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. + +1. Modify the version.php file. +1. Commit and push the changes made. +1. Run `sh build.sh` on the branch to be released. +1. Create release on Github. + 1. Document patches. + 1. Document minor changes. + 1. Document major changes. + 1. Document migrations and additional notes. diff --git a/docs/events.md b/docs/events.md new file mode 100644 index 0000000000000000000000000000000000000000..f9065f9894bb7a96e9112b50e2c4eb26f024e9c0 --- /dev/null +++ b/docs/events.md @@ -0,0 +1,40 @@ +# Supported Events +This page documents the [Moodle log events](https://docs.moodle.org/dev/Event_2#Existing_events) supported by this plugin. + +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) +\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) +\mod_choice\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_data\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_feedback\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_lesson\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_lti\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_wiki\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_workshop\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_chat\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_glossary\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_imscp\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\mod_survey\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_facetoface\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) +\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) +\mod_quiz\event\attempt_abandoned | [AttemptCompleted](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/AttemptCompleted.json) +\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) +\mod_forum\event\discussion_viewed | [DiscussionViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/DiscussionViewed.json) +\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) +\mod_scorm\event\sco_launched | [ScormLaunched](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ScormLaunched.json) diff --git a/docs/installation.md b/docs/installation.md index 6f327239e31000f329aff0d2c4be13817f1b9090..0f4d53199b7166aa3d04f786a0f678d50945ef9a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,4 +1,5 @@ -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). diff --git a/docs/readme.md b/docs/readme.md index c7bc2d9272c73c3ebc77ad065f09cb2c113a9b49..79105f88b2cbbf34a16efde0de8c6388e0e3f1f4 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,85 +1,12 @@ -- [Drag and Drop Moodle installation](installation.md) -- [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) -\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) -\mod_choice\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_data\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_feedback\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_lesson\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_lti\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_wiki\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_workshop\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_chat\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_glossary\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_imscp\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\mod_survey\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_facetoface\event\course_module_viewed | [ModuleViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ModuleViewed.json) -\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) -\mod_quiz\event\attempt_abandoned | [AttemptCompleted](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/AttemptCompleted.json) -\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) -\mod_forum\event\discussion_viewed | [DiscussionViewed](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/DiscussionViewed.json) -\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) -\mod_scorm\event\sco_launched | [ScormLaunched](https://github.com/LearningLocker/xAPI-Recipe-Emitter/blob/master/docs/examples/ScormLaunched.json) - -## 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 -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). - -- [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. - -1. Modify the version.php file. -1. Commit and push the changes made. -1. Run `sh build.sh` on the branch to be released. -1. Create release on Github. - 1. Document patches. - 1. Document minor changes. - 1. Document major changes. - 1. Document migrations and additional notes. +# [Moodle Logstore xAPI](https://moodle.org/plugins/view/logstore_xapi) +> Emits events from the [Moodle](https://moodle.org/) Logstore as [xAPI](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI.md) statements. + +[](https://travis-ci.org/jlowe64/moodle-logstore_xapi) +[](https://moodle.org/plugins/view/logstore_xapi) +[](https://gitter.im/LearningLocker/learninglocker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +- [Installation](installation.md) +- [Report bugs, enhancements, and questions](../contributing.md#issue-templates) +- [Supported events](events.md) +- [Developer documentation](developers.md) +- [Plugin design](design.md)