I want to ask something about SCORM. So, I have this SCORM project:
https://github.com/potamir/scorm-lesson-1
I want to embed this SCORM to my existing react project but I can’t find any correct way to do it, I have try several tutorial on the internet but the format is just not like this. I also have tried to upload it to server and iframe it but I got this error instead:
I’m new to SCROM and I don’t have any idea how to do it on react. If anyone have any recommended tutorial or you can tell me what is the correct way it’ll be helpful. Thanks!
2
Answers
I would look at adlnet.gov – the organization that created scorm, and scorm.com – one of the companies with extensive experience in scorm. scorm.com has some example scorm content, which I have used before – https://scorm.com/scorm-explained/technical-scorm/golf-examples/
Briefly, there are two parts to scorm, the content and the content player. The content reports learner and lesson status through an API that the content player embedded in the DOM of the page showing the content. That api needs to be attached to window and named API. The content will look for that when it wants to connect and use the api by walking up the parents (in case the content in launched in a child window) looking for window.API.
Your errors look like they’re saying the content can’t find the api. I can see that the scorm-adapter.js file is attaching the API to the window. I suggest making sure the content is in that dom hierarchy. The content should be looking for window.API, or looping up the parents doing something like win = window.parent; win.API until it finds the api or gives up. You can see the process in this scormwrapper – https://github.com/pipwerks/scorm-api-wrapper/blob/master/src/JavaScript/SCORM_API_wrapper.js#L102
You may be able to leverage some info on the wiki at https://github.com/cybercussion/SCOBot/wiki/Using-SCOBot-with-AngularJS-and-Angular-2.
Also some comments there if you don’t want to use a library and hand roll it if you are doing basic score/status. For more robust interaction/objective work I’d use a library.