Closed T0T4R4 closed 12 years ago
I checked your AS2 and AS3 wrappers, in which you implemented a different logic, and suggest you to fix the JS version as per the AS versions, which means replacing the whole IF block in line 456 by
if(value == "" && errorCode != 0){
trace(traceMsgPrefix +"failed. \nError code: " +errorCode +"\nError info: " +debug.getInfo(errorCode));
} else {
switch(parameter){
case "cmi.core.lesson_status":
case "cmi.completion_status" : scorm.data.completionStatus = value; break;
case "cmi.core.exit":
case "cmi.exit" : scorm.data.exitStatus = value; break;
}
}
Patched per your first comment, thanks. RE: comment #2, thanks for the suggestion, but it would be inconsistent with my use of error messages throughout the rest of the JS wrapper. Functionally, the fix from comment 1 is all that's needed, the rest is style.
No worries.
Javascript wrapper fails if API.GetValue returns an empty string value and API.GetLastError returns 0 , which is odd.
changing line 456 from if(value !== "" && errorCode === 0){ to if(value !== "" || errorCode === 0){
fixed the issue.