Skip to content
This repository has been archived by the owner on May 15, 2021. It is now read-only.

Limit on Suspend Data #3

Open
chrisswany opened this issue Jan 5, 2018 · 3 comments
Open

Limit on Suspend Data #3

chrisswany opened this issue Jan 5, 2018 · 3 comments

Comments

@chrisswany
Copy link

I have some courses where the suspend data is over the standard limit of 4096 characters for 1.2. Some of them are up to 70-80k in length. When I try to resume where the user left off with this api it does not work when there is a larger suspend_data count. Do you know if there is a work around for it. Currently I am on SCORM cloud and it will continue using their scorm engine so there must be a work around. I am just storing the cmi data locally so it is not an issue with the data being stored incorrectly.

Just thought I would check to see if you have ran into this.

@skfriese
Copy link
Owner

skfriese commented Nov 1, 2018

Yeah, late reply. This is a dead project, so I don't monitor it.

That being said, I have not run into this. Are you certain this is an issue of length, and not special characters breaking the simple-scorm-api's ability to parse the suspend_data? I know there's an issue with the eval's in the Reload adapter, which you can easily address. There are probably forks of this project out there where this has been solved.

If you have a sample scenario SCO setup somewhere for me to review, I can look into it.

@andyresta
Copy link

I use this project too, what the mean suspend data ? I want to know, if my app have some problem too

@skfriese
Copy link
Owner

skfriese commented Nov 1, 2018

I'm not sure what you're asking. The suspend_data usage can be gleaned from the SCORM 1.2 docs.

One issue on which I've provided input in the past is the Reload API's use of "eval" all over the place, and its inability to handle JSON data or certain characters. A quick fix might look like this:

Instead of using this approach:

setString = "this." + element + ".cmivalue =\"" + pre + value + "\";";`
...
var result = eval(setString);

Simply use this:
var result = this[element + ".cmivalue"] = pre + value;

Full example:

// correct datatype...
// cmi.comments need to be appended...
if (element == "cmi.comments"){
  pre = this.LMSGetValue("cmi.comments");
  //setString = "this." + element + ".cmivalue =\"" + pre + value + "\";";
  var result = this[element + ".cmivalue"] = pre + value;
}
else{
  //setString = "this." + element + ".cmivalue =\"" + value + "\";";
  var result = this[element + ".cmivalue"] = value;
}

//var result = eval(setString);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants