RusticiSoftware/TinCanJS

Handle bad activity identifier URN in statements

Closed this issue · 4 comments

I have a Captivate quiz reporting answers to https://lrs.adlnet.gov/xapi/statements. In my Captivate -> Quiz -> Reporting configuration I set the identifier to TheQuiz (I believe this should actually be a domain). When the question results were sent, I received this error:

Activity id with value http://TheQuiz-urn:scormdriver:5419 was not a valid IRI

Only when I changed the identifier TheQuiz to mycompany.com/ (including the trailing slash) did it work. Does this sound correct? I just assumed my ID, whatever it was, would work. Does it make sense to handle these types of IDs?

I should probably mention that I know Captivate is deployed with an older version of tincan but I've manually added the latest into the published course.

@BatteryAcid see the section titled "get the activity id right" on this page: http://tincanapi.com/content/

I guess tincanjs might include some validation of activity ids, but in practice all that'd do is give you the error from tincanjs rather than from the lrs.

Good point, thanks for pointing me to the article.

Generally the id should be an IRI as @garemoko pointed out. TinCanJS does very little data validation (at least in this version, considering it for a future 1.x release), preferring to let the LRS reject incorrect objects.

What you are seeing is essentially a regression bug in Captivate caused by a regression bug in SCORM Driver (which Captivate uses under the hood), the part that it is tacking on incorrectly, the urn:scormdriver:5149, is causing what would otherwise be a valid (but poor) identifier to be invalid. Adding the slash moves the invalid part to after the slash and it becomes valid (still poor).

At this point there really isn't much to do other than to know that the extra part will be tacked on to all identifiers, and to make the identifiers you use both better and valid with the extra string.

Closing this as it isn't directly caused by TinCanJS.