\n'); } function getLanguage() { var fullURL = window.location.href; if(fullURL.indexOf('?')!= -1) var tmp_lang = fullURL.substring(fullURL.indexOf('?'), fullURL.length) ; else var tmp_lang = "en_US"; lang = window.location.search + "&g_served=" + g_served.toString(); return lang; } function buildFlashURL() { if ( g_served ) { if ( !doLMSInitialize() ) { var the_error = "LMS not initialized. Cannot start the course." ; alert ( the_error ) ; document.write ( the_error ) ; return ; } g_bookmark_info = doLMSGetValue("cmi.core.lesson_location") ; start_keep_alive(); } load_swf() ; } // Handle all the the FSCommand messages in a Flash movie function index_DoFSCommand(command, args) { if ( !g_served ) { // pretend your initialized to an LMS index.SetVariable ( "boolLMSInitialized", "true" ) ; return ; } var indexObj = InternetExplorer ? index : document.index; var myArgs = args; sep = myArgs.indexOf(","); arg1 = myArgs.substr(0, sep); arg2 = myArgs.substr(sep+1); switch(command) { case "LMSInitialize": //alert ( "lms init" ) the_return_value = doLMSInitialize() ; setTimeout ( "get_bookmark()", 500 ) ; break; case "get_bookmark": get_bookmark() ; break; case "set_bookmark": set_bookmark() ; break; case "LMSSetValue": the_return_value = doLMSSetValue(arg1,arg2); break; case "LMSCommit": doLMSCommit(); //alert ( "commit has been sent" ) ; break; case "LMSFinish": err = doLMSFinish(); break; case "ShutDown": //top.window.close(); // The next line only works for IBM's LMS //top.window.activityTools.setTimeout ( "loadURL('/lms-ds/bifurcatedExit.ds?forward=window')", 500 ) ; // I doubt if the above line ever gets called //self.opener.focus(); //self.opener.close(); break; default: //alert ( "index_lms.html - Unexpected FSCommand received" ) ; break; } } /******************************************************************************* ** ** Function: set_bookmark() ** Inputs: None ** Return: None ** ** Description: ** Gets bookmark information from Flash (current module and page number) ** and stores that info in the LMS ** *******************************************************************************/ function set_bookmark() { if ( !g_served ) return ; var the_location = index.GetVariable ( "g_bookmark_info" ) ; var the_return_value = doLMSSetValue ( "cmi.core.lesson_location", the_location ) ; } /******************************************************************************* ** ** Function: get_bookmark() ** Inputs: None ** Return: None ** ** Description: ** Gets bookmark information from the LMS (current module and page number) ** and sends it to Flash so that the student is returned to the page from which they last exited ** *******************************************************************************/ function get_bookmark() { if ( !g_served ) return ; index.SetVariable ( "g_bookmark_info", g_bookmark_info ) ; index.SetVariable ( "g_suspend_data", g_suspend_data ) ; // for storing student responses to fill-in-the-blank questions } function shutdown() { //index.src = "UI/blank.swf" ; index.movie = "UI/blank.swf" ; //alert ( index.src ) //alert ( "don't close yet") if ( !g_served ) return ; var cres = doLMSCommit(); var res = doLMSFinish(); if ( !window.opener || window.opener.closed ) { // do nothing }else{ //alert ("sees opener"); window.opener.close(); } return; } function exit_course() { var x = false ; x = window.confirm("Are you sure you want to exit the course?\n\nClick OK to exit the course. Click Cancel to return to the course.") if (x) { window.close(); } } // keep alive code var g_timer__keep_alive ; function start_keep_alive() { // this function is called by buildFlashURL() once the LMS successfully initializes clearInterval ( g_timer__keep_alive ); //g_timer__keep_alive = setInterval ( "send_keep_alive()", 300000 ) ; // keep alive every 5 minutes //g_timer__keep_alive = setInterval ( "send_keep_alive()", 10000 ) ; // keep alive every 10 seconds g_timer__keep_alive = setInterval ( "send_keep_alive()", 60000 ) ; // keep alive every 1 minutes } function send_keep_alive() { if ( !g_served ) return ; var retval = doLMSCommit(); //alert ( "Commit sent" ) ; } //-->