{"id":53859,"date":"2016-11-07T10:29:12","date_gmt":"2016-11-07T10:29:12","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-xapi-lrs\/"},"modified":"2017-03-05T07:14:31","modified_gmt":"2017-03-05T07:14:31","slug":"wp-xapi-lrs","status":"closed","type":"plugin","link":"https:\/\/az-tr.wordpress.org\/plugins\/wp-xapi-lrs\/","author":14634930,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"0.0.3","stable_tag":"trunk","tested":"4.7.33","requires":"3.8.1","requires_php":"","requires_plugins":"","header_name":"xAPI LRS","header_author":"","header_description":"","assets_banners_color":"","last_updated":"2017-03-05 07:14:31","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/www.tunapanda.org\/contribute","header_plugin_uri":"http:\/\/github.com\/tunapanda\/wp-xapi-lrs","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":10,"downloads":829,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[]},"plugin_section":[],"plugin_tags":[83,597,10814,2195,34125],"plugin_category":[],"plugin_contributors":[90049],"plugin_business_model":[],"class_list":["post-53859","plugin","type-plugin","status-closed","hentry","plugin_tags-admin","plugin_tags-integration","plugin_tags-learning","plugin_tags-lms","plugin_tags-xapi","plugin_contributors-tunapanda","plugin_committers-tunapanda"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-xapi-lrs.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>This WordPress plugin enables your WordPress site to act as an \n<a href=\"https:\/\/en.wikipedia.org\/wiki\/Experience_API_(Tin_Can_API)\">xAPI<\/a> enabled \nLearning Record Store. At the time of writing, the support is very basic. \nYou can put statements in the database, and retreive them with some very basic \nfiltering, but that's about it. It is possible to filter statements based on \nagent, verb, activity, statementId and related_activities, which is a subset \nfrom the complete list of filters found in the \n<a href=\"https:\/\/github.com\/adlnet\/xAPI-Spec\/blob\/master\/xAPI-Communication.md#213-get-statements\">xAPI standard<\/a>.<\/p>\n\n<h4>How to use<\/h4>\n\n<p>After the plugin is installed, you will find a settings page called\n<em>xAPI LRS<\/em> in the <em>Settings<\/em> section of the admin panel. On this page\nyou will find the endpoint as well as credentials that can be used to connect\nto the LRS.<\/p>\n\n<h4>Testing from a hacker point of view<\/h4>\n\n<p>If you want to use this plugin in order to have a xAPI record store that other\nsystems can connect to, the above is all you need. However, if you are more of\na hacker type and you want to find out how xAPI actually works, this section is for you.<\/p>\n\n<p>The username and password will be randomly generated upon\ninstallation. We can try to access the endpoint using curl:<\/p>\n\n<pre><code>curl \"http:\/\/8260a014ad6016ba2af2ed0c0f7684e0:7078d3dc378947905994affa86c20d48@localhost\/wordpress\/wp-content\/plugins\/wp-xapi-lrs\/endpoint.php\/\"\n{\n    \"error\": true,\n    \"message\": \"Expected xAPI method, try appending \\\/statements to the url.\"\n}\n<\/code><\/pre>\n\n<p>This error message is given because according to the xAPI standard we need to specify which resource we want to access. Currently, the only implemented resource is the <a href=\"https:\/\/github.com\/adlnet\/xAPI-Spec\/blob\/master\/xAPI-Communication.md#21-statement-resource\">statements<\/a> resource, so let's try to access that:<\/p>\n\n<pre><code>curl \"http:\/\/8260a014ad6016ba2af2ed0c0f7684e0:7078d3dc378947905994affa86c20d48@localhost\/wordpress\/wp-content\/plugins\/wp-xapi-lrs\/endpoint.php\/statements\"\n{\n    \"statements\": []\n}\n<\/code><\/pre>\n\n<p>We are getting an empty list of statements back from the LRS, so something is working! Let's try to put a statements there. We can take the <a href=\"https:\/\/experienceapi.com\/statements-101\/\">hang gliding<\/a> example from Statements 101. The statement looks like this:<\/p>\n\n<pre><code>{\n    \"actor\": {\n        \"name\": \"Sally Glider\",\n        \"mbox\": \"mailto:sally@example.com\"\n    },\n    \"verb\": {\n        \"id\": \"http:\/\/adlnet.gov\/expapi\/verbs\/experienced\",\n        \"display\": { \"en-US\": \"experienced\" }\n    },\n    \"object\": {\n        \"id\": \"http:\/\/example.com\/activities\/solo-hang-gliding\",\n        \"definition\": {\n            \"name\": { \"en-US\": \"Solo Hang Gliding\" }\n        }\n    }\n}\n<\/code><\/pre>\n\n<p>Put the statement in a file called statement.json. Insert the statement using the following curl command:<\/p>\n\n<pre><code>curl -X POST --data-binary @statement.json  \"http:\/\/8260a014ad6016ba2af2ed0c0f7684e0:7078d3dc378947905994affa86c20d48@localhost\/wordpress\/wp-content\/plugins\/wp-xapi-lrs\/endpoint.php\/statements\"\n[\n    \"e1dc2120-ca22-4500-96a2-611b32edfb70\"\n]\n<\/code><\/pre>\n\n<p>It worked! The data we got back is the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Universally_unique_identifier\">UUID<\/a> for the statement. Let's try to retreive it:<\/p>\n\n<pre><code>curl \"http:\/\/8260a014ad6016ba2af2ed0c0f7684e0:7078d3dc378947905994affa86c20d48@localhost\/wordpress\/wp-content\/plugins\/wp-xapi-lrs\/endpoint.php\/statements\"\n{\n    \"statements\": [\n        {\n            \"id\": \"e1dc2120-ca22-4500-96a2-611b32edfb70\",\n            \"stored\": \"2016-11-07T09:44:53.000+00:00\",\n            \"actor\": {\n                \"objectType\": \"Agent\",\n                \"name\": \"Sally Glider\",\n                \"mbox\": \"mailto:sally@example.com\"\n            },\n            \"verb\": {\n                \"id\": \"http:\\\/\\\/adlnet.gov\\\/expapi\\\/verbs\\\/experienced\",\n                \"display\": {\n                    \"en-US\": \"experienced\"\n                }\n            },\n            \"timestamp\": \"2016-11-07T09:44:53.000+00:00\",\n            \"object\": {\n                \"objectType\": \"Activity\",\n                \"id\": \"http:\\\/\\\/example.com\\\/activities\\\/solo-hang-gliding\",\n                \"definition\": {\n                    \"name\": {\n                        \"en-US\": \"Solo Hang Gliding\"\n                    }\n                }\n            }\n        }\n    ]\n}\n<\/code><\/pre>\n\n<p>Yep, it seems like the statement is there!<\/p>\n\n<h4>Hacking and Development<\/h4>\n\n<p>Some small things to think about if you want to contribute to this plugin:<\/p>\n\n<ul>\n<li><p>Don't update the README.md file. Update the readme.txt file, then build the\nREADME.md file using <code>make readme<\/code>. This in turn uses the\n<a href=\"https:\/\/github.com\/wpreadme2markdown\/wp-readme-to-markdown\">wp2md<\/a> command,\nso this needs to be installed on your system.<\/p><\/li>\n<li><p>The <a href=\"https:\/\/github.com\/limikael\/minixapi\/\">minixapi<\/a> module is linked as a \ngit submodule, under the <code>submodule<\/code> directory. However, as a convenience it\nis also copied and checked in to this repository under the <code>ext<\/code> directory. \nIn order to keep these copies in sync, you can run the command <code>make copy-deps<\/code>\nto copy the contents of the submodule to the ext directory. If you want to\nwork on the submodule at the same time as you work on this repository, you \ncan use the command <code>make link-deps<\/code> to create a symbolic link from the <code>ext<\/code>\ndirectory to the <code>submodule<\/code> directory. We want the copy of the submodule \nchecked in to the repository, and not the link, so don't forget to run \n  make copy-deps before you add files and commit!<\/p><\/li>\n<\/ul>","raw_excerpt":"Lets your WordPress site to act as an xAPI Learning Record Store.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/53859","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=53859"}],"author":[{"embeddable":true,"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/tunapanda"}],"wp:attachment":[{"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=53859"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=53859"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=53859"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=53859"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=53859"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/az-tr.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=53859"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}