\n'); } var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1; var findAPITries = 0; function findAPI(win) { // Check to see if the window (win) contains the API // if the window (win) does not contain the API and // the window (win) has a parent window and the parent window // is not the same as the window (win) while ( (win.API == null) && (win.parent != null) && (win.parent != win) ) { // increment the number of findAPITries findAPITries++; // Note: 7 is an arbitrary number, but should be more than sufficient if (findAPITries > 7) { alert("Error finding API -- too deeply nested."); return null; } // set the variable that represents the window being // being searched to be the parent of the current window // then search for the API again win = win.parent; } return win.API; } function getAPI() { // start by looking for the API in the current window var theAPI = findAPI(window); // if the API is null (could not be found in the current window) // and the current window has an opener window if ( (theAPI == null) && (window.opener != null) && (typeof(window.opener) != "undefined") ) { // try to find the API in the current window's opener theAPI = findAPI(window.opener); } // if the API has not been found if (theAPI == null) { // Alert the user that the API Adapter could not be found // alert("Unable to find API Adapter."); } return theAPI; } var mm_API = getAPI(); // make sure status conforms to scorm standards function normalizeStatus(status) { switch (status.toUpperCase().charAt(0)) { case 'C': return "completed"; case 'I': return "incomplete"; case 'N': return "not attempted"; case 'F': return "failed"; case 'P': return "passed"; } return status; } // make sure the question type conforms to scorm standards function normalizeType(theType) { switch (theType.toUpperCase().charAt(0)) { case 'T': return "true-false"; case 'C': return "choice"; case 'F': return "fill-in"; case 'M': return "matching"; case 'P': return "peformance"; case 'S': return "sequencing"; case 'L': return "likert"; case 'N': return "numeric"; } return theType; } // make sure the question result conforms to scorm standards function normalizeResult(result) { switch (result.toUpperCase().charAt(0)) { case 'C': return "correct"; case 'W': return "wrong"; case 'U': return "unanticipated"; case 'N': return "neutral"; } return result; } var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1; // Handle all the the FSCommand messages in a Flash movie function m20030050_DoFSCommand(command, args) { var m20030050Obj = InternetExplorer ? m20030050 : document.m20030050; args = String(args); command = String(command); var F_intData = args.split(";"); if( mm_API == null ) return; switch (command) { case "Initialize": //alert("html "); mm_API.LMSInitialize(args); break; case "CheckLMSInitialized": var value = mm_API.LMSGetLastError(); window.document.m20030050.SetVariable( F_intData[0] , value ); break; case "SetLessonStatus" : mm_API.LMSSetValue("cmi.core.lesson_status", normalizeStatus(F_intData[0])); break; case "GetLessonStatus" : var status_value = mm_API.LMSGetValue("cmi.core.lesson_status"); status_value = status_value.toLowerCase(); window.document.m20030050.SetVariable( F_intData[0] , status_value ); break; case "Finish": mm_API.LMSFinish(args); break; case "Commit": mm_API.LMSCommit(args); break; } // END OF CMI FUNCTION MAPPING } //-->