Picture of AIi W
Course starts before SCORM data loaded
by AIi W - Saturday, 15 December 2018, 12:51 AM
 

Is there a way to put the course initialization on hold until the LMS initialize is complete?  Our adapt course races ahead before getting data from scorm back end and misses out on getting the essential variables needed for bookmarking to work.  Is there a way to press the breaks on initialization?

 

Picture of Matt Leathes
Re: Course starts before SCORM data loaded
by Matt Leathes - Saturday, 15 December 2018, 2:44 PM
 

it shouldn't do that... what versions of framework and spoor extension are you using? In the current version, this line causes Adapt to wait until all the data has been restored.

Picture of AIi W
Re: Course starts before SCORM data loaded
by AIi W - Saturday, 15 December 2018, 5:11 PM
 

adapt-contrib-spoor @3.0.3

framework 330

Do you know what data it is looking to have updated? and where is it looking for this data?

Picture of Matt Leathes
Re: Course starts before SCORM data loaded
by Matt Leathes - Saturday, 15 December 2018, 7:34 PM
 

it causes this function to run - and this is the data that is retrieved from the LMS as a result.

Picture of AIi W
Re: Course starts before SCORM data loaded
by AIi W - Friday, 4 January 2019, 1:40 PM
 

Here is the sequence of SCO events and they are causing the actual "suspend_data" (retrieved from the LMS) to be overwritten by the course, and it causes the progress to be lost.  Note the Ajax calls my code is issuing and when it returns, the spoor extension seems to be doing quite a bit, which i'd like to find a way to delay till after ajax return:

  1. Course loads, all CMI variables are empty except initialization of lesson_status = incomplete and cmi.exit = suspend
  2. Ajax calls are issued to get student data, and runtime (suspend_data, lesson_location, etc)
  3. Console shows "connection.initialize called"
  4. Console shows "SCORM.API.find: API found. Version: 1.2"
  5. Console shows various "SCORM.data.get" calls to cmi variables, but they are still blank bc Ajax hasn't returned yet
  6. Console shows SCORM.data.set('cmi.student_preference.language') to en
  7. Console shows SCORM.data.set('cmi.suspend_data')  value: {"lang":"en"}
  8. Ajax returns and populates the CMI variables (learner data, suspend_data, lesson_location,etc)
  9. Console shows "SCORM.data.set('cmi.suspend_data')  value: {"lang":"en","a11y":false}" <-- this is overwriting the suspend_data retried from the LMS

What do you suggest I do to slow / pause this behavior so ajax calls are setting the variables before spoor start to do its magic?

Picture of Matt Leathes
Re: Course starts before SCORM data loaded
by Matt Leathes - Monday, 7 January 2019, 1:11 PM
 

Well, it's the responsibility of the LMS to ensure that all this data IS readily available to the SCORM API so that the course doesn't have to pause/wait for the data - it should be able to call LMSGetValue to retrieve data from the LMS once it has launched, found the API and called LMSInitialize. It should not have to wait.

I would suggest that you don't actually load the course into the browser until the data is ready to go...

Sure, you probably could amend Adapt so that it does wait - but that would only fix the problem for Adapt courses... if you tried to use any other SCORM 1.2 content on this LMS you'd run into the exact same problem. It's really best sorted at the LMS level, not the course level.