Linux 软件免费装

wp-xapi-lrs

开发者 Tunapanda
更新时间 2017年3月5日 15:14
捐献地址: 去捐款
PHP版本: 3.8.1 及以上
WordPress版本: 4.7.1
版权: GPLv3
版权网址: 版权信息

标签

integration admin lms learning management system learning xapi

下载

详情介绍:

This WordPress plugin enables your WordPress site to act as an xAPI enabled Learning Record Store. At the time of writing, the support is very basic. You can put statements in the database, and retreive them with some very basic filtering, but that's about it. It is possible to filter statements based on agent, verb, activity, statementId and related_activities, which is a subset from the complete list of filters found in the xAPI standard. How to use After the plugin is installed, you will find a settings page called xAPI LRS in the Settings section of the admin panel. On this page you will find the endpoint as well as credentials that can be used to connect to the LRS. Testing from a hacker point of view If you want to use this plugin in order to have a xAPI record store that other systems can connect to, the above is all you need. However, if you are more of a hacker type and you want to find out how xAPI actually works, this section is for you. The username and password will be randomly generated upon installation. We can try to access the endpoint using curl: curl "http://8260a014ad6016ba2af2ed0c0f7684e0:7078d3dc378947905994affa86c20d48@localhost/wordpress/wp-content/plugins/wp-xapi-lrs/endpoint.php/" { "error": true, "message": "Expected xAPI method, try appending \/statements to the url." } 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 statements resource, so let's try to access that: curl "http://8260a014ad6016ba2af2ed0c0f7684e0:7078d3dc378947905994affa86c20d48@localhost/wordpress/wp-content/plugins/wp-xapi-lrs/endpoint.php/statements" { "statements": [] } 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 hang gliding example from Statements 101. The statement looks like this: { "actor": { "name": "Sally Glider", "mbox": "mailto:sally@example.com" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/experienced", "display": { "en-US": "experienced" } }, "object": { "id": "http://example.com/activities/solo-hang-gliding", "definition": { "name": { "en-US": "Solo Hang Gliding" } } } } Put the statement in a file called statement.json. Insert the statement using the following curl command: curl -X POST --data-binary @statement.json "http://8260a014ad6016ba2af2ed0c0f7684e0:7078d3dc378947905994affa86c20d48@localhost/wordpress/wp-content/plugins/wp-xapi-lrs/endpoint.php/statements" [ "e1dc2120-ca22-4500-96a2-611b32edfb70" ] It worked! The data we got back is the UUID for the statement. Let's try to retreive it: curl "http://8260a014ad6016ba2af2ed0c0f7684e0:7078d3dc378947905994affa86c20d48@localhost/wordpress/wp-content/plugins/wp-xapi-lrs/endpoint.php/statements" { "statements": [ { "id": "e1dc2120-ca22-4500-96a2-611b32edfb70", "stored": "2016-11-07T09:44:53.000+00:00", "actor": { "objectType": "Agent", "name": "Sally Glider", "mbox": "mailto:sally@example.com" }, "verb": { "id": "http:\/\/adlnet.gov\/expapi\/verbs\/experienced", "display": { "en-US": "experienced" } }, "timestamp": "2016-11-07T09:44:53.000+00:00", "object": { "objectType": "Activity", "id": "http:\/\/example.com\/activities\/solo-hang-gliding", "definition": { "name": { "en-US": "Solo Hang Gliding" } } } } ] } Yep, it seems like the statement is there! Hacking and Development Some small things to think about if you want to contribute to this plugin: