We are currently facing a design problem implementing a SCORM LMS System. For example, the API defined a function LMSCommit which must return either 'true' or 'false'. Within that method, our LMS has to make an asynchronous call to a server side service, using a callback function containing the success or failure message in its argument. We claim, that this is simply not possible! Yet we think its worthwhile to ask some pros whether there is something we are missing here.
The SCO (no influence on our part) calls the method like this:
var result = LMSCommit('');
Our LMS (influence on our part) we implement something like this:
function LMSCommit(useless) {
callOurServiceFunction(function(Status) {
// what am I supposed to do here in order to put status into
// the return value of the outer function???
}
// fake true as the callourServiceFunction returned immediatly,
// no idea how I can use Status to create a return value
return 'true';
}
Are we missing some fancy trick here or is the SCORM Standard simply "disputable"?