Skip to main content
March 29, 2016
Question

Get and load Suspend Data

  • March 29, 2016
  • 1 reply
  • 763 views

We have a proprietary, non SCORM compliant, LMS written in ASP.NET.  We'd like to use Captivate 9 to author content.  We don't need much of the SCORM tracking, but we would like to be able to "save and restore" an interrupted session.

As I understand it, SCORM specifies (and Captivate implements) the use of a "suspend data" variable. 

Is it possible, via JavaScript, to read the current player's Suspend Data variable and then to restore a course using that same data?  I don't necessarily need to decode the data (assuming it's encoded), but I do need to be able to read the suspend data and then restart the course using that same data.

Any hints would be greatly appreciated.


Thanks in advance.

This topic has been closed for replies.

1 reply

TLCMediaDesign
Inspiring
March 30, 2016

If your LMS doesn't support SCORM, then there is no way you are going to be able to use the suspend_data, and if you could it would be difficult to parse it's format.

Depending on what information you want to track, you can get custom variables in the cp.ReportingVariables object.

I would also set up a progress array using the slide enter event listener. You can create a "myProgress" variable and store that array in that. Use 1's and 0's to designate visited slides.

You could store that information in your custom LMS or use localStorage. Here is an example I use for the progress in localStorage (HTML5 only):

var nc = document.location.toString();

var netConnected = nc.indexOf( 'http' );

//function to keep track of user's progress. Builds an array 0 = not completed, 1 = completed.
function initProgress()
{
var lessonStorage = cp.model.data.project.pN + '.progressData';  

if ( typeof( Storage ) !== 'undefined' && netConnected != -1 )
{
  if ( localStorage.getItem( lessonStorage ) !== null )
  {  
   var getResults = localStorage.getItem( lessonStorage );           
    myProgress = JSON.parse( getResults );
  }
}
else
{
  for ( var i = 0; i < window.cpInfoSlideCount; i++ )
  {
   myProgress[ i ] = 0;
  }
}
}

function setStorage()
{
var lessonStorage = cp.model.data.project.pN + '.progressData';

if ( typeof( Storage ) !== 'undefined' && netConnected != -1 )
{
  localStorage.setItem( lessonStorage, JSON.stringify( myProgress ) );
}
}