\n'); } function PassVariableToFlashPlayer(variable, arg) { window.document.SCVideo.SetVariable(variable, arg); } function SCVideo_DoFSCommand(command, args) { if (command == "IsAPIFound") { if (g_objAPI != null) { PassVariableToFlashPlayer("jsRetVal", "1"); PassVariableToFlashPlayer("jsRetValUpdated", "1"); } else { PassVariableToFlashPlayer("jsRetVal", "0"); PassVariableToFlashPlayer("jsRetValUpdated", "1"); } return; } if ( -1 != args.indexOf("cmi.interactions.")) { if (( !bInteract_id_supported && (-1 != args.indexOf(".id")) ) || ( !bInteract_objectives_supported && (-1 != args.indexOf(".objectives")) ) || ( !bInteract_time_supported && (-1 != args.indexOf(".time")) ) || ( !bInteract_type_supported && (-1 != args.indexOf(".type")) ) || ( !bInteract_correct_responses_supported && (-1 != args.indexOf(".correct_responses")) ) || ( !bInteract_weighting_supported && (-1 != args.indexOf(".weighting")) ) || ( !bInteract_student_response_supported && (-1 != args.indexOf(".student_response")) ) || ( !bInteract_result_supported && (-1 != args.indexOf(".result")) ) || ( !bInteract_latency_supported && (-1 != args.indexOf(".latency")) ) ) { // The used scorm system does not support this variable, so ignore the call, // or uncomment the line below to get a debug message //alert("One or more of the used cmi.interactions variables are not supported by the used SCORM system."); return; } } if (g_objAPI != null) { var retVal = eval("g_objAPI." + command + "(" + args + ")"); var lastError = g_objAPI.LMSGetLastError(); if (lastError != "0") { var errStr = g_objAPI.LMSGetErrorString(lastError); alert("g_objAPI." + command + "(" + args + ")" + " call attempted, but SCORM returned error code: " + lastError + "\nError message: " + errStr); PassVariableToFlashPlayer("jsLastError", lastError); PassVariableToFlashPlayer("jsRetVal", ""); PassVariableToFlashPlayer("jsRetValUpdated", "1"); } else { // uncomment line below to debug //alert("g_objAPI." + command + "(" + args + ")" + " called."); PassVariableToFlashPlayer("jsLastError", "0"); PassVariableToFlashPlayer("jsRetVal", retVal); PassVariableToFlashPlayer("jsRetValUpdated", "1"); } } else { alert("g_objAPI." + command + "(" + args + ")" + " call attempted, but SCORM API not found."); PassVariableToFlashPlayer("jsLastError", "Tried to call " + command + ", but SCORM API not found."); PassVariableToFlashPlayer("jsRetVal", ""); PassVariableToFlashPlayer("jsRetValUpdated", "1"); } }