Picture of Christian Flanagan
SCORM Events
by Christian Flanagan - Wednesday, 10 September 2014, 8:36 PM
 

I'm trying to locate where in the src code events are triggered that make SCORM calls to an LMS. When I launch my course, I can see the connection initialization.

connection.initialize called.

SCORM.API.find: API found. Version: 1.2

API: [object Object]

SCORM.data.get(cmi.suspend_data) value: {"spoor":{"completion":"---------------1111111111101111111101111111111111111101111111111111111111111111","_isCourseComplete":false,"_isAssessmentPassed":false}}

 

I know the code for the above output is in \src\extensions\adapt-contrib-spoor\js\SCORM_API_wrapper.js, but where is the event handler that calls that method?

I'm just looking to understand how communication gets triggered between the course and the LMS. 

Picture of Chris Jones
Re: SCORM Events
by Chris Jones - Thursday, 11 September 2014, 8:38 AM
 

Hi,

The spoor plugin listens to the standard events from the frameworks.

see https://github.com/adaptlearning/adapt-contrib-spoor/blob/master/js/adapt-contrib-spoor.js#L56

As the events are fired in the course the plugin will monitor the state of the course and then serialise and persist the state to the SCORM API.

If the completion requirements are met then the relevant states are sent to the SCORM API as well.

In the framework, the events are triggered from the individual blocks and extensions:-

Assessment

- https://github.com/adaptlearning/adapt-contrib-assessment/blob/master/js/adapt-contrib-assessment-quizArticle.js#L50

QuestionView

- https://github.com/adaptlearning/adapt_framework/blob/master/src/core/js/views/questionView.js#L167

- https://github.com/adaptlearning/adapt_framework/blob/master/src/core/js/views/questionView.js#L87

Hope this help,

Chris

Picture of Christian Flanagan
Re: SCORM Events
by Christian Flanagan - Thursday, 11 September 2014, 3:16 PM
 

Yes, very helpful. Thanks.

One last thing, we're running our app in a client LMS (ExceedLMS). When the course is launched, it opens in a new window but that window contains a frameset. I need to route the communication between the course and the LMS to the parent frame.

Where would I make a change so that the API calls go up to the parent?

I hope that's not complete too confusing.

Picture of Chris Jones
Re: SCORM Events
by Chris Jones - Thursday, 11 September 2014, 4:49 PM
 

We use pipwerks SCORM wrapper to communicate. I think this should search the window opener and parent to find the API as per the SCORM specification, but I have never tried it with ExceedLMS in particular.

 

Picture of Christian Flanagan
Re: SCORM Events
by Christian Flanagan - Thursday, 11 September 2014, 4:54 PM
 

Actually, I got the issue with the framework solved.

When I navigate through our course, I'm monitoring via console.log the value of is_CourseComplete. It's false every step of the way until I get to the final block. Then:

Is Complete: {"spoor":{"completion":"11111111111111111111111111111111111111111111111111111111111111111","_isCourseComplete":false,"_isAssessmentPassed":false}}     adapt.min.js:128

Uncaught TypeError: undefined is not a function        adapt.min.js:128
(anonymous function)                                                  adapt.min.js:117
(anonymous function)

I'm assuming the error occurs while trying to set is_CourseComplete to true??

There's not much information to go on in the error message above. Is there a value in the course.json file that is required that might cause a value to be undefined and generate the error?

Picture of Chris Jones
Re: SCORM Events
by Chris Jones - Friday, 12 September 2014, 8:57 AM
 

Hi Christian,

I'll open an issue on the plugin (#44), I think it might be already resolved on the current 'in development' version by #27 and is awaiting release. 

If you would like to try out the develop branch on your project to see if it resolves the issue then that would be really helpful. you just need to install that version using the command:

      adapt install contrib-spoor#develop

I would not recommend using this for production release, but it may help identify if this issue has been resolved or is a new issue.

Note: you can return to the master version by running adapt install contrib-spoor 

Picture of Christian Flanagan
Re: SCORM Events
by Christian Flanagan - Friday, 12 September 2014, 3:16 PM
 

I installed a fresh project using adapt create course <name>. It behaves the same way, go all the way through the course and, when the last 0 turns to 1, it throws an error. I was hoping it was something we did on our project to cause the error, but that's not the case.

I'll give the dev branch a try.

Thanks, Chris.