Search code examples
c#unity-game-enginetin-can-api

How to integrate xAPI / TinCan in Unity


I am new to xAPI/TinCan API so my question might be a bit general but I haven't found anything that can help me so far. I figured it is possible to integrate xAPI into a Unity project (a game or simulation) but how exactly do I do that? (Are there any examples/documentation I can read on xAPI & Unity?)

So am I right to understand: I need a LRS, then I can use the TinCan .NET library and integrate it in Unity and then just have some conditions in my Unity code (like finish that level..) and if they are fulfilled I create a statement like in the example here (http://rusticisoftware.github.io/TinCan.NET/) and then send it to my LRS via a normal POST? And then I can see/query this learning data in my LRS for analytics?

Plus does it work for Unity standalone, mobile and web player??


Solution

  • I have little Unity experience (other than researching others' questions on this subject) but for the most part I believe you are correct. TinCan.NET should work with Unity based on what others have said, and it provides everything you need to communicate with the LRS (so no need to do your own POST, etc. instead look at the RemoteLRS class methods).

    In general I would avoid querying the LRS directly for analytics reporting, instead consider it a long lived data store that should be used to populate a reporting tool. Having said that, you can certainly see the data in an LRS. You can access a free LRS at https://cloud.scorm.com (from Rustici Software maintainers of TinCan.NET) by signing up for an account.

    Note you may run into a common issue with SSL certificate validation and will want to have a look at Mono https webrequest fails with "The authentication or decryption has failed" if you do.

    I can't speak to the standalone, mobile, web player question, though I'd expect anything supporting .NET should work.