Engine is software that gets integrated into your application. The integration layer consists of some application logic where you have the opportunity (and occasional requirement) to override methods of Engine's default integration, as well as three external keys: external package ID, external registration ID, and external configuration.
With the advent of xAPI, we decided to implement a mechanism for you to convert SCORM (and AICC) registration data to xAPI statements.
So if I launch a SCORM 1.2 version of our golf sample, I might see a statement like this in my Engine learning record store (LRS):
{ "version": "1.0.0", "id": "2b3b5866-29df-4a53-8811-a2400cacdd0d", "actor": { "objectType": "Agent", "name": "tcapi tcapi", "account": { "homePage": "http://localhost/ScormEngineInterface/", "name": "ttcapi" } }, "verb": { "id": "http://adlnet.gov/expapi/verbs/attempted", "display": { "en-US": "attempted" } }, "object": { "objectType": "Activity", "id": "urn:uuid:9355c2df-7546-51df-94ea-7c2e1bf058ab", "definition": { "name": { "en-US": "Golf Explained - Run-time Basic Calls" } } }, "result": { "score": { "scaled": 0.13 }, "success": false, "completion": false, "duration": "PT31S" }, "context": { "registration": "d4f93bc2-7d92-4994-a56e-541c600d70d9", "contextActivities": { "category": [ { "objectType": "Activity", "id": "http://id.tincanapi.com/activity/rustici-software/engine" }, { "objectType": "Activity", "id": "http://id.tincanapi.com/activity/scorm-to-tin-can/scorm12" } ] } }, "timestamp": "2015-07-06T17:09:26.954Z", "stored": "2015-07-06T17:09:26.954Z", "authority": { "objectType": "Agent", "name": "System Authority", "account": { "homePage": "http://localhost/ScormEngineInterface/", "name": "SystemAuthority" } } }
In my local installation, my external package ID is "CourseId". But there's no sign of "CourseId" in that statement. So how do I access the course ID I launched the SCORM package with for reporting?
Well, in the future, this would be made a bit easier when CMI-5 is completely integrated into xAPI and implemented in Engine.
Until then, I can use SQL like the following:
SELECT sp.course_id
FROM ScormPackage AS sp, ScormRegistration AS sr, TinCanRegistration AS tcr
WHERE tincan_registration_id = CONVERT(binary(16), REPLACE('d4f93bc2-7d92-4994-a56e-541c600d70d9', '-', ''), 2)
AND tcr.scorm_registration_id = sr.scorm_registration_id
AND sr.scorm_package_id = sp.scorm_package_id
What this does is takes the xAPI registration generated by the conversion and gets us back to the SCORM package record, including our external package ID, represented in the ScormPackage table as course_id.