\n'); } // ----------------------------------------------------------------- // FS SCORM - FSCommand Adapter for ADL SCORM // Version 1.0.0.1 - 1/03/2003 // Copyright 2002 Pathlore Software Corporation All Rights Reserved // Copyright 2002 Macromedia Inc. All rights reserved. // Copyright 2003 Secure Software Srl. Galati // Developed by Tom King, Macromedia and Leonard Greenberg, Pathlore // Modified by Jeff Burton and Andrew Chemey, Macromedia (01/09/2002) // Modified by Viorel Soldan, Secure Software (1/3/2003) // ----------------------------------------------------------------- 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! The API is 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("Error! Unable to find an 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 zone_limba_DoFSCommand(command, args) { var zone_limbaObj = InternetExplorer ? zone_limba : document.zone_limba; args = String(args); command = String(command); var F_intData = args.split(";"); // check for existence of SCORM API if (mm_API == null) return; switch (command) { case "MM_StartSession" : break; case "MM_cmiSendInteractionInfo" : //MM_cmiSendInteractionInfo(date, time, intid, objid, intrtype, correct, student, result, weight, latency) var n = mm_API.LMSGetValue("cmi.interactions._count"); mm_API.LMSSetValue("cmi.interactions." + n + ".id", F_intData[2]); mm_API.LMSSetValue("cmi.interactions." + n + ".objectives.0.id", F_intData[3]); mm_API.LMSSetValue("cmi.interactions." + n + ".time", F_intData[1]); mm_API.LMSSetValue("cmi.interactions." + n + ".type", normalizeType(F_intData[4])); mm_API.LMSSetValue("cmi.interactions." + n + ".correct_responses.0.pattern", F_intData[5]); mm_API.LMSSetValue("cmi.interactions." + n + ".weighting", F_intData[8]); mm_API.LMSSetValue("cmi.interactions." + n + ".student_response", F_intData[6]); mm_API.LMSSetValue("cmi.interactions." + n + ".result", normalizeResult(F_intData[7])); mm_API.LMSSetValue("cmi.interactions." + n + ".latency", F_intData[9]); break; case "MM_cmiSendObjectiveInfo" : //MM_cmiSendObjectiveInfo(index, objid, score, status) var n = mm_API.LMSGetValue("cmi.objectives._count"); mm_API.LMSSetValue("cmi.objectives." + n + ".id", F_intData[1]); mm_API.LMSSetValue("cmi.objectives." + n + ".score.raw", F_intData[2]); mm_API.LMSSetValue("cmi.objectives." + n + ".status", normalizeStatus(F_intData[3])); break; case "CMISetScore": case "MM_cmiSendScore" : //MM_cmiSendScore(theScore) mm_API.LMSSetValue("cmi.core.score.raw", F_intData[0]); break; case "CMISetStatus": case "MM_cmiSetLessonStatus" : //MM_cmiSetLessonStatus(theStatus) mm_API.LMSSetValue("cmi.core.lesson_status", normalizeStatus(F_intData[0])); break; case "CMISetTime" : //CMISetTime(t) mm_API.LMSSetValue("cmi.core.session_time", F_intData[0]); break; case "CMISetCompleted" : //CMISetCompleted() mm_API.LMSSetValue("cmi.core.lesson_status", "completed"); break; case "CMISetStarted" : //CMISetCompleted() mm_API.LMSSetValue("cmi.core.lesson_status", "incomplete"); break; case "CMISetPassed": //CMISetCompleted() mm_API.LMSSetValue("cmi.core.lesson_status", "passed"); break; case "CMISetFailed": //CMISetCompleted() mm_API.LMSSetValue("cmi.core.lesson_status", "failed"); break; case "CMISetData": //CMISetData(data) mm_API.LMSSetValue("cmi.suspend_data", F_intData[0]); break; case "CMISetLocation": //CMISetLocation(loc) mm_API.LMSSetValue("cmi.core.lesson_location", F_intData[0]); break; case "CMISetTimedOut": //CMISetTimedOut() mm_API.LMSSetValue("cmi.core.exit", "time-out"); break; case "CMIInitialize": //CMIInitialize() mm_API.LMSInitialize(args); break; case "CMIFinish": break; case "CMIExitAU": mm_API.LMSFinish(args); break; case "MM_StudentName": if (args == true){ var sendText = mm_API.LMSGetValue("cmi.core.student_name"); window.document.zone_limba.SetVariable("nume_elev", sendText); break; } case "MM_LessonStatus": if (args == true){ var stareLectie = mm_API.LMSGetValue("cmi.core.lesson_status"); window.document.zone_limba.SetVariable("stare_lectie",stareLectie); break; } } // END OF CMI FUNCTION MAPPING } //-->