You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Configuring xAPI Realtime Tracking (Experimental in v1.6-BETA)
27
27
28
28
The experimental xAPI Realtime Tracking implements basic LRS Statement API functionality.
29
29
30
-
Primarily:
30
+
This allows an [Activity Provider (AP)](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-About.md#def-activity-provider) to send statements for External Content Activity items, that can be used to set the Moodle Viewed status and External Completed status for the item.
31
31
32
-
*[Statements Resource](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#stmtres) - This is WRITE ONLY and so supports POST, PUT only. GET requests return a 401 Status
33
-
*[About Resource](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#aboutresource) - GET
32
+
The received statements are not saved to Moodle, but parsed as received
34
33
35
-
The JSON statements received are parsed using [TinCan PHP](https://github.com/RusticiSoftware/TinCanPHP), and used to set the viewed status, completion status and score for the content if available.
34
+
The Statement [Object Id](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#acturi) is used to identify the course and External Content Activity Item, the Moodle [Course ID Number](https://docs.moodle.org/310/en/Course_settings#Course_ID_number) needs to be set to this value.
35
+
36
+
The Statement [Actor Account Name](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#inversefunctional) is used to identify the Moodle User using their Moodle [Username](https://docs.moodle.org/310/en/Add_a_new_user#Username).
37
+
38
+
Any Statement [Verb Id](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#verb) received is used to set the Viewed status of the Activity. As Moodle does not support setting the timestamp for the Viewed event it will be the time that the statement was processed by the module.
39
+
40
+
If the Statement [Verb Id](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#verb) is one of those configured to indicate completion (Defaults are: http://adlnet.gov/expapi/verbs/completed and http://adlnet.gov/expapi/verbs/passed) the Activity Item "Completed Externally" value is set to true.
36
41
37
-
---
38
42
39
-
1. Configure the username/password which are used for basic authentication of the basic LRS endpoint. The defaults are random strings setup when module is installed.
40
-
2. Set the xAPI verbs that will be used to indicate the content has been "completed", if a verb that matches one of these values is received the completed externally flag is updated. Any other verb simply sets the viewed flag. The defaults are http://adlnet.gov/expapi/verbs/completed and http://adlnet.gov/expapi/verbs/passed
43
+
### What has been implemented
44
+
|Resource|HTTP Methods|Comments|
45
+
|------- |------------|-----------|
46
+
|[Statements Resource](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#stmtres)|GET, PUT, POST|This is WRITE ONLY and so supports POST, PUT only. GET requests return a "null" response so as to be "valid" but the functionality is not implemented. The JSON statements received are parsed using [TinCan PHP](https://github.com/RusticiSoftware/TinCanPHP), and used to set the viewed status, completion status and score for the content if available.|
47
+
|[About Resource](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Communication.md#aboutresource)|GET|This returns tha xAPI version supported which for this is 1.0.0|
48
+
<br>
41
49
42
-
Configure your external content provider to connect to the "basic" LRS implemented here:
50
+
### Setup Activity Settings
51
+
|Name|Setting|Description|
52
+
|-----|-------|-----------|
53
+
|Enable xAPI LRS basic support|xapienable|Enable the basic xAPI support, if disabled all calls to the xAPI endpoint return a 401 Unauthorized status. The default is enabled.|
54
+
|xAPI LRS Username|xapiusername|Configure the username which is used for basic authentication of the basic LRS endpoint. The default is a random string, setup when module is installed.|
55
+
|xAPI LRS Password|xapipassword|Configure the password which is used for basic authentication of the basic LRS endpoint. The default is a random string, setup when module is installed.|
56
+
|List of completion xAPI verbs|xapicompletionverbs|Set the xAPI verbs that will be used to indicate the content has been "completed", if a verb that matches one of these values is received the completed externally flag is updated. Any other verb simply sets the viewed flag. The defaults are http://adlnet.gov/expapi/verbs/completed and http://adlnet.gov/expapi/verbs/passed|
- Authentication - Basic Authentication using the username/password you configured
58
+
<br>
46
59
47
-
For the tracking to work:
60
+
### Setup Activity Provider
61
+
|Setup|Description|
62
+
|------- |-----------|
63
+
|LRS Endpoint|In your activity provider you need to configure the path to this modules LRS endpoint. This will be https://{moodlehostname}/mod/externalcontent/lrs/index.php|
64
+
|Authentication|The modules LRS only supports Basic Authentication and so you will need to use the username/password you configured above.|
48
65
49
-
- Statement Object ID and the Moodle Course ID Numbers must match
50
-
- Statement Actor must use the account [Inverse Functional Identifiers](https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#inversefunctional) and the name must match the Moodle Username.
0 commit comments