VBTrain.Net Documentation |
|
LmsApi: Error Checking JavaScript
Most of the LmsApi2 GetJs functions
(such as GetJsIntialize and
GetJsSetValue) have a boolean checkForError parameter. If this parameter is set to True,
the JavaScript code that the GetJs function returns will include logic
to check for an error after calling the specified API function.
The error checking JavaScript will do the following if an error is detected:
-
Calls the appropriate API function (LMSGetLastError for SCORM 1.2
or GetLastError for SCORM 1.3) to get the most recent error code from
the LMS. The return value is stored in the JavaScript variable
"<returnVarName>_errorCode", where <returnVarName> is specified in
the returnVarName parameter of the GetJs
function call.
-
Calls the appropriate API function ( LMSGetErrorString for SCORM 1.2
or GetErrorString
for SCORM 1.3) for the most recent textual error string. The return value is
stored in the JavaScript variable "<returnVarName>_errorString."
-
Calls the appropriate API function (LMSGetDiagnostic for SCORM 1.2 or GetDiagnostic
for SCORM 1.3) for the most recent diagnostic. The return value is stored in
the JavaScript variable "<returnVarName>_errorMoreInfo."
If error checking code is included but no error occurs, the above variables are
set to the following:
-
<returnVarName>_errorCode = ""
-
<returnVarName>_errorString = "No error."
-
<returnVarName>_errorMoreInfo = "no error."
If error checking code is not included, any errors from the API function calls
are ignored.
See Also
LmsApi2 Class | LmsApi
Members