var blnCalledFinish = false; var blnStandAlone = false; var blnLoaded = false; var blnReachedEnd = false; var blnStatusWasSet = false; var blnLmsPresent = false; var dtmStart = null; var dtmEnd = null; var intAccumulatedMS = 0; var blnOverrodeTime = false; var intTimeOverrideMS = null; var aryDebug = new Array(); var strDebug = ""; var winDebug; var intError = NO_ERROR; var strErrorDesc = ""; var objLMS = null; function Start(){ var strStandAlone; var strShowInteractiveDebug; var objTempAPI = null; var strTemp = ""; WriteToDebug("In Start - Version: " + VERSION + "  Last Modified=" + window.document.lastModified); WriteToDebug("Browser Info (" + navigator.appName + " " + navigator.appVersion + ")"); WriteToDebug("URL: " + window.document.location.href); ClearErrorInfo(); strStandAlone = GetQueryStringValue("StandAlone", window.location.search); strShowInteractiveDebug = GetQueryStringValue("ShowDebug", window.location.search); WriteToDebug("strStandAlone=" + strStandAlone + "  strShowInteractiveDebug=" + strShowInteractiveDebug); if (ConvertStringToBoolean(strStandAlone)){ WriteToDebug("Entering Stand Alone Mode"); blnStandAlone = true;}
if (blnStandAlone){ WriteToDebug("Using NONE Standard"); objLMS = new LMSStandardAPI("NONE");}
else{ WriteToDebug("Standard From Configuration File - " + strLMSStandard); if (strLMSStandard.toUpperCase() == "AUTO"){ WriteToDebug("Auto-detecting standard - Searching for SCORM 2004 API"); try{ objTempAPI = SCORM2004_GrabAPI();}
catch (e){ WriteToDebug("Error grabbing 2004 API-" + e.name + ":" + e.message);}
if (! (typeof(objTempAPI) == "undefined" || objTempAPI == null)){ WriteToDebug("Found SCORM 2004 API, using SCORM 2004"); objLMS = new LMSStandardAPI("SCORM2004"); blnLmsPresent = true;}
else{ WriteToDebug("Searching for SCORM 1.2 API"); try{ objTempAPI = SCORM_GrabAPI();}
catch (e){ WriteToDebug("Error grabbing 1.2 API-" + e.name + ":" + e.message);}
if (! (typeof(objTempAPI) == "undefined" || objTempAPI == null)){ WriteToDebug("Found SCORM API, using SCORM"); objLMS = new LMSStandardAPI("SCORM"); blnLmsPresent = true;}
else{ WriteToDebug("Searching for AICC querystring parameters"); strTemp = GetQueryStringValue("AICC_URL", document.location.search); if(strTemp != ""){ WriteToDebug("Found AICC querystring parameters, using AICC"); objLMS = new LMSStandardAPI("AICC"); blnLmsPresent = true;}
else{ WriteToDebug("Could not determine standard, defaulting to Stand Alone"); objLMS = new LMSStandardAPI("NONE");}
}
}
}else{ WriteToDebug("Using Standard From Configuration File - " + strLMSStandard); objLMS = new LMSStandardAPI(strLMSStandard); blnLmsPresent = true;}
}
if (ConvertStringToBoolean(strShowInteractiveDebug)){ WriteToDebug("Showing Interactive Debug Windows"); ShowDebugWindow();}
WriteToDebug("Calling Standard Initialize"); objLMS.Initialize(); return;}
function InitializeExecuted(blnSuccess, strErrorMessage){ WriteToDebug("In InitializeExecuted, blnSuccess=" + blnSuccess + ", strErrorMessage=" + strErrorMessage); if (!blnSuccess){ WriteToDebug("ERROR - LMS Initialize Failed"); if (strErrorMessage == ""){ strErrorMessage = "An Error Has Occurred";}
blnLmsPresent = false; DisplayError(strErrorMessage); return;}
blnLoaded = true; dtmStart = new Date(); LoadContent(); return;}
function ExecFinish(ExitType){ WriteToDebug("In ExecFinish, ExiType=" + ExitType); ClearErrorInfo(); if (blnLoaded && ! blnCalledFinish ){ WriteToDebug("Haven't called finish before, finishing"); blnCalledFinish = true; if (blnReachedEnd){ WriteToDebug("Reached End, overiding exit type to FINISH"); ExitType = EXIT_TYPE_FINISH;}
WriteToDebug("Did not override time"); dtmEnd = new Date(); AccumulateTime(); objLMS.SaveTime(intAccumulatedMS); blnLoaded = false; WriteToDebug("Calling LMS Finish"); return objLMS.Finish(ExitType, blnStatusWasSet);}
return true;}
function IsLoaded(){ WriteToDebug("In IsLoaded, returning -" + blnLoaded); return blnLoaded;}
function WriteToDebug(strInfo){ if (blnDebug){ var dtm = new Date(); var strLine; strLine = aryDebug.length + ":" + dtm.toString() + " - " + strInfo; aryDebug[aryDebug.length] = strLine; if (winDebug && !winDebug.closed){ winDebug.document.write(strLine + "<br>\n");}
}
return;}
function ShowDebugWindow(){ if (winDebug && !winDebug.closed){ winDebug.close();}
winDebug = window.open("blank.html", "Debug", "width=600,height=300,resizable,scrollbars"); winDebug.document.write(aryDebug.join("<br>\n")); winDebug.document.close(); winDebug.focus(); return;}
function DisplayError(strMessage){ var blnShowDebug; WriteToDebug("In DisplayError, strMessage=" + strMessage); blnShowDebug = confirm("An error has occured:\n\n" + strMessage + "\n\nPress 'OK' to view debug information to send to technical support."); if (blnShowDebug){ ShowDebugWindow();}
}
function GetLastError(){ WriteToDebug("In GetLastError, intError=" + intError); if (intError != NO_ERROR){ WriteToDebug("Returning API Error"); return intError;}
else if (IsLoaded() && objLMS.GetLastError() != NO_ERROR){ WriteToDebug("Returning LMS Error"); return ERROR_LMS;}
WriteToDebug("Returning No Error"); return NO_ERROR;}
function GetLastLMSErrorCode(){ WriteToDebug("In GetLastLMSErrorCode, intError=" + intError); var LMSError = objLMS.GetLastError(); if (IsLoaded() && LMSError != NO_ERROR){ WriteToDebug("Returning LMS Error: " + LMSError); return LMSError;}
WriteToDebug("Returning No Error"); return NO_ERROR;}
function GetLastErrorDesc(){ WriteToDebug("In GetLastErrorDesc"); if (intError != NO_ERROR){ WriteToDebug("Returning API Error - " + strErrorDesc); return strErrorDesc;}
else if (IsLoaded() && objLMS.GetLastError() != NO_ERROR){ WriteToDebug("returning LMS Error"); return objLMS.GetLastErrorDesc;}
WriteToDebug("Returning No Error"); return "";}
function SetErrorInfo(intErrorNumToSet, strErrorDescToSet){ WriteToDebug("In SetErrorInfo - Num=" + intErrorNumToSet + " Desc=" + strErrorDescToSet); intError = intErrorNumToSet; strErrorDesc = strErrorDescToSet;}
function ClearErrorInfo(){ WriteToDebug("In ClearErrorInfo"); var intError = NO_ERROR; var strErrorDesc = "";}
function CommitData(){ WriteToDebug("In CommitData"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
if (! blnOverrodeTime){ WriteToDebug("Did not override time, saving incremental time"); dtmEnd = new Date(); AccumulateTime(); dtmStart = new Date(); objLMS.SaveTime(intAccumulatedMS);}
return objLMS.CommitData();}
function Suspend(){ WriteToDebug("In Suspend"); ClearErrorInfo(); return ExecFinish(EXIT_TYPE_SUSPEND);}
function Finish(){ WriteToDebug("In Finish"); ClearErrorInfo(); return ExecFinish(EXIT_TYPE_FINISH);}
function TimeOut(){ WriteToDebug("In TimeOut"); ClearErrorInfo(); return ExecFinish(EXIT_TYPE_TIMEOUT);}
function Unload(){ WriteToDebug("In Unload"); ClearErrorInfo(); return ExecFinish(DEFAULT_EXIT_TYPE);}
function SetReachedEnd(){ WriteToDebug("In SetReachedEnd"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
if (blnStatusWasSet == false){ objLMS.SetCompleted();}
blnReachedEnd = true; return true;}
function ConcedeControl()
{ WriteToDebug("Conceding control with type: " + EXIT_BEHAVIOR); ClearErrorInfo(); var contentRoot = null; switch (EXIT_BEHAVIOR)
{ case "SCORM_RECOMMENDED":
contentRoot = SearchParentsForContentRoot(); if (contentRoot==window.top)
{ Suspend(); contentRoot.window.close();}
else
{ Suspend(); if (contentRoot != null){ contentRoot.content.location.href=EXIT_TARGET;}
}
break; case "ALWAYS_CLOSE":
Suspend(); window.close(); break; case "ALWAYS_CLOSE_TOP":
Suspend(); window.top.close(); break; case "NOTHING":
Suspend(); break; case "REDIR_CONTENT_FRAME":
Suspend(); contentRoot = SearchParentsForContentRoot(); if (contentRoot != null){ contentRoot.content.location.href=EXIT_TARGET;}
break;}
return true;}
function SearchParentsForContentRoot(){ var contentRoot = null; var wnd = window; var i=0; if (wnd.content){ contentRoot = wnd; return contentRoot;}
while (contentRoot == null && wnd != window.top && (i++ < 100)){ if (wnd.content){ contentRoot = wnd; return contentRoot;}
else{ wnd = wnd.parent;}
}
WriteToDebug("Unable to locate content root"); return null;}
function GetStudentID(){ WriteToDebug("In GetStudentID"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return "";}
return objLMS.GetStudentID();}
function GetStudentName(){ WriteToDebug("In GetStudentName"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return "";}
return objLMS.GetStudentName();}
function GetBookmark(){ WriteToDebug("In GetBookmark"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return "";}
return objLMS.GetBookmark();}
function SetBookmark(strBookmark){ WriteToDebug("In SetBookmkar - strBookmark=" + strBookmark); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.SetBookmark(strBookmark);}
function GetDataChunk(){ WriteToDebug("In GetDataChunk"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return "";}
return objLMS.GetDataChunk();}
function SetDataChunk(strData){ WriteToDebug("In SetDataChunk strData=" + strData); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.SetDataChunk(strData);}
function GetLaunchData(){ WriteToDebug("In GetLaunchData"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return "";}
return objLMS.GetLaunchData();}
function GetComments(){ var strCommentString; var aryComments; var i; WriteToDebug("In GetComments"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return null;}
strCommentString = objLMS.GetComments(); WriteToDebug("strCommentString=" + strCommentString); strCommentString = new String(strCommentString); if (strCommentString != ""){ aryComments = strCommentString.split(" | "); for (i=0; i < aryComments.length; i++){ WriteToDebug("Returning Comment #" + i); aryComments[i] = new String(aryComments[i]); aryComments[i] = aryComments[i].replace(/\|\|/g, "|"); WriteToDebug("Comment #" + i + "=" + aryComments[i]);}
}
else{ aryComments = new Array(0);}
return aryComments;}
function WriteComment(strComment){ var strExistingCommentString; WriteToDebug("In WriteComment strComment=" + strComment); ClearErrorInfo(); strComment = new String(strComment); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
strComment = strComment.replace(/\|/g, "||"); strExistingCommentString = objLMS.GetComments(); if (strExistingCommentString != ""){ strComment = " | " + strComment;}
strComment = strComment; return objLMS.WriteComment(strComment);}
function GetLMSComments(){ WriteToDebug("In GetLMSComments"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return "";}
return objLMS.GetLMSComments();}
function GetAudioPlayPreference(){ WriteToDebug("In GetAudioPlayPreference"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return PREFERENCE_DEFAULT;}
return objLMS.GetAudioPlayPreference();}
function GetAudioVolumePreference(){ WriteToDebug("GetAudioVolumePreference"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return 100;}
return objLMS.GetAudioVolumePreference();}
function SetAudioPreference(PlayPreference, intPercentOfMaxVolume){ WriteToDebug("In SetAudioPreference PlayPreference=" + PlayPreference + " intPercentOfMaxVolume=" + intPercentOfMaxVolume); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
if (PlayPreference != PREFERENCE_OFF &&
PlayPreference != PREFERENCE_ON){ WriteToDebug("Error Invalid PlayPreference"); SetErrorInfo(ERROR_INVALID_PREFERENCE, "Invalid PlayPreference passed to SetAudioPreference, PlayPreference=" + PlayPreference); return false;}
if ( ! ValidInteger(intPercentOfMaxVolume) ){ WriteToDebug("Error Invalid PercentOfMaxVolume - not an integer"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid PercentOfMaxVolume passed to SetAudioPreference (not an integer), intPercentOfMaxVolume=" + intPercentOfMaxVolume); return false;}
intPercentOfMaxVolume = parseInt(intPercentOfMaxVolume, 10); if (intPercentOfMaxVolume < 1 || intPercentOfMaxVolume > 100){ WriteToDebug("Error Invalid PercentOfMaxVolume - out of range"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid PercentOfMaxVolume passed to SetAudioPreference (must be between 1 and 100), intPercentOfMaxVolume=" + intPercentOfMaxVolume); return false;}
WriteToDebug("Calling to LMS"); return objLMS.SetAudioPreference(PlayPreference, intPercentOfMaxVolume);}
function GetLanguagePreference(){ WriteToDebug("In GetLanguagePreference"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return "";}
return objLMS.GetLanguagePreference();}
function SetLanguagePreference(strLanguage){ WriteToDebug("In SetLanguagePreference strLanguage=" + strLanguage); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.SetLanguagePreference(strLanguage);}
function GetSpeedPreference(){ WriteToDebug("In GetSpeedPreference"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return 100;}
return objLMS.GetSpeedPreference();}
function SetSpeedPreference(intPercentOfMax){ WriteToDebug("In SetSpeedPreference intPercentOfMax=" + intPercentOfMax); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
if ( ! ValidInteger(intPercentOfMax) ){ WriteToDebug("ERROR Invalid Percent of MaxSpeed, not an integer"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid PercentOfMaxSpeed passed to SetSpeedPreference (not an integer), intPercentOfMax=" + intPercentOfMax); return false;}
intPercentOfMax = parseInt(intPercentOfMax, 10); if (intPercentOfMax < 0 || intPercentOfMax > 100){ WriteToDebug("ERROR Invalid Percent of MaxSpeed, out of range"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid PercentOfMaxSpeed passed to SetSpeedPreference (must be between 1 and 100), intPercentOfMax=" + intPercentOfMax); return false;}
WriteToDebug("Calling to LMS"); return objLMS.SetSpeedPreference(intPercentOfMax);}
function GetTextPreference(){ WriteToDebug("In GetTextPreference"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetTextPreference();}
function SetTextPreference(intPreference){ WriteToDebug("In SetTextPreference intPreference=" + intPreference); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
if (intPreference != PREFERENCE_DEFAULT &&
intPreference != PREFERENCE_OFF &&
intPreference != PREFERENCE_ON){ WriteToDebug("Error - Invalid Preference"); SetErrorInfo(ERROR_INVALID_PREFERENCE, "Invalid Preference passed to SetTextPreference, intPreference=" + intPreference); return false;}
return objLMS.SetTextPreference(intPreference);}
function GetPreviouslyAccumulatedTime(){ WriteToDebug("In GetPreviouslyAccumulatedTime"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return 0;}
return objLMS.GetPreviouslyAccumulatedTime();}
function AccumulateTime(){ WriteToDebug("In AccumulateTime dtmStart=" + dtmStart + " dtmEnd=" + dtmEnd + " intAccumulatedMS=" + intAccumulatedMS); if (dtmEnd != null && dtmStart != null){ WriteToDebug("Accumulating Time"); intAccumulatedMS += (dtmEnd.getTime() - dtmStart.getTime()); WriteToDebug("intAccumulatedMS=" + intAccumulatedMS);}
}
function GetSessionAccumulatedTime(){ WriteToDebug("In GetSessionAccumulatedTime"); ClearErrorInfo(); WriteToDebug("Setting dtmEnd to now"); dtmEnd = new Date(); WriteToDebug("Accumulating Time"); AccumulateTime(); if (dtmStart != null){ WriteToDebug("Resetting dtmStart"); dtmStart = new Date();}
WriteToDebug("Setting dtmEnd to null"); dtmEnd = null; WriteToDebug("Returning " + intAccumulatedMS); return intAccumulatedMS;}
function SetSessionTime(intMilliseconds){ WriteToDebug("In SetSessionTime"); ClearErrorInfo(); if ( ! ValidInteger(intMilliseconds)){ WriteToDebug("ERROR parameter is not an integer"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid intMilliseconds passed to SetSessionTime (not an integer), intMilliseconds=" + intMilliseconds); return false;}
intMilliseconds = parseInt(intMilliseconds, 10); if (intMilliseconds < 0){ WriteToDebug("Error, parameter is less than 0"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid intMilliseconds passed to SetSessionTime (must be greater than 0), intMilliseconds=" + intMilliseconds); return false;}
blnOverrodeTime = true; intTimeOverrideMS = intMilliseconds; objLMS.SaveTime(intTimeOverrideMS); return true;}
function PauseTimeTracking(){ WriteToDebug("In PauseTimeTracking"); ClearErrorInfo(); WriteToDebug("Setting dtmEnd to now"); dtmEnd = new Date(); WriteToDebug("Accumulating Time"); AccumulateTime(); WriteToDebug("Setting Start and End times to null"); dtmStart = null; dtmEnd = null; return true;}
function ResumeTimeTracking(){ WriteToDebug("In ResumeTimeTracking"); ClearErrorInfo(); WriteToDebug("Setting dtmStart to now"); dtmStart = new Date(); return true;}
function GetMaxTimeAllowed(){ WriteToDebug("In GetMaxTimeAllowed"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return MAX_CMI_TIME;}
return objLMS.GetMaxTimeAllowed();}
function DisplayMessageOnTimeout(){ WriteToDebug("In DisplayMessageOnTimeOut"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.DisplayMessageOnTimeout();}
function ExitOnTimeout(){ WriteToDebug("In ExitOnTimeOut"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.ExitOnTimeout();}
function GetPassingScore(){ WriteToDebug("In GetPassingScore"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return 0;}
return objLMS.GetPassingScore();}
function GetScore(){ WriteToDebug("In GetScore"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return 0;}
return objLMS.GetScore();}
function SetScore(intScore, intMaxScore, intMinScore){ WriteToDebug("In SetScore, intScore=" + intScore + ", intMaxScore=" + intMaxScore + ", intMinScore=" + intMinScore); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
if (! IsValidDecimal(intScore)){ WriteToDebug("ERROR - intScore not a valid decimal"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Score passed to SetScore (not a valid decimal), intScore=" + intScore); return false;}
if (! IsValidDecimal(intMaxScore)){ WriteToDebug("ERROR - intMaxScore not a valid decimal"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Max Score passed to SetScore (not a valid decimal), intMaxScore=" + intMaxScore); return false;}
if (! IsValidDecimal(intMinScore)){ WriteToDebug("ERROR - intMinScore not a valid decimal"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Min Score passed to SetScore (not a valid decimal), intMinScore=" + intMinScore); return false;}
WriteToDebug("Converting SCORES to floats"); intScore = parseFloat(intScore); intMaxScore = parseFloat(intMaxScore); intMinScore = parseFloat(intMinScore); if (intScore < 0 || intScore > 100){ WriteToDebug("ERROR - intScore out of range"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Score passed to SetScore (must be between 0-100), intScore=" + intScore); return false;}
if (intMaxScore < 0 || intMaxScore > 100){ WriteToDebug("ERROR - intMaxScore out of range"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Max Score passed to SetScore (must be between 0-100), intMaxScore=" + intMaxScore); return false;}
if (intMinScore < 0 || intMinScore > 100){ WriteToDebug("ERROR - intMinScore out of range"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Min Score passed to SetScore (must be between 0-100), intMinScore=" + intMinScore); return false;}
WriteToDebug("Calling to LMS"); return objLMS.SetScore(intScore, intMaxScore, intMinScore);}
function CreateResponseIdentifier(strShort, strLong){ if (strShort.replace(" ", "") == ""){ WriteToDebug("Short Identifier is empty"); SetErrorInfo(ERROR_INVALID_ID, "Invalid short identifier, strShort=" + strShort); return false;}
if (strShort.length != 1){ WriteToDebug("ERROR - Short Identifier  not 1 character"); SetErrorInfo(ERROR_INVALID_ID, "Invalid short identifier, strShort=" + strShort); return false;}
if ( ! IsAlphaNumeric(strShort) ){ WriteToDebug("ERROR - Short Identifier  not alpha numeric"); SetErrorInfo(ERROR_INVALID_ID, "Invalid short identifier, strShort=" + strShort); return false;}
strShort = strShort.toLowerCase(); strLong = CreateValidIdentifier(strLong); return new ResponseIdentifier(strShort, strLong);}
function ResponseIdentifier(strShort, strLong){ this.Short = new String(strShort); this.Long = new String(strLong); this.toString = function (){ return "[Response Identifier " + this.Short + ", " + this.Long + "]";}
}
function MatchingResponse(source, target){ if (source.constructor == String){ source = CreateResponseIdentifier(source, source);}
if (target.constructor == String){ target = CreateResponseIdentifier(target, target);}
this.Source = source; this.Target = target; this.toString = function (){ return "[Matching Response " + this.Source + ", " + this.Target + "]";}
}
function CreateMatchingResponse(pattern)
{ var aryPairs = new Array(); var aryEachPair = new Array(); var pattern = new String(pattern); aryPairs = pattern.split("[,]"); for(var i=0; i<aryPairs.length; i++)
{ var thisPair = new String(aryPairs[i]); aryEachPair = thisPair.split("[.]"); WriteToDebug("Matching Response [" + i + "]  source: " + aryEachPair[0] + "  target: " + aryEachPair[1]); aryPairs[i] = new MatchingResponse(aryEachPair[0], aryEachPair[1]);}
WriteToDebug("pattern: " + pattern + " becomes " + aryPairs[0]); if (aryPairs.length==0) return aryPairs[0]; else return aryPairs;}
function CreateValidIdentifier(str){ str = new String(str); str = Trim(str); if (str.toLowerCase().indexOf("urn:") == 0){ str = str.substr(4);}
str = str.replace(/[^\w\-\(\)\+\.\:\=\@\;\$\_\!\*\'\%]/g, "_")
return str;}
function Trim(str){ str = str.replace(/^\s*/, ""); str = str.replace(/\s*$/, ""); return str;}
function RecordTrueFalseInteraction(strID, blnResponse, blnCorrect, blnCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID){ WriteToDebug("In RecordTrueFalseInteraction strID=" + strID + ", blnResponse=" + blnResponse + ", blnCorrect=" + blnCorrect + ", blnCorrectResponse=" + blnCorrectResponse + ", strDescription=" + strDescription + ", intWeighting=" + intWeighting + ", intLatency=" + intLatency + ", strLearningObjectiveID=" + strLearningObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
if (blnResponse != true && blnResponse != false){ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The Response parameter must be a valid boolean value."); return false;}
if (blnCorrectResponse != null && blnCorrectResponse != true && blnCorrectResponse != false){ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The Correct Response parameter must be a valid boolean value or null."); return false;}
var dtmTime = new Date(); WriteToDebug("Calling to LMS"); return objLMS.RecordTrueFalseInteraction(strID, blnResponse, blnCorrect, blnCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime);}
function RecordMultipleChoiceInteraction(strID, response, blnCorrect, correctResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID){ WriteToDebug("In RecordMultipleChoiceInteraction strID=" + strID + ", response=" + response + ", blnCorrect=" + blnCorrect + ", correctResponse=" + correctResponse + ", strDescription=" + strDescription + ", intWeighting=" + intWeighting + ", intLatency=" + intLatency + ", strLearningObjectiveID=" + strLearningObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
strID = new String(strID); var aryResponse; var aryCorrectResponse; if (response.constructor == String){ aryResponse = new Array(); var responseIdentifier = CreateResponseIdentifier(response, response); if (responseIdentifier == false){ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The response is not in the correct format"); return false;}
aryResponse[0] = responseIdentifier;}
else if (response.constructor == ResponseIdentifier){ aryResponse = new Array(); aryResponse[0] = response;}
else if (response.constructor == Array || response.constructor.toString().search("Array") > 0){ aryResponse = response;}
else if(window.console && response.constructor.toString() == '(Internal Function)' && response.length > 0){ aryResponse = response;}
else{ if(window.console){ window.console.log("ERROR_INVALID_INTERACTION_RESPONSE :: The response is not in the correct format.");}
SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The response is not in the correct format"); return false;}
if (correctResponse != null && correctResponse != undefined && correctResponse != ""){ if (correctResponse.constructor == String){ aryCorrectResponse = new Array(); var responseIdentifier = CreateResponseIdentifier(correctResponse, correctResponse); if (responseIdentifier == false){ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The correct response is not in the correct format"); return false;}
aryCorrectResponse[0] = responseIdentifier;}
else if (correctResponse.constructor == ResponseIdentifier){ aryCorrectResponse = new Array(); aryCorrectResponse[0] = correctResponse;}
else if (correctResponse.constructor == Array || correctResponse.constructor.toString().search("Array") > 0){ aryCorrectResponse = correctResponse;}
else if(window.console && correctResponse.constructor.toString() == '(Internal Function)' && correctResponse.length > 0){ aryCorrectResponse = correctResponse;}
else{ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The correct response is not in the correct format"); return false;}
}
else{ aryCorrectResponse = new Array();}
var dtmTime = new Date(); WriteToDebug("Calling to LMS"); return objLMS.RecordMultipleChoiceInteraction(strID, aryResponse, blnCorrect, aryCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime);}
function RecordFillInInteraction(strID, strResponse, blnCorrect, strCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID){ WriteToDebug("In RecordFillInInteraction strID=" + strID + ", strResponse=" + strResponse + ", blnCorrect=" + blnCorrect + ", strCorrectResponse=" + strCorrectResponse + ", strDescription=" + strDescription + ", intWeighting=" + intWeighting + ", intLatency=" + intLatency + ", strLearningObjectiveID=" + strLearningObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
var dtmTime = new Date(); WriteToDebug("Calling to LMS"); return objLMS.RecordFillInInteraction(strID, strResponse, blnCorrect, strCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime);}
function RecordMatchingInteraction(strID, response, blnCorrect, correctResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID){ WriteToDebug("In RecordMatchingInteraction strID=" + strID + ", response=" + response + ", blnCorrect=" + blnCorrect + ", correctResponse=" + correctResponse + ", strDescription=" + strDescription + ", intWeighting=" + intWeighting + ", intLatency=" + intLatency + ", strLearningObjectiveID=" + strLearningObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
var aryResponse; var aryCorrectResponse; if (response.constructor == MatchingResponse){ aryResponse = new Array(); aryResponse[0] = response;}
else if (response.constructor == Array || response.constructor.toString().search("Array") > 0){ aryResponse = response;}
else if(window.console && response.constructor.toString() == '(Internal Function)' && response.length > 0){ aryResponse = response;}
else{ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The response is not in the correct format"); return false;}
if (correctResponse != null && correctResponse != undefined){ if (correctResponse.constructor == MatchingResponse){ aryCorrectResponse = new Array(); aryCorrectResponse[0] = correctResponse;}
else if (correctResponse.constructor == Array || correctResponse.constructor.toString().search("Array") > 0){ aryCorrectResponse = correctResponse;}
else if(window.console && correctResponse.constructor.toString() == '(Internal Function)' && correctResponse.length > 0){ aryCorrectResponse = correctResponse;}
else{ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The response is not in the correct format"); return false;}
}
else{ aryCorrectResponse = new Array();}
var dtmTime = new Date(); WriteToDebug("Calling to LMS"); return objLMS.RecordMatchingInteraction(strID, aryResponse, blnCorrect, aryCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime);}
function RecordPerformanceInteraction(strID, strResponse, blnCorrect, strCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID){ WriteToDebug("In RecordPerformanceInteraction strID=" + strID + ", strResponse=" + strResponse + ", blnCorrect=" + blnCorrect + ", strCorrectResponse=" + strCorrectResponse + ", strDescription=" + strDescription + ", intWeighting=" + intWeighting + ", intLatency=" + intLatency + ", strLearningObjectiveID=" + strLearningObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
var dtmTime = new Date(); WriteToDebug("Calling to LMS"); return objLMS.RecordPerformanceInteraction(strID, strResponse, blnCorrect, strCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime);}
function RecordSequencingInteraction(strID, response, blnCorrect, correctResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID){ WriteToDebug("In RecordSequencingInteraction strID=" + strID + ", response=" + response + ", blnCorrect=" + blnCorrect + ", correctResponse=" + correctResponse + ", strDescription=" + strDescription + ", intWeighting=" + intWeighting + ", intLatency=" + intLatency + ", strLearningObjectiveID=" + strLearningObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
var aryResponse; var aryCorrectResponse; if (response.constructor == String){ aryResponse = new Array(); var responseIdentifier = CreateResponseIdentifier(response, response); if (responseIdentifier == false){ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The response is not in the correct format"); return false;}
aryResponse[0] = responseIdentifier;}
else if (response.constructor == ResponseIdentifier){ aryResponse = new Array(); aryResponse[0] = response;}
else if (response.constructor == Array || response.constructor.toString().search("Array") > 0){ aryResponse = response;}
else if(window.console && response.constructor.toString() == '(Internal Function)' && response.length > 0){ aryResponse = response;}
else{ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The response is not in the correct format"); return false;}
if (correctResponse != null && correctResponse != undefined && correctResponse != ""){ if (correctResponse.constructor == String){ aryCorrectResponse = new Array(); var responseIdentifier = CreateResponseIdentifier(correctResponse, correctResponse); if (responseIdentifier == false){ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The correct response is not in the correct format"); return false;}
aryCorrectResponse[0] = responseIdentifier;}
else if (correctResponse.constructor == ResponseIdentifier){ aryCorrectResponse = new Array(); aryCorrectResponse[0] = correctResponse;}
else if (correctResponse.constructor == Array || correctResponse.constructor.toString().search("Array") > 0){ aryCorrectResponse = correctResponse;}
else if(window.console && correctResponse.constructor.toString() == '(Internal Function)' && correctResponse.length > 0){ aryCorrectResponse = correctResponse;}
else{ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The correct response is not in the correct format"); return false;}
}
else{ aryCorrectResponse = new Array();}
var dtmTime = new Date(); WriteToDebug("Calling to LMS"); return objLMS.RecordSequencingInteraction(strID, aryResponse, blnCorrect, aryCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime);}
function RecordLikertInteraction(strID, response, blnCorrect, correctResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID){ WriteToDebug("In RecordLikertInteraction strID=" + strID + ", response=" + response + ", blnCorrect=" + blnCorrect + ", correctResponse=" + correctResponse + ", strDescription=" + strDescription + ", intWeighting=" + intWeighting + ", intLatency=" + intLatency + ", strLearningObjectiveID=" + strLearningObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
var riResponse; var riCorrectResponse; if (response.constructor == String){ riResponse = CreateResponseIdentifier(response, response);}
else if (response.constructor == ResponseIdentifier){ riResponse = response;}
else{ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The response is not in the correct format"); return false;}
if (correctResponse == null || correctResponse == undefined){ riCorrectResponse = null;}
else if (correctResponse.constructor == ResponseIdentifier){ riCorrectResponse = correctResponse;}
else if (correctResponse.constructor == String){ riCorrectResponse = CreateResponseIdentifier(correctResponse, correctResponse);}
else{ SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE, "The response is not in the correct format"); return false;}
var dtmTime = new Date(); WriteToDebug("Calling to LMS"); return objLMS.RecordLikertInteraction(strID, riResponse, blnCorrect, riCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime);}
function RecordNumericInteraction(strID, strResponse, blnCorrect, strCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID){ WriteToDebug("In RecordNumericInteraction strID=" + strID + ", strResponse=" + strResponse + ", blnCorrect=" + blnCorrect + ", strCorrectResponse=" + strCorrectResponse + ", strDescription=" + strDescription + ", intWeighting=" + intWeighting + ", intLatency=" + intLatency + ", strLearningObjectiveID=" + strLearningObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
if (! IsValidDecimal(strResponse)){ WriteToDebug("ERROR - Invalid Response, not a valid decmial"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Response passed to RecordNumericInteraction (not a valid decimal), strResponse=" + strResponse); return false;}
if (strCorrectResponse != undefined && strCorrectResponse != null && IsValidDecimal(strCorrectResponse) == false){ WriteToDebug("ERROR - Invalid Correct Response, not a valid decmial"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Correct Response passed to RecordNumericInteraction (not a valid decimal), strCorrectResponse=" + strCorrectResponse); return false;}
var dtmTime = new Date(); WriteToDebug("Calling to LMS"); return objLMS.RecordNumericInteraction(strID, strResponse, blnCorrect, strCorrectResponse, strDescription, intWeighting, intLatency, strLearningObjectiveID, dtmTime);}
function GetStatus(){ WriteToDebug("In GetStatus"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return LESSON_STATUS_INCOMPLETE;}
return objLMS.GetStatus();}
function ResetStatus(){ WriteToDebug("In ResetStatus"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
WriteToDebug("Setting blnStatusWasSet to false"); blnStatusWasSet = false; return objLMS.ResetStatus();}
function SetPassed(){ WriteToDebug("In SetPassed"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
WriteToDebug("Setting blnStatusWasSet to true"); blnStatusWasSet = true; return objLMS.SetPassed();}
function SetFailed(){ WriteToDebug("In SetFailed"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
WriteToDebug("Setting blnStatusWasSet to true"); blnStatusWasSet = true; return objLMS.SetFailed();}
function GetEntryMode(){ WriteToDebug("In GetEntryMode"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return ENTRY_FIRST_TIME;}
return objLMS.GetEntryMode();}
function GetLessonMode(){ WriteToDebug("In GetLessonMode"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return MODE_NORMAL;}
return objLMS.GetLessonMode();}
function GetTakingForCredit(){ WriteToDebug("In GetTakingForCredit"); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetTakingForCredit();}
function SetObjectiveScore(strObjectiveID, intScore, intMaxScore, intMinScore){ WriteToDebug("In SetObjectiveScore, intObjectiveID=" + strObjectiveID + ", intScore=" + intScore + ", intMaxScore=" + intMaxScore + ", intMinScore=" + intMinScore); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
strObjectiveID = new String(strObjectiveID); if (strObjectiveID.replace(" ", "") == ""){ WriteToDebug("ERROR - Invalid ObjectiveID, empty string"); SetErrorInfo(ERROR_INVALID_ID, "Invalid ObjectiveID passed to SetObjectiveScore (must have a value), strObjectiveID=" + strObjectiveID); return false;}
if (! IsValidDecimal(intScore)){ WriteToDebug("ERROR - Invalid Score, not a valid decmial"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Score passed to SetObjectiveScore (not a valid decimal), intScore=" + intScore); return false;}
if (! IsValidDecimal(intMaxScore)){ WriteToDebug("ERROR - Invalid Max Score, not a valid decmial"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Max Score passed to SetObjectiveScore (not a valid decimal), intMaxScore=" + intMaxScore); return false;}
if (! IsValidDecimal(intMinScore)){ WriteToDebug("ERROR - Invalid Min Score, not a valid decmial"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Min Score passed to SetObjectiveScore (not a valid decimal), intMinScore=" + intMinScore); return false;}
WriteToDebug("Converting Scores to floats"); intScore = parseFloat(intScore); intMaxScore = parseFloat(intMaxScore); intMinScore = parseFloat(intMinScore); if (intScore < 0 || intScore > 100){ WriteToDebug("ERROR - Invalid Score, out of range"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Score passed to SetObjectiveScore (must be between 0-100), intScore=" + intScore); return false;}
if (intMaxScore < 0 || intMaxScore > 100){ WriteToDebug("ERROR - Invalid Max Score, out of range"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Max Score passed to SetObjectiveScore (must be between 0-100), intMaxScore=" + intMaxScore); return false;}
if (intMinScore < 0 || intMinScore > 100){ WriteToDebug("ERROR - Invalid Min Score, out of range"); SetErrorInfo(ERROR_INVALID_NUMBER, "Invalid Min Score passed to SetObjectiveScore (must be between 0-100), intMinScore=" + intMinScore); return false;}
WriteToDebug("Calling To LMS"); return objLMS.SetObjectiveScore(strObjectiveID, intScore, intMaxScore, intMinScore);}
function SetObjectiveStatus(strObjectiveID, Lesson_Status){ WriteToDebug("In SetObjectiveStatus strObjectiveID=" + strObjectiveID + ", Lesson_Status=" + Lesson_Status); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
strObjectiveID = new String(strObjectiveID); if (strObjectiveID.replace(" ", "") == ""){ WriteToDebug("ERROR - Invalid ObjectiveID, empty string"); SetErrorInfo(ERROR_INVALID_ID, "Invalid ObjectiveID passed to SetObjectiveStatus (must have a value), strObjectiveID=" + strObjectiveID); return false;}
if ( (Lesson_Status != LESSON_STATUS_PASSED) &&
(Lesson_Status != LESSON_STATUS_COMPLETED) &&
(Lesson_Status != LESSON_STATUS_FAILED) &&
(Lesson_Status != LESSON_STATUS_INCOMPLETE) &&
(Lesson_Status != LESSON_STATUS_BROWSED) &&
(Lesson_Status != LESSON_STATUS_NOT_ATTEMPTED) ){ WriteToDebug("ERROR - Invalid Status"); SetErrorInfo(ERROR_INVALID_STATUS, "Invalid status passed to SetObjectiveStatus, Lesson_Status=" + Lesson_Status); return false;}
WriteToDebug("Calling To LMS"); return objLMS.SetObjectiveStatus(strObjectiveID, Lesson_Status);}
function GetObjectiveStatus(strObjectiveID){ WriteToDebug("In GetObjectiveStatus, strObjectiveID=" + strObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetObjectiveStatus(strObjectiveID);}
function GetObjectiveScore(strObjectiveID){ WriteToDebug("In GetObjectiveScore, strObjectiveID=" + strObjectiveID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetObjectiveScore(strObjectiveID);}
function IsLmsPresent(){ return blnLmsPresent;}
function GetInteractionType(strInteractionID)
{ WriteToDebug("In GetInteractionType, strInteractionID=" + strInteractionID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetInteractionType(strInteractionID);}
function GetInteractionTimestamp(strInteractionID)
{ WriteToDebug("In GetInteractionTimestamp, strInteractionID=" + strInteractionID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetInteractionTimestamp(strInteractionID);}
function GetInteractionCorrectResponses(strInteractionID)
{ WriteToDebug("In GetInteractionCorrectResponses, strInteractionID=" + strInteractionID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetInteractionCorrectResponses(strInteractionID);}
function GetInteractionWeighting(strInteractionID)
{ WriteToDebug("In GetInteractionWeighting, strInteractionID=" + strInteractionID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetInteractionWeighting(strInteractionID);}
function GetInteractionLearnerResponses(strInteractionID)
{ WriteToDebug("In GetInteractionLearnerResponses, strInteractionID=" + strInteractionID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetInteractionLearnerResponses(strInteractionID);}
function GetInteractionResult(strInteractionID)
{ WriteToDebug("In GetInteractionResult, strInteractionID=" + strInteractionID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetInteractionResult(strInteractionID);}
function GetInteractionLatency(strInteractionID)
{ WriteToDebug("In GetInteractionLatency, strInteractionID=" + strInteractionID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetInteractionLatency(strInteractionID);}
function GetInteractionDescription(strInteractionID)
{ WriteToDebug("In GetInteractionDescription, strInteractionID=" + strInteractionID); ClearErrorInfo(); if (! IsLoaded()){ SetErrorInfo(ERROR_NOT_LOADED, "Cannot make calls to the LMS before calling Start"); return false;}
return objLMS.GetInteractionDescription(strInteractionID);}