trax-project / trax-lrs

TRAX LRS is a certified LRS, with minimalist and extensible features, based on PHP/Laravel.
http://traxlrs.com
European Union Public License 1.2
43 stars 16 forks source link

Moodle with "tincanlaunch" plugin gives 'Invalid "activityId" param.' #9

Closed progzy closed 4 years ago

progzy commented 4 years ago

Hello,

I am currently trying the LRS with the Moodle" tincanlaunch" plugin (https://github.com/garemoko/moodle-mod_tincanlaunch) and I get

'Invalid "activityId" param.'

once the activity is configured.

Query is the following (decoded for readability):

http://traxlrs.local/trax/ws/xapi/activities/state?activityId=http://Course_ID2&agent={"objectType":"Agent","name":"John Doe","mbox":"mailto:jdoe@example.com"}&stateId=http://tincanapi.co.uk/stateapikeys/registrations

Thank you.

sfraysse commented 4 years ago

Please, could you share your tincan.xml file?

progzy commented 4 years ago

Here it is:

`<?xml version="1.0" encoding="utf-8" ?>

2. Course Course Description. index_TINCAN.html

` I've tested with learning locker LRS and it works fine.

I've tested with Trax LRS and the course example from here: https://github.com/RusticiSoftware/TinCan_Prototypes/tree/master/GolfExample_TCAPI and it works fine.

Now I wonder if these 2 other LRSs work in a kind of "non -strict mode" whereas Trax LRS is "strict".

So I've renamed the activity id to the same as in the golf example and now I get

None of the following schemas were found ["agent","anonymous_group","identified_group","activity","statement_ref","sub_statement"] in "statement->object".

as error from this kind of call:

http://traxlrs.local/trax/ws/xapi/statements?statementId=9fdba265-7e09-4b43-ab6c-33ec0d1a58c3

So maybe the tool to package the content (captivate 2017) produces non-fully-compliant xAPI structure/model/code that only works with some LRSs (like the 2 I've mentioned earlier) but not with all of them (like Trax LRS) whereas all of those LRSs are conformant ones as it can be read here: https://adopters.adlnet.gov/products/all/0

Thank you.

sfraysse commented 4 years ago

Please, read the spec here: https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#31-iri-requirements

Metadata Providers defining new IRIs SHOULD* only use IRIs they control or have permission from the controller to use.

http://Course_ID2 is not an IRI you control. You should use something like http://your-registered-domain/Course_ID2 to ensure that you control the IRI.

So Trax LRS rejects this IRI. However, the spec says SHOULD. So it is not a strict requirement and it is not checked by the compliance testing suite. So Learning Locker is less strict but is compliant.

Your last error has nothing to see with the package or the activityId. It means that your statement is not valid. Check the validity of your statement.

I close this issue.

progzy commented 4 years ago

Ok, thank you for help and clarification.