// AEC: Custom Reporting properties - BEGIN var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false; var isIE6 = parseFloat(navigator.appVersion.split('MSIE')[1]) <= 6; var redirectURL_str = ''; // If the closeBrowser method is called and it's in a browser that doesn't support programatically closing - give a URL to redirect to. var redirectWait_int = 1.5; // Number of seconds to wait before attempting to redirect the browser // AEC: Custom Reporting properties - END // AEC: Custom Reporting methods - BEGIN function getDocumentTitle() { return window.document.title; } function getStudentName() { var name_str = ''; if ((isAPI()) && (g_bFinishDone == false)) { if(g_zAPIVersion=="0.2") { name_str = g_objAPI.LMSGetValue("cmi.core.student_name"); } else { name_str = g_objAPI.GetValue("cmi.learner_name"); } } return name_str; } function getStudentID() { var ID_str = ''; if ((isAPI()) && (g_bFinishDone == false)) { if(g_zAPIVersion=="0.2") { ID_str = g_objAPI.LMSGetValue("cmi.core.student_id"); } else { ID_str = g_objAPI.GetValue("cmi.learner_id"); } } return ID_str; } function findParentWindow(varWindow) { while(varWindow.parent != varWindow) { varWindow = varWindow.parent; } return varWindow; } function setExitURL(url_str, waitLimit_int) { if(typeof(url_str) != 'undefined') { redirectURL_str = url_str; } if(typeof(waitLimit_int) != 'undefined') { redirectWait_int = waitLimit_int; } } function closeBrowser() { var window_obj = findParentWindow(window); if(isIE) { if(isIE6) { window_obj.opener = top; window_obj.close(); } else { window_obj.open('','_parent',''); window_obj.close(); } } else { // this is the only mechanism that *may* work for non-IE browsers window_obj.open('','_parent',''); window_obj.close(); } setTimeout('redirectWin()',redirectWait_int * 1000); // Alternatives /* lstWindow = [window, window.parent, window.opener, window.top]; for(var objItem in lstWindow) { var varWindowCurrent = findParentWindow(lstWindow[objItem]) // Original // varWindowCurrent.opener = top; // varWindowCurrent.close(); // Alternative // varWindowCurrent.parent.open('','_parent',''); // varWindowCurrent.parent.close(); varWindowCurrent.opener = top; varWindowCurrent.close(); } */ } function redirectWin(url_str, window_obj) { if(typeof(url_str) == 'undefined') { url_str = redirectURL_str; } if(typeof(window_obj) == 'undefined') { window_obj = window; } if(url_str != '') { window_obj.location.href = url_str; } } // AEC: Custom Reporting methods - END