<?xml version="1.0" encoding="UTF-8"?>
<log>
	<version>1.1</version>
	<creator>
		<name>Internet Explorer Network Inspector</name>
		<version>9.0.8112.16421</version>
	</creator>
	<browser>
		<name>Internet Explorer</name>
		<version>9.0.8112.16421</version>
	</browser>
	<pages>
		<page>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<id>0</id>
			<title/>
			<pageTimings>
				<onContentLoad>-1</onContentLoad>
				<onLoad>-1</onLoad>
			</pageTimings>
		</page>
	</pages>
	<entries>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>text/html, application/xhtml+xml, */*</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/mod/scorm/loadSCO.php?a=29&amp;scoid=162&amp;currentorg=Defensive_Driving_ORG&amp;attempt=1</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>395</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>text/html; charset=UTF-8</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="index_lms.html"</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>1840</size>
					<mimeType>text/html; charset=UTF-8</mimeType>
					<text> 
&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;Defensive Driving&lt;/TITLE&gt;
&lt;script&gt;
			var g_biOS = (navigator.userAgent.indexOf("AppleWebKit/") &gt; -1 &amp;&amp; navigator.userAgent.indexOf("Mobile/") &gt; -1);
			if (g_biOS)
			{
				var strLocation = location.href.replace("index_lms", "index_lms_html5");
				location.replace(strLocation);
			}
		&lt;/script&gt;
&lt;script src="lms/APIConstants.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script src="lms/Configuration.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script src="lms/UtilityFunctions.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script src="lms/SCORM2004Functions.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script src="lms/SCORMFunctions.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script src="lms/AICCFunctions.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script src="lms/NONEFunctions.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script src="lms/LMSAPI.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script src="lms/API.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
&lt;script language="JavaScript1.2"&gt;
		
		strContentLocation = "story.html";  //Put the link to the start of the content here.
		//strContentLocation = "TestAllFunctions.htm";
		
		function LoadContent(){
			window.scormdriver_content.document.location.href = strContentLocation;
		}
		&lt;/script&gt;
&lt;/HEAD&gt;
&lt;frameset rows="100%,0%,0%,0%" onload="Start()" border="0" onbeforeunload="Unload()" onunload="Unload()"&gt;
&lt;frame name="scormdriver_content" src="lms/blank.html" scrolling="false"&gt;
&lt;frame name="AICCComm" src="lms/AICCComm.html"&gt;
&lt;frame name="rusticisoftware_aicc_results" src="lms/blank.html"&gt;
&lt;frame name="NothingFrame" src="lms/blank.html"&gt;
&lt;/frameset&gt;
&lt;noframes&gt;
Your browser must be able to view frames for this content to display.
&lt;/noframes&gt;
&lt;/HTML&gt;
</text>
				</content>
				<redirectionURL/>
				<headersSize>263</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/APIConstants.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>371</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="APIConstants.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var VERSION="3.8.2";var PREFERENCE_DEFAULT=0;var PREFERENCE_OFF=-1;var PREFERENCE_ON=1;var LESSON_STATUS_PASSED=1;var LESSON_STATUS_COMPLETED=2;var LESSON_STATUS_FAILED=3;var LESSON_STATUS_INCOMPLETE=4;var LESSON_STATUS_BROWSED=5;var LESSON_STATUS_NOT_ATTEMPTED=6;var ENTRY_REVIEW=1;var ENTRY_FIRST_TIME=2;var ENTRY_RESUME=3;var MODE_NORMAL=1;var MODE_BROWSE=2;var MODE_REVIEW=3;var MAX_CMI_TIME=36002439990;var NO_ERROR=0;var ERROR_LMS=1;var ERROR_INVALID_PREFERENCE=2;var ERROR_INVALID_NUMBER=3;var ERROR_INVALID_ID=4;var ERROR_INVALID_STATUS=5;var ERROR_INVALID_RESPONSE=6;var ERROR_NOT_LOADED=7;var ERROR_INVALID_INTERACTION_RESPONSE=8;var EXIT_TYPE_SUSPEND="SUSPEND";var EXIT_TYPE_FINISH="FINISH";var EXIT_TYPE_TIMEOUT="TIMEOUT";var EXIT_TYPE_UNLOAD="UNLOAD";var INTERACTION_RESULT_CORRECT="CORRECT";var INTERACTION_RESULT_WRONG="WRONG";var INTERACTION_RESULT_UNANTICIPATED="UNANTICIPATED";var INTERACTION_RESULT_NEUTRAL="NEUTRAL";var INTERACTION_TYPE_TRUE_FALSE="true-false";var INTERACTION_TYPE_CHOICE="choice";var INTERACTION_TYPE_FILL_IN="fill-in";var INTERACTION_TYPE_LONG_FILL_IN="long-fill-in";var INTERACTION_TYPE_MATCHING="matching";var INTERACTION_TYPE_PERFORMANCE="performance";var INTERACTION_TYPE_SEQUENCING="sequencing";var INTERACTION_TYPE_LIKERT="likert";var INTERACTION_TYPE_NUMERIC="numeric";var DATA_CHUNK_PAIR_SEPARATOR='###';var DATA_CHUNK_VALUE_SEPARATOR='$$';</text>
				</content>
				<redirectionURL/>
				<headersSize>286</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/Configuration.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>372</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="Configuration.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>MISS</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var blnDebug=true;var strLMSStandard="SCORM";var DEFAULT_EXIT_TYPE=EXIT_TYPE_SUSPEND;var AICC_LESSON_ID="1";var EXIT_BEHAVIOR="SCORM_RECOMMENDED";var EXIT_TARGET="lms/goodbye.html";var LMS_SPECIFIED_REDIRECT_EVAL_STATEMENT="";var AICC_COMM_DISABLE_XMLHTTP=false;var AICC_COMM_DISABLE_IFRAME=false;var AICC_COMM_PREPEND_HTTP_IF_MISSING=true;var AICC_REPORT_MIN_MAX_SCORE=false;var SHOW_DEBUG_ON_LAUNCH=false;var DO_NOT_REPORT_INTERACTIONS=false;var SCORE_CAN_ONLY_IMPROVE=false;var REVIEW_MODE_IS_READ_ONLY=true;var AICC_RE_CHECK_LOADED_INTERVAL=250;var AICC_RE_CHECK_ATTEMPTS_BEFORE_TIMEOUT=240;var USE_AICC_KILL_TIME=true;var AICC_ENTRY_FLAG_DEFAULT=ENTRY_REVIEW;var FORCED_COMMIT_TIME="60000";var ALLOW_NONE_STANDARD=true;var USE_2004_SUSPENDALL_NAVREQ=false;</text>
				</content>
				<redirectionURL/>
				<headersSize>288</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/UtilityFunctions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>375</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="UtilityFunctions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>function GetQueryStringValue(strElement,strQueryString){var aryPairs;var foundValue;strQueryString=strQueryString.substring(1);aryPairs=strQueryString.split("&amp;");foundValue=SearchQueryStringPairs(aryPairs,strElement);if(foundValue===null){aryPairs=strQueryString.split(/[\?\&amp;]/);foundValue=SearchQueryStringPairs(aryPairs,strElement);}
if(foundValue===null){WriteToDebug("GetQueryStringValue Element '"+ strElement+"' Not Found, Returning: empty string");return"";}
else{WriteToDebug("GetQueryStringValue for '"+ strElement+"' Returning: "+ foundValue);return foundValue;}}
function SearchQueryStringPairs(aryPairs,strElement){var i;var intEqualPos;var strArg="";var strValue="";strElement=strElement.toLowerCase();for(i=0;i&lt;aryPairs.length;i++){intEqualPos=aryPairs[i].indexOf('=');if(intEqualPos!=-1){strArg=aryPairs[i].substring(0,intEqualPos);if(EqualsIgnoreCase(strArg,strElement)){strValue=aryPairs[i].substring(intEqualPos+1);strValue=new String(strValue)
strValue=strValue.replace(/\+/g,"%20")
strValue=unescape(strValue);return new String(strValue);}}}
return null;}
function ConvertStringToBoolean(str){var intTemp;if(EqualsIgnoreCase(str,"true")||EqualsIgnoreCase(str,"t")||str.toLowerCase().indexOf("t")==0){return true;}
else{intTemp=parseInt(str,10);if(intTemp==1||intTemp==-1){return true;}
else{return false;}}}
function EqualsIgnoreCase(str1,str2){var blnReturn;str1=new String(str1);str2=new String(str2);blnReturn=(str1.toLowerCase()==str2.toLowerCase())
return blnReturn;}
function ValidInteger(intNum){WriteToDebug("In ValidInteger intNum="+ intNum);var str=new String(intNum);if(str.indexOf("-",0)==0){str=str.substring(1,str.length- 1);}
var regValidChars=new RegExp("[^0-9]");if(str.search(regValidChars)==-1){WriteToDebug("Returning true");return true;}
WriteToDebug("Returning false");return false;}
function ConvertDateToIso8601TimeStamp(dtm){var strTimeStamp;dtm=new Date(dtm);var Year=dtm.getFullYear();var Month=dtm.getMonth()+ 1;var Day=dtm.getDate();var Hour=dtm.getHours();var Minute=dtm.getMinutes();var Second=dtm.getSeconds();Month=ZeroPad(Month,2);Day=ZeroPad(Day,2);Hour=ZeroPad(Hour,2);Minute=ZeroPad(Minute,2);Second=ZeroPad(Second,2);strTimeStamp=Year+"-"+ Month+"-"+ Day+"T"+ Hour+":"+ Minute+":"+ Second;return strTimeStamp;}
function ConvertIso8601TimeStampToDate(strTimeStamp){strTimeStamp=new String(strTimeStamp);var ary=new Array();ary=strTimeStamp.split(/[\:T-]/);var Year=ary[0];var Month=ary[1]-1;var Day=ary[2];var Hour=ary[3];var Minute=ary[4];var Second=ary[5];return new Date(Year,Month,Day,Hour,Minute,Second,0);}
function ConvertDateToCMIDate(dtmDate){WriteToDebug("In ConvertDateToCMIDate");var strYear;var strMonth;var strDay;var strReturn;dtmDate=new Date(dtmDate);strYear=dtmDate.getFullYear()
strMonth=(dtmDate.getMonth()+ 1);strDay=dtmDate.getDate();strReturn=ZeroPad(strYear,4)+"/"+ ZeroPad(strMonth,2)+"/"+ ZeroPad(strDay,2);return strReturn;}
function ConvertDateToCMITime(dtmDate){var strHours;var strMinutes;var strSeconds;var strReturn;dtmDate=new Date(dtmDate);strHours=dtmDate.getHours();strMinutes=dtmDate.getMinutes();strSeconds=dtmDate.getSeconds();strReturn=ZeroPad(strHours,2)+":"+ ZeroPad(strMinutes,2)+":"+ ZeroPad(strSeconds,2);return strReturn;}
function ConvertCMITimeSpanToMS(strTime){WriteToDebug("In ConvertCMITimeSpanToMS, strTime="+ strTime);var aryParts;var intHours;var intMinutes;var intSeconds;var intTotalMilliSeconds;aryParts=strTime.split(":");if(!IsValidCMITimeSpan(strTime)){WriteToDebug("ERROR - Invalid TimeSpan");SetErrorInfo(SCORM_ERROR_GENERAL,"LMS ERROR - Invalid time span passed to ConvertCMITimeSpanToMS, please contact technical support");return 0;}
intHours=aryParts[0];intMinutes=aryParts[1];intSeconds=aryParts[2];WriteToDebug("intHours="+ intHours+" intMinutes="+ intMinutes+" intSeconds="+ intSeconds);intTotalMilliSeconds=(intHours*3600000)+(intMinutes*60000)+(intSeconds*1000);intTotalMilliSeconds=Math.round(intTotalMilliSeconds);WriteToDebug("Returning "+ intTotalMilliSeconds);return intTotalMilliSeconds;}
function ConvertScorm2004TimeToMS(strIso8601Time){WriteToDebug("In ConvertScorm2004TimeToMS, strIso8601Time="+ strIso8601Time);var intTotalMs=0;var strNumberBuilder;var strCurrentCharacter;var blnInTimeSection;var Seconds=0;var Minutes=0;var Hours=0;var Days=0;var Months=0;var Years=0;var MILLISECONDS_PER_SECOND=1000;var MILLISECONDS_PER_MINUTE=MILLISECONDS_PER_SECOND*60;var MILLISECONDS_PER_HOUR=MILLISECONDS_PER_MINUTE*60;var MILLISECONDS_PER_DAY=MILLISECONDS_PER_HOUR*24;var MILLISECONDS_PER_MONTH=MILLISECONDS_PER_DAY*(((365*4)+ 1)/48);var MILLISECONDS_PER_YEAR=MILLISECONDS_PER_MONTH*12;strIso8601Time=new String(strIso8601Time);strNumberBuilder="";strCurrentCharacter="";blnInTimeSection=false;for(var i=1;i&lt;strIso8601Time.length;i++){strCurrentCharacter=strIso8601Time.charAt(i);if(IsIso8601SectionDelimiter(strCurrentCharacter)){switch(strCurrentCharacter.toUpperCase()){case"Y":Years=parseInt(strNumberBuilder,10);break;case"M":if(blnInTimeSection){Minutes=parseInt(strNumberBuilder,10);}
else{Months=parseInt(strNumberBuilder,10);}
break;case"D":Days=parseInt(strNumberBuilder,10);break;case"H":Hours=parseInt(strNumberBuilder,10);break;case"S":Seconds=parseFloat(strNumberBuilder);break;case"T":blnInTimeSection=true;break;}
strNumberBuilder="";}
else{strNumberBuilder+=""+ strCurrentCharacter;}}
WriteToDebug("Years="+ Years+"\n"+"Months="+ Months+"\n"+"Days="+ Days+"\n"+"Hours="+ Hours+"\n"+"Minutes="+ Minutes+"\n"+"Seconds="+ Seconds+"\n");intTotalMs=(Years*MILLISECONDS_PER_YEAR)+
(Months*MILLISECONDS_PER_MONTH)+
(Days*MILLISECONDS_PER_DAY)+
(Hours*MILLISECONDS_PER_HOUR)+
(Minutes*MILLISECONDS_PER_MINUTE)+
(Seconds*MILLISECONDS_PER_SECOND);intTotalMs=Math.round(intTotalMs);WriteToDebug("returning-"+ intTotalMs);return intTotalMs;}
function IsIso8601SectionDelimiter(str){if(str.search(/[PYMDTHS]/)&gt;=0){return true;}
else{return false;}}
function IsValidCMITimeSpan(strValue){WriteToDebug("In IsValidCMITimeSpan strValue="+ strValue);var regValid=/^\d?\d?\d?\d:\d?\d:\d?\d(.\d\d?)?$/;if(strValue.search(regValid)&gt;-1){WriteToDebug("Returning True");return true;}
else{WriteToDebug("Returning False");return false;}}
function IsValidIso8601TimeSpan(strValue){WriteToDebug("In IsValidIso8601TimeSpan strValue="+ strValue);var regValid=/^P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+(.\d\d?)?S)?)?$/;if(strValue.search(regValid)&gt;-1){WriteToDebug("Returning True");return true;}
else{WriteToDebug("Returning False");return false;}}
function ConvertMilliSecondsToSCORMTime(intTotalMilliseconds,blnIncludeFraction){var intHours;var intintMinutes;var intSeconds;var intMilliseconds;var intHundredths;var strCMITimeSpan;WriteToDebug("In ConvertMilliSecondsIntoSCORMTime, intTotalMilliseconds = "+ intTotalMilliseconds+", blnIncludeFraction = "+ blnIncludeFraction);if(blnIncludeFraction==null||blnIncludeFraction==undefined){blnIncludeFraction=true;}
intMilliseconds=intTotalMilliseconds%1000;intSeconds=((intTotalMilliseconds- intMilliseconds)/1000)%60;intMinutes=((intTotalMilliseconds- intMilliseconds-(intSeconds*1000))/60000)%60;intHours=(intTotalMilliseconds- intMilliseconds-(intSeconds*1000)-(intMinutes*60000))/3600000;WriteToDebug("Separated Parts, intHours="+ intHours+", intMinutes="+ intMinutes+", intSeconds="+ intSeconds+", intMilliseconds="+ intMilliseconds);if(intHours==10000)
{WriteToDebug("Max intHours detected");intHours=9999;intMinutes=(intTotalMilliseconds-(intHours*3600000))/60000;if(intMinutes==100)
{intMinutes=99;}
intMinutes=Math.floor(intMinutes);intSeconds=(intTotalMilliseconds-(intHours*3600000)-(intMinutes*60000))/1000;if(intSeconds==100)
{intSeconds=99;}
intSeconds=Math.floor(intSeconds);intMilliseconds=(intTotalMilliseconds-(intHours*3600000)-(intMinutes*60000)-(intSeconds*1000));WriteToDebug("Separated Parts, intHours="+ intHours+", intMinutes="+ intMinutes+", intSeconds="+ intSeconds+", intMilliseconds="+ intMilliseconds);}
intHundredths=Math.floor(intMilliseconds/10);strCMITimeSpan=ZeroPad(intHours,4)+":"+ ZeroPad(intMinutes,2)+":"+ ZeroPad(intSeconds,2);if(blnIncludeFraction){strCMITimeSpan+="."+ intHundredths;}
WriteToDebug("strCMITimeSpan="+ strCMITimeSpan);if(intHours&gt;9999)
{strCMITimeSpan="9999:99:99";if(blnIncludeFraction){strCMITimeSpan+=".99";}}
WriteToDebug("returning "+ strCMITimeSpan);return strCMITimeSpan;}
function ConvertMilliSecondsIntoSCORM2004Time(intTotalMilliseconds){WriteToDebug("In ConvertMilliSecondsIntoSCORM2004Time intTotalMilliseconds="+ intTotalMilliseconds);var ScormTime="";var HundredthsOfASecond;var Seconds;var Minutes;var Hours;var Days;var Months;var Years;var HUNDREDTHS_PER_SECOND=100;var HUNDREDTHS_PER_MINUTE=HUNDREDTHS_PER_SECOND*60;var HUNDREDTHS_PER_HOUR=HUNDREDTHS_PER_MINUTE*60;var HUNDREDTHS_PER_DAY=HUNDREDTHS_PER_HOUR*24;var HUNDREDTHS_PER_MONTH=HUNDREDTHS_PER_DAY*(((365*4)+ 1)/48);var HUNDREDTHS_PER_YEAR=HUNDREDTHS_PER_MONTH*12;HundredthsOfASecond=Math.floor(intTotalMilliseconds/10);Years=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_YEAR);HundredthsOfASecond-=(Years*HUNDREDTHS_PER_YEAR);Months=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_MONTH);HundredthsOfASecond-=(Months*HUNDREDTHS_PER_MONTH);Days=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_DAY);HundredthsOfASecond-=(Days*HUNDREDTHS_PER_DAY);Hours=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_HOUR);HundredthsOfASecond-=(Hours*HUNDREDTHS_PER_HOUR);Minutes=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_MINUTE);HundredthsOfASecond-=(Minutes*HUNDREDTHS_PER_MINUTE);Seconds=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_SECOND);HundredthsOfASecond-=(Seconds*HUNDREDTHS_PER_SECOND);if(Years&gt;0){ScormTime+=Years+"Y";}
if(Months&gt;0){ScormTime+=Months+"M";}
if(Days&gt;0){ScormTime+=Days+"D";}
if((HundredthsOfASecond+ Seconds+ Minutes+ Hours)&gt;0){ScormTime+="T";if(Hours&gt;0){ScormTime+=Hours+"H";}
if(Minutes&gt;0){ScormTime+=Minutes+"M";}
if((HundredthsOfASecond+ Seconds)&gt;0){ScormTime+=Seconds;if(HundredthsOfASecond&gt;0){ScormTime+="."+ HundredthsOfASecond;}
ScormTime+="S";}}
if(ScormTime==""){ScormTime="0S";}
ScormTime="P"+ ScormTime;WriteToDebug("Returning-"+ ScormTime);return ScormTime;}
function ZeroPad(intNum,intNumDigits){WriteToDebug("In ZeroPad intNum="+ intNum+" intNumDigits="+ intNumDigits);var strTemp;var intLen;var i;strTemp=new String(intNum);intLen=strTemp.length;if(intLen&gt;intNumDigits){WriteToDebug("Length of string is greater than num digits, trimming string");strTemp=strTemp.substr(0,intNumDigits);}
else{for(i=intLen;i&lt;intNumDigits;i++){strTemp="0"+ strTemp;}}
WriteToDebug("Returning - "+ strTemp);return strTemp;}
function IsValidDecimal(strValue){WriteToDebug("In IsValidDecimal, strValue="+ strValue);strValue=new String(strValue);if(strValue.search(/[^.\d-]/)&gt;-1){WriteToDebug("Returning False - character other than a digit, dash or period found");return false;}
if(strValue.search("-")&gt;-1){if(strValue.indexOf("-",1)&gt;-1){WriteToDebug("Returning False - dash found in the middle of the string");return false;}}
if(strValue.indexOf(".")!=strValue.lastIndexOf(".")){WriteToDebug("Returning False - more than one decimal point found");return false;}
if(strValue.search(/\d/)&lt;0){WriteToDebug("Returning False - no digits found");return false;}
WriteToDebug("Returning True");return true;}
function IsAlphaNumeric(strValue){WriteToDebug("In IsAlphaNumeric");if(strValue.search(/\w/)&lt;0){WriteToDebug("Returning false");return false;}
else{WriteToDebug("Returning true");return true;}}
function ReverseNameSequence(strName)
{var strFirstName;var strLastName;var intCommaLoc;if(strName=="")strName="Not Found, Learner Name";intCommaLoc=strName.indexOf(",");strFirstName=strName.slice(intCommaLoc+1);strLastName=strName.slice(0,intCommaLoc);strFirstName=Trim(strFirstName);strLastName=Trim(strLastName);return strFirstName+' '+ strLastName;}
function LTrim(str){str=new String(str);return(str.replace(/^\s+/,''));}
function RTrim(str){str=new String(str);return(str.replace(/\s+$/,''));}
function Trim(strToTrim){var str=LTrim(RTrim(strToTrim));return(str.replace(/\s{2,}/g," "));}
function GetValueFromDataChunk(strID)
{var strChunk=new String(GetDataChunk());var aryPairs=new Array();var aryValues=new Array();var i;aryPairs=strChunk.split(parent.DATA_CHUNK_PAIR_SEPARATOR);for(i=0;i&lt;aryPairs.length;i++)
{aryValues=aryPairs[i].split(parent.DATA_CHUNK_VALUE_SEPARATOR);if(aryValues[0]==strID)return aryValues[1];}
return'';}
function SetDataChunkValue(strID,strValue)
{var strChunk=new String(GetDataChunk());var aryPairs=new Array();var aryValues=new Array();var i;var blnFound=new Boolean(false);aryPairs=strChunk.split(parent.DATA_CHUNK_PAIR_SEPARATOR);for(i=0;i&lt;aryPairs.length;i++)
{aryValues=aryPairs[i].split(parent.DATA_CHUNK_VALUE_SEPARATOR);if(aryValues[0]==strID)
{aryValues[1]=strValue;blnFound=true;aryPairs[i]=aryValues[0]+ parent.DATA_CHUNK_VALUE_SEPARATOR+ aryValues[1];}}
if(blnFound==true)
{strChunk=aryPairs.join(parent.DATA_CHUNK_PAIR_SEPARATOR);}
else
{if(strChunk=='')
{strChunk=strID+ parent.DATA_CHUNK_VALUE_SEPARATOR+ strValue;}
else
{strChunk+=parent.DATA_CHUNK_PAIR_SEPARATOR+ strID+ parent.DATA_CHUNK_VALUE_SEPARATOR+ strValue;}}
SetDataChunk(strChunk);return true;}
function GetLastDirAndPageName(str)
{var page=new String(str);var LastSlashLocation=page.lastIndexOf("/");var SecondLastSlashLocation=page.lastIndexOf("/",LastSlashLocation-1);return page.substr(SecondLastSlashLocation+1);}
function RoundToPrecision(number,significantDigits){number=parseFloat(number);return(Math.round(number*Math.pow(10,significantDigits))/Math.pow(10,significantDigits))}
function IsAbsoluteUrl(urlStr){return urlStr!=null&amp;&amp;(urlStr.indexOf("http://")==0||urlStr.indexOf("https://")==0)}</text>
				</content>
				<redirectionURL/>
				<headersSize>290</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/SCORM2004Functions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>377</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="SCORM2004Functions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var SCORM2004_LOGOUT="logout";var SCORM2004_SUSPEND="suspend";var SCORM2004_NORMAL_EXIT="normal";var SCORM2004_TIMEOUT="time-out";var SCORM2004_PASSED="passed";var SCORM2004_FAILED="failed";var SCORM2004_UNKNOWN="unknown";var SCORM2004_COMPLETED="completed";var SCORM2004_INCOMPLETE="incomplete";var SCORM2004_NOT_ATTEMPTED="not attempted";var SCORM2004_CREDIT="credit";var SCORM2004_NO_CREDIT="no-credit";var SCORM2004_BROWSE="browse";var SCORM2004_NORMAL="normal";var SCORM2004_REVIEW="review";var SCORM2004_ENTRY_ABINITIO="ab-initio";var SCORM2004_ENTRY_RESUME="resume";var SCORM2004_ENTRY_NORMAL="";var SCORM2004_TLA_EXIT_MESSAGE="exit,message";var SCORM2004_TLA_EXIT_NO_MESSAGE="exit,no message";var SCORM2004_TLA_CONTINUE_MESSAGE="continue,message";var SCORM2004_TLA_CONTINUE_NO_MESSAGE="continue,no message";var SCORM2004_RESULT_CORRECT="correct";var SCORM2004_RESULT_WRONG="incorrect";var SCORM2004_RESULT_UNANTICIPATED="unanticipated";var SCORM2004_RESULT_NEUTRAL="neutral";var SCORM2004_INTERACTION_TYPE_TRUE_FALSE="true-false";var SCORM2004_INTERACTION_TYPE_CHOICE="choice";var SCORM2004_INTERACTION_TYPE_FILL_IN="fill-in";var SCORM2004_INTERACTION_TYPE_LONG_FILL_IN="long-fill-in";var SCORM2004_INTERACTION_TYPE_MATCHING="matching";var SCORM2004_INTERACTION_TYPE_PERFORMANCE="performance";var SCORM2004_INTERACTION_TYPE_SEQUENCING="sequencing";var SCORM2004_INTERACTION_TYPE_LIKERT="likert";var SCORM2004_INTERACTION_TYPE_NUMERIC="numeric";var SCORM2004_NO_ERROR="0";var SCORM2004_ERROR_INVALID_PREFERENCE="-1";var SCORM2004_ERROR_INVALID_STATUS="-2";var SCORM2004_ERROR_INVALID_SPEED="-3";var SCORM2004_ERROR_INVALID_TIMESPAN="-4";var SCORM2004_ERROR_INVALID_TIME_LIMIT_ACTION="-5";var SCORM2004_ERROR_INVALID_DECIMAL="-6";var SCORM2004_ERROR_INVALID_CREDIT="-7";var SCORM2004_ERROR_INVALID_LESSON_MODE="-8";var SCORM2004_ERROR_INVALID_ENTRY="-9";var SCORM2004_TRUE="true";var SCORM2004_FALSE="false";var SCORM2004_EARLIEST_DATE=new Date("1/1/1900");var intSCORM2004Error=SCORM2004_NO_ERROR;var strSCORM2004ErrorString="";var strSCORM2004ErrorDiagnostic="";var SCORM2004_objAPI=null;var blnReviewModeSoReadOnly=false;var blnSCORM2004_SSP_Is_Supported=null;function SCORM2004_Initialize(){WriteToDebug("In SCORM2004_Initialize");var blnResult=true;SCORM2004_ClearErrorInfo();WriteToDebug("Grabbing API");try{SCORM2004_objAPI=SCORM2004_GrabAPI();}
catch(e){WriteToDebug("Error grabbing 1.2 API-"+ e.name+":"+ e.message);}
if(typeof(SCORM2004_objAPI)=="undefined"||SCORM2004_objAPI==null){WriteToDebug("Unable to acquire SCORM API:")
WriteToDebug("SCORM2004_objAPI="+ typeof(SCORM2004_objAPI));InitializeExecuted(false,"Error - unable to acquire LMS API, content may not play properly and results may not be recorded.  Please contact technical support.");return false;}
WriteToDebug("Calling LMSInit");blnResult=SCORM2004_CallInitialize();if(!blnResult){WriteToDebug("ERROR Initializing LMS");InitializeExecuted(false,"Error initializing communications with LMS");return false;}
if(SCORM2004_GetStatus()==LESSON_STATUS_NOT_ATTEMPTED){WriteToDebug("Setting Status to Incomplete");blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_INCOMPLETE);}
blnResult=SCORM2004_CallSetValue("cmi.exit",SCORM2004_TranslateExitTypeToSCORM(DEFAULT_EXIT_TYPE))&amp;&amp;blnResult;if(SCORM2004_GetLessonMode()==MODE_REVIEW){if(!(typeof(REVIEW_MODE_IS_READ_ONLY)=="undefined")&amp;&amp;REVIEW_MODE_IS_READ_ONLY===true){blnReviewModeSoReadOnly=true;}}
WriteToDebug("Calling InitializeExecuted with parameter-"+ blnResult);InitializeExecuted(blnResult,"");return;}
function SCORM2004_Finish(strExitType,blnStatusWasSet){WriteToDebug("In SCORM2004_Finish strExitType="+ strExitType+", blnStatusWasSet="+ blnStatusWasSet);var strStatusAfterCompletion;var blnResult=true;SCORM2004_ClearErrorInfo();if((strExitType==EXIT_TYPE_FINISH)&amp;&amp;!blnStatusWasSet){WriteToDebug("Getting completion status");strStatusAfterCompletion=SCORM2004_GetCompletionStatus();WriteToDebug("Setting completion status to "+ strStatusAfterCompletion);blnResult=SCORM2004_CallSetValue("cmi.completion_status",strStatusAfterCompletion)&amp;&amp;blnResult;}
if(strExitType==EXIT_TYPE_SUSPEND&amp;&amp;USE_2004_SUSPENDALL_NAVREQ){WriteToDebug("Setting adl.nav.request to suspendAll");blnResult=SCORM2004_CallSetValue("adl.nav.request","suspendAll");}
WriteToDebug("Setting Exit");blnResult=SCORM2004_CallSetValue("cmi.exit",SCORM2004_TranslateExitTypeToSCORM(strExitType))&amp;&amp;blnResult;WriteToDebug("Calling Commit");blnResult=SCORM2004_CallCommit()&amp;&amp;blnResult;WriteToDebug("Calling Finish");blnResult=SCORM2004_CallTerminate()&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_CommitData(){WriteToDebug("In SCORM2004_CommitData");SCORM2004_ClearErrorInfo();return SCORM2004_CallCommit();}
function SCORM2004_GetStudentID(){WriteToDebug("In SCORM2004_GetStudentID");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.learner_id");}
function SCORM2004_GetStudentName(){WriteToDebug("In SCORM2004_GetStudentName");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.learner_name");}
function SCORM2004_GetBookmark(){WriteToDebug("In SCORM2004_GetBookmark");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.location");}
function SCORM2004_SetBookmark(strBookmark){WriteToDebug("In SCORM2004_SetBookmark strBookmark="+ strBookmark);SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.location",strBookmark);}
function SCORM2004_GetDataChunk(){WriteToDebug("In SCORM2004_GetDataChunk");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.suspend_data");}
function SCORM2004_SetDataChunk(strData){WriteToDebug("In SCORM2004_SetDataChunk");SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.suspend_data",strData);}
function SCORM2004_GetLaunchData(){WriteToDebug("In SCORM2004_GetLaunchData");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.launch_data");}
function SCORM2004_GetComments(){WriteToDebug("In SCORM2004_GetComments");SCORM2004_ClearErrorInfo();var intCommentCount;var strComments="";intCommentCount=SCORM2004_CallGetValue("cmi.comments_from_learner._count");for(var i=0;i&lt;intCommentCount;i++){if(strComments.length&gt;0){strComments+=" | ";}
strComments+=SCORM2004_CallGetValue("cmi.comments_from_learner."+ i+".comment");}
return strComments;}
function SCORM2004_WriteComment(strComment){WriteToDebug("In SCORM2004_WriteComment strComment="+ strComment);var intCurrentIndex;var blnResult;SCORM2004_ClearErrorInfo();if(strComment.search(/ \| /)==0){strComment=strComment.substr(3);}
strComment.replace(/\|\|/g,"|")
intCurrentIndex=SCORM2004_CallGetValue("cmi.comments_from_learner._count");blnResult=SCORM2004_CallSetValue("cmi.comments_from_learner."+ intCurrentIndex+".comment",strComment);blnResult=SCORM2004_CallSetValue("cmi.comments_from_learner."+ intCurrentIndex+".timestamp",ConvertDateToIso8601TimeStamp(new Date()))&amp;&amp;blnResult;return blnResult;}
function SCORM2004_GetLMSComments(){WriteToDebug("In SCORM2004_GetLMSComments");SCORM2004_ClearErrorInfo();var intCommentCount;var strComments="";intCommentCount=SCORM2004_CallGetValue("cmi.comments_from_lms._count");for(var i=0;i&lt;intCommentCount;i++){if(strComments.length&gt;0){strComments+=" \r\n";}
strComments+=SCORM2004_CallGetValue("cmi.comments_from_lms."+ i+".comment");}
return strComments;}
function SCORM2004_GetAudioPlayPreference(){var intTempPreference;WriteToDebug("In SCORM2004_GetAudioPlayPreference");SCORM2004_ClearErrorInfo();intTempPreference=SCORM2004_CallGetValue("cmi.learner_preference.audio_level");if(intTempPreference==""){intTempPreference=0;}
intTempPreference=parseInt(intTempPreference,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0){WriteToDebug("Returning On");return PREFERENCE_ON;}
else if(intTempPreference&lt;=0){WriteToDebug("Returning Off");return PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS","intTempPreference="+ intTempPreference);return null;}}
function SCORM2004_GetAudioVolumePreference(){var intTempPreference;WriteToDebug("In SCORM2004_GetAudioVollumePreference");SCORM2004_ClearErrorInfo();intTempPreference=SCORM2004_CallGetValue("cmi.learner_preference.audio_level");WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference==""){intTempPreference=100;}
intTempPreference=parseInt(intTempPreference,10);if(intTempPreference&lt;=0){WriteToDebug("Setting to 100");intTempPreference=100;}
if(!(intTempPreference&gt;0&amp;&amp;intTempPreference&lt;=100)){WriteToDebug("ERROR: invalid preference");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS","intTempPreference="+ intTempPreference);return null;}
WriteToDebug("Returning "+ intTempPreference);return intTempPreference;}
function SCORM2004_SetAudioPreference(PlayPreference,intPercentOfMaxVolume){WriteToDebug("In SCORM2004_SetAudioPreference PlayPreference="+ PlayPreference+", intPercentOfMaxVolume="+ intPercentOfMaxVolume);SCORM2004_ClearErrorInfo();if(PlayPreference==PREFERENCE_OFF){WriteToDebug("Setting percent to 0");intPercentOfMaxVolume=0;}
return SCORM2004_CallSetValue("cmi.learner_preference.audio_level",intPercentOfMaxVolume);}
function SCORM2004_SetLanguagePreference(strLanguage){WriteToDebug("In SCORM2004_SetLanguagePreference strLanguage="+ strLanguage);SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.learner_preference.language",strLanguage);}
function SCORM2004_GetLanguagePreference(){WriteToDebug("In SCORM2004_GetLanguagePreference");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.learner_preference.language");}
function SCORM2004_SetSpeedPreference(intPercentOfMax){WriteToDebug("In SCORM2004_SetSpeedPreference intPercentOfMax="+ intPercentOfMax);SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.learner_preference.delivery_speed",intPercentOfMax);}
function SCORM2004_GetSpeedPreference(){var intSCORMSpeed;var intPercentOfMax;WriteToDebug("In SCORM2004_GetSpeedPreference");SCORM2004_ClearErrorInfo();intSCORMSpeed=SCORM2004_CallGetValue("cmi.learner_preference.delivery_speed");WriteToDebug("intSCORMSpeed="+ intSCORMSpeed);if(intSCORMSpeed==""){WriteToDebug("Detected empty string, defaulting to 100");intSCORMSpeed=100;}
intSCORMSpeed=parseInt(intSCORMSpeed,10);if(intSCORMSpeed&lt;0){WriteToDebug("ERROR - out of range");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - out of range","intSCORMSpeed="+ intSCORMSpeed);return null;}
WriteToDebug("intSCORMSpeed "+ intSCORMSpeed);return intSCORMSpeed;}
function SCORM2004_SetTextPreference(intPreference){WriteToDebug("In SCORM2004_SetTextPreference intPreference="+ intPreference);SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.learner_preference.audio_captioning",intPreference);}
function SCORM2004_GetTextPreference(){var intTempPreference;WriteToDebug("In SCORM2004_GetTextPreference");SCORM2004_ClearErrorInfo();intTempPreference=SCORM2004_CallGetValue("cmi.learner_preference.audio_captioning");intTempPreference=parseInt(intTempPreference,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0){WriteToDebug("Returning On");return PREFERENCE_ON;}
else if(intTempPreference==0||intTempPreference==""){WriteToDebug("Returning Default");return PREFERENCE_DEFAULT;}
else if(intTempPreference&lt;0){WriteToDebug("Returning Off");return PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_PREFERENCE,"Invalid text preference received from LMS","intTempPreference="+ intTempPreference);return null;}}
function SCORM2004_GetPreviouslyAccumulatedTime(){var strIso8601Time;var intMilliseconds;WriteToDebug("In SCORM2004_GetPreviouslyAccumulatedTime");SCORM2004_ClearErrorInfo();strIso8601Time=SCORM2004_CallGetValue("cmi.total_time")
WriteToDebug("strIso8601Time="+ strIso8601Time);if(!IsValidIso8601TimeSpan(strIso8601Time)){WriteToDebug("ERROR - Invalid Iso8601Time");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_TIMESPAN,"Invalid timespan received from LMS","strTime="+ strIso8601Time);return null;}
intMilliseconds=ConvertScorm2004TimeToMS(strIso8601Time);WriteToDebug("Returning "+ intMilliseconds);return intMilliseconds;}
function SCORM2004_SaveTime(intMilliSeconds){var strISO8601Time;WriteToDebug("In SCORM2004_SaveTime intMilliSeconds="+ intMilliSeconds);SCORM2004_ClearErrorInfo();strISO8601Time=ConvertMilliSecondsIntoSCORM2004Time(intMilliSeconds);WriteToDebug("strISO8601Time="+ strISO8601Time);return SCORM2004_CallSetValue("cmi.session_time",strISO8601Time);}
function SCORM2004_GetMaxTimeAllowed(){var strIso8601Time;var intMilliseconds;WriteToDebug("In SCORM2004_GetMaxTimeAllowed");SCORM2004_ClearErrorInfo();strIso8601Time=SCORM2004_CallGetValue("cmi.max_time_allowed")
WriteToDebug("strIso8601Time="+ strIso8601Time);if(strIso8601Time==""){strIso8601Time="20Y";}
if(!IsValidIso8601TimeSpan(strIso8601Time)){WriteToDebug("ERROR - Invalid Iso8601Time");SCORM2004_SetErrorInfoManually(SCORM_ERROR_INVALID_TIMESPAN,"Invalid timespan received from LMS","strIso8601Time="+ strIso8601Time);return null;}
intMilliseconds=ConvertScorm2004TimeToMS(ConvertScorm2004TimeToMS);WriteToDebug("intMilliseconds="+ intMilliseconds);return intMilliseconds;}
function SCORM2004_DisplayMessageOnTimeout(){var strTLA;WriteToDebug("In SCORM2004_DisplayMessageOnTimeout");SCORM2004_ClearErrorInfo();strTLA=SCORM2004_CallGetValue("cmi.time_limit_action");WriteToDebug("strTLA="+ strTLA);if(strTLA==SCORM2004_TLA_EXIT_MESSAGE||strTLA==SCORM2004_TLA_CONTINUE_MESSAGE){WriteToDebug("returning true");return true;}
else if(strTLA==SCORM2004_TLA_EXIT_NO_MESSAGE||strTLA==SCORM2004_TLA_CONTINUE_NO_MESSAGE||strTLA==""){WriteToDebug("returning false");return false;}
else{WriteToDebug("Error invalid TLA");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS","strTLA="+ strTLA);return null;}}
function SCORM2004_ExitOnTimeout(){var strTLA;WriteToDebug("In SCORM2004_ExitOnTimeout");SCORM2004_ClearErrorInfo();strTLA=SCORM2004_CallGetValue("cmi.time_limit_action");WriteToDebug("strTLA="+ strTLA);if(strTLA==SCORM2004_TLA_EXIT_MESSAGE||strTLA==SCORM2004_TLA_EXIT_NO_MESSAGE){WriteToDebug("returning true");return true;}
else if(strTLA==SCORM2004_TLA_CONTINUE_MESSAGE||strTLA==SCORM2004_TLA_CONTINUE_NO_MESSAGE||strTLA==""){WriteToDebug("returning false");return false;}
else{WriteToDebug("ERROR invalid TLA");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS","strTLA="+ strTLA);return null;}}
function SCORM2004_GetPassingScore(){var fltScore;WriteToDebug("In SCORM2004_GetPassingScore");SCORM2004_ClearErrorInfo();fltScore=SCORM2004_CallGetValue("cmi.scaled_passing_score")
WriteToDebug("fltScore="+ fltScore);if(fltScore==""){fltScore=0;}
if(!IsValidDecimal(fltScore)){WriteToDebug("Error - score is not a valid decimal");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_DECIMAL,"Invalid mastery score received from LMS","fltScore="+ fltScore);return null;}
fltScore=parseFloat(fltScore);fltScore=fltScore*100;WriteToDebug("returning fltScore-"+ fltScore);return fltScore;}
function SCORM2004_SetScore(intScore,intMaxScore,intMinScore){var blnResult;var fltNormalizedScore;WriteToDebug("In SCORM2004_SetScore intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM2004_ClearErrorInfo();fltNormalizedScore=intScore/100;RoundToPrecision(fltNormalizedScore,7);blnResult=SCORM2004_CallSetValue("cmi.score.raw",intScore);blnResult=SCORM2004_CallSetValue("cmi.score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.score.min",intMinScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.score.scaled",fltNormalizedScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_GetScore(){WriteToDebug("In SCORM2004_GetScore");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.score.raw");}
function SCORM2004_GetScaledScore(){WriteToDebug("In SCORM2004_GetScaledScore");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.score.scaled");}
function SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004InteractionType){var blnResult;var intInteractionIndex;var strResult;blnCorrect=new String(blnCorrect);SCORM2004_ClearErrorInfo();intInteractionIndex=SCORM2004_CallGetValue("cmi.interactions._count");WriteToDebug("intInteractionIndex="+ intInteractionIndex);if(intInteractionIndex==""){WriteToDebug("Setting Interaction Index to 0");intInteractionIndex=0;}
if(blnCorrect==true||blnCorrect=="true"||blnCorrect==INTERACTION_RESULT_CORRECT){strResult=SCORM2004_RESULT_CORRECT;}
else if(String(blnCorrect)=="false"||blnCorrect==INTERACTION_RESULT_WRONG){strResult=SCORM2004_RESULT_WRONG;}
else if(blnCorrect==INTERACTION_RESULT_UNANTICIPATED){strResult=SCORM2004_RESULT_UNANTICIPATED;}
else if(blnCorrect==INTERACTION_RESULT_NEUTRAL){strResult=SCORM2004_RESULT_NEUTRAL;}
else{strResult="";}
WriteToDebug("strResult="+ strResult);strID=CreateValidIdentifier(strID);blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".id",strID);blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".type",SCORM2004InteractionType)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".learner_response",strResponse)&amp;&amp;blnResult;if(strResult!=undefined&amp;&amp;strResult!=null&amp;&amp;strResult!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".result",strResult)&amp;&amp;blnResult;}
if(strCorrectResponse!=undefined&amp;&amp;strCorrectResponse!=null&amp;&amp;strCorrectResponse!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".correct_responses.0.pattern",strCorrectResponse)&amp;&amp;blnResult;}
if(strDescription!=undefined&amp;&amp;strDescription!=null&amp;&amp;strDescription!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".description",strDescription)&amp;&amp;blnResult;}
if(intWeighting!=undefined&amp;&amp;intWeighting!=null&amp;&amp;intWeighting!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".weighting",intWeighting)&amp;&amp;blnResult;}
if(intLatency!=undefined&amp;&amp;intLatency!=null&amp;&amp;intLatency!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".latency",ConvertMilliSecondsIntoSCORM2004Time(intLatency))&amp;&amp;blnResult;}
if(strLearningObjectiveID!=undefined&amp;&amp;strLearningObjectiveID!=null&amp;&amp;strLearningObjectiveID!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".objectives.0.id",strLearningObjectiveID)&amp;&amp;blnResult;}
blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".timestamp",ConvertDateToIso8601TimeStamp(dtmTime))&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordTrueFalseInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse=null;if(blnResponse){strResponse="true";}
else{strResponse="false";}
if(blnCorrectResponse==true){strCorrectResponse="true";}
else if(blnCorrectResponse==false){strCorrectResponse="false";}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_TRUE_FALSE);}
function SCORM2004_RecordMultipleChoiceInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordMultipleChoiceInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+="[,]";}
strResponse+=aryResponse[i].Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+="[,]";}
strCorrectResponse+=aryCorrectResponse[i].Long;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_CHOICE);}
function SCORM2004_RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordFillInInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var interactionType;if(strCorrectResponse==null){strCorrectResponse="";}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;250||strResponse.length&gt;250){interactionType=SCORM2004_INTERACTION_TYPE_LONG_FILL_IN;}
else{interactionType=SCORM2004_INTERACTION_TYPE_FILL_IN;}
if(strCorrectResponse.length&gt;4000){strCorrectResponse=strCorrectResponse.substr(0,4000);}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,interactionType);}
function SCORM2004_RecordMatchingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordMatchingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+="[,]";}
strResponse+=aryResponse[i].Source.Long+"[.]"+ aryResponse[i].Target.Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+="[,]";}
strCorrectResponse+=aryCorrectResponse[i].Source.Long+"[.]"+ aryCorrectResponse[i].Target.Long;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_MATCHING);}
function SCORM2004_RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordPerformanceInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);strResponse=new String(strResponse);if(strResponse.length&gt;250){strResponse=strResponse.substr(0,250);}
if(strCorrectResponse==null){strCorrectResponse="";}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;250){strCorrectResponse=strCorrectResponse.substr(0,250);}
strResponse="[.]"+ strResponse;strCorrectResponse="[.]"+ strCorrectResponse;return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_PERFORMANCE);}
function SCORM2004_RecordSequencingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordSequencingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+="[,]";}
strResponse+=aryResponse[i].Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+="[,]";}
strCorrectResponse+=aryCorrectResponse[i].Long;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_SEQUENCING);}
function SCORM2004_RecordLikertInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In RecordLikertInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse=response.Long;var strCorrectResponse="";if(correctResponse!=null){strCorrectResponse=correctResponse.Long;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_LIKERT);}
function SCORM2004_RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordNumericInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);if(strCorrectResponse!=undefined&amp;&amp;strCorrectResponse!=null&amp;&amp;strCorrectResponse!=""){strCorrectResponse=strCorrectResponse+"[:]"+ strCorrectResponse;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_NUMERIC);}
function SCORM2004_GetEntryMode(){var strEntry;WriteToDebug("In SCORM2004_GetEntryMode");SCORM2004_ClearErrorInfo();strEntry=SCORM2004_CallGetValue("cmi.entry");WriteToDebug("strEntry="+ strEntry);if(strEntry==SCORM2004_ENTRY_ABINITIO){WriteToDebug("Returning first time");return ENTRY_FIRST_TIME;}
else if(strEntry==SCORM2004_ENTRY_RESUME){WriteToDebug("Returning resume");return ENTRY_RESUME;}
else if(strEntry==SCORM2004_ENTRY_NORMAL){WriteToDebug("returning normal");return ENTRY_REVIEW;}
else{WriteToDebug("ERROR - invalid entry mode");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_ENTRY,"Invalid entry vocab received from LMS","strEntry="+ strEntry);return null;}}
function SCORM2004_GetLessonMode(){var strLessonMode;WriteToDebug("In SCORM2004_GetLessonMode");SCORM2004_ClearErrorInfo();strLessonMode=SCORM2004_CallGetValue("cmi.mode");WriteToDebug("strLessonMode="+ strLessonMode);if(strLessonMode==SCORM2004_BROWSE){WriteToDebug("Returning browse");return MODE_BROWSE;}
else if(strLessonMode==SCORM2004_NORMAL){WriteToDebug("returning normal");return MODE_NORMAL;}
else if(strLessonMode==SCORM2004_REVIEW){WriteToDebug("Returning Review");return MODE_REVIEW;}
else{WriteToDebug("ERROR - invalid lesson mode");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_LESSON_MODE,"Invalid lesson_mode vocab received from LMS","strLessonMode="+ strLessonMode);return null;}}
function SCORM2004_GetTakingForCredit(){var strCredit;WriteToDebug("In SCORM2004_GetTakingForCredit");SCORM2004_ClearErrorInfo();strCredit=SCORM2004_CallGetValue("cmi.credit");WriteToDebug("strCredit="+ strCredit);if(strCredit=="credit"){WriteToDebug("Returning true");return true;}
else if(strCredit=="no-credit"){WriteToDebug("Returning false");return false;}
else{WriteToDebug("ERROR - invalid credit");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_CREDIT,"Invalid credit vocab received from LMS","strCredit="+ strCredit);return null;}}
function SCORM2004_SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){var intObjectiveIndex;var blnResult;var fltNormalizedScore;WriteToDebug("In SCORM2004_SetObjectiveScore, strObejctiveID="+ strObjectiveID+", intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);fltNormalizedScore=intScore/100;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".score.raw",intScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".score.min",intMinScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".score.scaled",fltNormalizedScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_SetObjectiveStatus(strObjectiveID,Lesson_Status){var intObjectiveIndex;var blnResult;var strSCORMSuccessStatus="";var strSCORMCompletionStatus="";WriteToDebug("In SCORM2004_SetObjectiveStatus strObjectiveID="+ strObjectiveID+", Lesson_Status="+ Lesson_Status);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);if(Lesson_Status==LESSON_STATUS_PASSED){strSCORMSuccessStatus=SCORM2004_PASSED;strSCORMCompletionStatus=SCORM2004_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_FAILED){strSCORMSuccessStatus=SCORM2004_FAILED;strSCORMCompletionStatus=SCORM2004_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_COMPLETED){strSCORMSuccessStatus=SCORM2004_UNKNOWN;strSCORMCompletionStatus=SCORM2004_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_BROWSED){strSCORMSuccessStatus=SCORM2004_UNKNOWN;strSCORMCompletionStatus=SCORM2004_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_INCOMPLETE){strSCORMSuccessStatus=SCORM2004_UNKNOWN;strSCORMCompletionStatus=SCORM2004_INCOMPLETE;}
else if(Lesson_Status==LESSON_STATUS_NOT_ATTEMPTED){strSCORMSuccessStatus=SCORM2004_UNKNOWN;strSCORMCompletionStatus=SCORM2004_NOT_ATTEMPTED;}
WriteToDebug("strSCORMSuccessStatus="+ strSCORMSuccessStatus);WriteToDebug("strSCORMCompletionStatus="+ strSCORMCompletionStatus);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".success_status",strSCORMSuccessStatus)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".completion_status",strSCORMCompletionStatus)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_SetObjectiveDescription(strObjectiveID,strObjectiveDescription){var intObjectiveIndex;WriteToDebug("In SCORM2004_SetObjectiveDescription strObjectiveID="+ strObjectiveID+", strObjectiveDescription="+ strObjectiveDescription);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".description",strObjectiveDescription)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_GetObjectiveScore(strObjectiveID){var intObjectiveIndex;WriteToDebug("In SCORM2004_GetObjectiveScore, strObejctiveID="+ strObjectiveID);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);return SCORM2004_CallGetValue("cmi.objectives."+ intObjectiveIndex+".score.raw");}
function SCORM2004_GetObjectiveStatus(strObjectiveID){var intObjectiveIndex;var strSuccessStatus;var strCompletionStatus;WriteToDebug("In SCORM2004_GetObjectiveStatus, strObejctiveID="+ strObjectiveID);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);strSuccessStatus=SCORM2004_CallGetValue("cmi.objectives."+ intObjectiveIndex+".success_status");strCompletionStatus=SCORM2004_CallGetValue("cmi.objectives."+ intObjectiveIndex+".completion_status");if(strSuccessStatus==SCORM2004_PASSED){WriteToDebug("returning Passed");return LESSON_STATUS_PASSED;}
else if(strSuccessStatus==SCORM2004_FAILED){WriteToDebug("Returning Failed");return LESSON_STATUS_FAILED;}
else if(strCompletionStatus==SCORM2004_COMPLETED){WriteToDebug("Returning Completed");return LESSON_STATUS_COMPLETED;}
else if(strCompletionStatus==SCORM2004_INCOMPLETE){WriteToDebug("Returning Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strCompletionStatus==SCORM2004_NOT_ATTEMPTED||strCompletionStatus==SCORM2004_UNKNOWN||strCompletionStatus==""){WriteToDebug("Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_STATUS,"Invalid objective status received from LMS or initial status not yet recorded for objective","strCompletionStatus="+ strCompletionStatus);return null;}}
function SCORM2004_GetObjectiveProgressMeasure(strObjectiveID){var strProgressMeasure=SCORM2004_CallGetValue("cmi.objectives."+ strObjectiveID+".progress_measure");return strProgressMeasure;}
function SCORM2004_GetObjectiveDescription(strObjectiveID){var intObjectiveIndex;var strSuccessStatus;var strCompletionStatus;WriteToDebug("In SCORM2004_GetObjectiveDescription, strObejctiveID="+ strObjectiveID);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);strDescription=SCORM2004_CallGetValue("cmi.objectives."+ intObjectiveIndex+".description");return strDescription;}
function SCORM2004_FindObjectiveIndexFromID(strObjectiveID){var intCount;var i;var strTempID;WriteToDebug("In SCORM2004_FindObjectiveIndexFromID");intCount=SCORM2004_CallGetValue("cmi.objectives._count");if(intCount==""){WriteToDebug("Setting intCount=0");return 0;}
intCount=parseInt(intCount,10);WriteToDebug("intCount="+ intCount);for(i=0;i&lt;intCount;i++){WriteToDebug("Checking index "+ i);strTempID=SCORM2004_CallGetValue("cmi.objectives."+ i+".id");WriteToDebug("ID="+ strTempID);if(strTempID==strObjectiveID){WriteToDebug("Found Matching index");return i;}}
WriteToDebug("Did not find match, returning count");return intCount;}
function SCORM2004_SetFailed(){WriteToDebug("In SCORM2004_SetFailed");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.success_status",SCORM2004_FAILED);blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_COMPLETED)&amp;&amp;blnResult;return blnResult;}
function SCORM2004_SetPassed(){WriteToDebug("In SCORM2004_SetPassed");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.success_status",SCORM2004_PASSED);blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_COMPLETED)&amp;&amp;blnResult;return blnResult;}
function SCORM2004_SetCompleted(){WriteToDebug("In SCORM2004_SetCompleted");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_COMPLETED);return blnResult;}
function SCORM2004_ResetStatus(){WriteToDebug("In SCORM2004_ResetStatus");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.success_status",SCORM2004_UNKNOWN);blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_INCOMPLETE)&amp;&amp;blnResult;return blnResult;}
function SCORM2004_GetStatus(){var strSuccessStatus;var strCompletionStatus;WriteToDebug("In SCORM2004_GetStatus");SCORM2004_ClearErrorInfo();strSuccessStatus=SCORM2004_CallGetValue("cmi.success_status");strCompletionStatus=SCORM2004_CallGetValue("cmi.completion_status");WriteToDebug("strSuccessStatus="+ strSuccessStatus);WriteToDebug("strCompletionStatus="+ strCompletionStatus);if(strSuccessStatus==SCORM2004_PASSED){WriteToDebug("returning Passed");return LESSON_STATUS_PASSED;}
else if(strSuccessStatus==SCORM2004_FAILED){WriteToDebug("Returning Failed");return LESSON_STATUS_FAILED;}
else if(strCompletionStatus==SCORM2004_COMPLETED){WriteToDebug("Returning Completed");return LESSON_STATUS_COMPLETED;}
else if(strCompletionStatus==SCORM2004_INCOMPLETE){WriteToDebug("Returning Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strCompletionStatus==SCORM2004_NOT_ATTEMPTED||strCompletionStatus==SCORM2004_UNKNOWN){WriteToDebug("Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_STATUS,"Invalid lesson status received from LMS","strCompletionStatus="+ strCompletionStatus);return null;}}
function SCORM2004_GetProgressMeasure(){WriteToDebug("In SCORM2004_GetProgressMeasure");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallGetValue("cmi.progress_measure");return blnResult;}
function SCORM2004_SetProgressMeasure(numMeasure){WriteToDebug("In SCORM2004_SetProgressMeasure");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.progress_measure",numMeasure);return blnResult;}
function SCORM2004_SetObjectiveProgressMeasure(strObjectiveID,numMeasure){WriteToDebug("In SCORM2004_SetObjectiveProgressMeasure");var intObjectiveIndex;var blnResult;WriteToDebug("In SCORM2004_SetObjectiveProgressMeasure, strObejctiveID="+ strObjectiveID+", numMeasure="+ numMeasure);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".progress_measure",numMeasure);return blnResult;}
function SCORM2004_IsContentInBrowseMode(){var strLessonMode
WriteToDebug("In SCORM2004_IsContentInBrowseMode");strLessonMode=SCORM2004_CallGetValue("cmi.mode");WriteToDebug("SCORM2004_IsContentInBrowseMode,  strLessonMode="+ strLessonMode);if(strLessonMode==SCORM2004_BROWSE){WriteToDebug("Returning true");return true;}
else{WriteToDebug("Returning false");return false;}}
function SCORM2004_TranslateExitTypeToSCORM(strExitType){WriteToDebug("In SCORM2004_TranslatgeExitTypeToSCORM strExitType-"+ strExitType);if(strExitType==EXIT_TYPE_SUSPEND){WriteToDebug("Returning suspend");return SCORM2004_SUSPEND;}
else if(strExitType==EXIT_TYPE_UNLOAD){WriteToDebug("Returning Exit");return SCORM2004_NORMAL_EXIT;}
else if(strExitType==EXIT_TYPE_FINISH){WriteToDebug("Returning Logout");return SCORM2004_NORMAL_EXIT;}
else if(strExitType==EXIT_TYPE_TIMEOUT){WriteToDebug("Returning Timout");return SCORM2004_TIMEOUT;}}
function SCORM2004_GetCompletionStatus(){WriteToDebug("In SCORM2004_GetCompletionStatus");return SCORM2004_COMPLETED;}
function SCORM2004_SetPointBasedScore(intScore,intMaxScore,intMinScore){var blnResult;var fltCalculatedScore;WriteToDebug("In SCORM2004_SetPointBasedScore intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM2004_ClearErrorInfo();if(intScore&gt;=intMinScore)
{fltCalculatedScore=intScore/intMaxScore;}else{WriteToDebug("intScore is lower than intMinScore. Overriding score with minscore for cmi.score.scaled");fltCalculatedScore=intMinScore/intMaxScore;}
fltCalculatedScore=RoundToPrecision(fltCalculatedScore,7);blnResult=SCORM2004_CallSetValue("cmi.score.raw",intScore);blnResult=SCORM2004_CallSetValue("cmi.score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.score.min",intMinScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.score.scaled",fltCalculatedScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_FindInteractionIndexFromID(strInteractionID){var intCount;var i;var strTempID;var dtmTempDate=new Date();var index;var currentIndexTimestamp=new Date("1/1/1900");WriteToDebug("In SCORM2004_FindInteractionIndexFromID");intCount=SCORM2004_CallGetValue("cmi.interactions._count");if(intCount==""){WriteToDebug("Setting intCount=0");return null;}
intCount=parseInt(intCount,10);WriteToDebug("intCount="+ intCount);for(i=0;i&lt;intCount;i++){WriteToDebug("Checking index "+ i);strTempID=SCORM2004_CallGetValue("cmi.interactions."+ i+".id");WriteToDebug("ID="+ strTempID);if(strTempID==strInteractionID){WriteToDebug("Found Matching index: "+ i);dtmTempDate=ConvertIso8601TimeStampToDate(SCORM2004_CallGetValue("cmi.interactions."+ i+".timestamp"));WriteToDebug("timestamp for "+ i+": "+ dtmTempDate);if(dtmTempDate&gt;currentIndexTimestamp)
{index=i;currentIndexTimestamp=dtmTempDate;}}}
if(index&gt;=0)return index;WriteToDebug("Did not find match, returning null");return null;}
function SCORM2004_GetInteractionType(strInteractionID)
{var intInteractionIndex;WriteToDebug("In SCORM2004_GetInteractionType, strInteractionID="+ strInteractionID);SCORM2004_ClearErrorInfo();intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
WriteToDebug("intInteractionIndex="+ intInteractionIndex);var type=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".type");switch(type)
{case SCORM2004_INTERACTION_TYPE_FILL_IN:return INTERACTION_TYPE_FILL_IN;case SCORM2004_INTERACTION_TYPE_LONG_FILL_IN:return INTERACTION_TYPE_LONG_FILL_IN;case SCORM2004_INTERACTION_TYPE_CHOICE:return INTERACTION_TYPE_CHOICE;case SCORM2004_INTERACTION_TYPE_LIKERT:return INTERACTION_TYPE_LIKERT;case SCORM2004_INTERACTION_TYPE_MATCHING:return INTERACTION_TYPE_MATCHING;case SCORM2004_INTERACTION_TYPE_NUMERIC:return INTERACTION_TYPE_NUMERIC;case SCORM2004_INTERACTION_TYPE_PERFORMANCE:return INTERACTION_TYPE_PERFORMANCE;case SCORM2004_INTERACTION_TYPE_SEQUENCING:return INTERACTION_TYPE_SEQUENCING;case SCORM2004_INTERACTION_TYPE_TRUE_FALSE:return INTERACTION_TYPE_TRUE_FALSE;default:return"";}}
function SCORM2004_GetInteractionTimestamp(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionTimestamp, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
return SCORM2004_CallGetValue(ConvertIso8601TimeStampToDate("cmi.interactions."+ intInteractionIndex+".timestamp"));}
function SCORM2004_GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionCorrectResponses, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
var strType=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".type");var intCorrectResponseCount=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".correct_responses._count");if(intCorrectResponseCount==""){WriteToDebug("Setting intCorrectResponseCount=0");return 0;}
intCorrectResponseCount=parseInt(intCorrectResponseCount,10);WriteToDebug("intCorrectResponseCount="+ intCorrectResponseCount);if(intCorrectResponseCount==0)return new Array();if(intCorrectResponseCount&gt;1)WriteToDebug("SCORM Driver is not currently implemented to support multiple correct response combinations and will only return the first");var strResponse=new String(SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".correct_responses.0.pattern"));var aryResponse=strResponse.split("[,]");WriteToDebug("aryResponse.length = "+ aryResponse.length);aryResponse=SCORM2004_ProcessResponseArray(strType,aryResponse);WriteToDebug("aryResponse.length = "+ aryResponse.length);return aryResponse;}
function SCORM2004_GetInteractionWeighting(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionWeighting, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
return SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".weighting");}
function SCORM2004_GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionLearnerResponses, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
var strType=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".type");var strResponse=new String(SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".learner_response"));var aryResponses=strResponse.split("[,]");WriteToDebug("aryResponses.length = "+ aryResponses.length);aryResponses=SCORM2004_ProcessResponseArray(strType,aryResponses);return aryResponses;}
function SCORM2004_ProcessResponseArray(strInteractionType,aryResponses)
{WriteToDebug("Processing Response Array with "+ aryResponses.length+" pieces");for(var i=0;i&lt;aryResponses.length;i++)
{if(strInteractionType==SCORM2004_INTERACTION_TYPE_MATCHING)
{WriteToDebug("processing matching type, i="+ i);aryResponses[i]=CreateMatchingResponse(aryResponses[i]);}}
return aryResponses;}
function SCORM2004_GetInteractionResult(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionResult, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
return SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".result");}
function SCORM2004_GetInteractionLatency(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionLatency, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
var strLatency=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".latency");WriteToDebug("latency returns: "+ strLatency);var intLatency=ConvertScorm2004TimeToMS(strLatency);WriteToDebug("latency in milliseconds: "+ intLatency);return intLatency;}
function SCORM2004_GetInteractionDescription(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionDescription, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
return SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".description");}
function SCORM2004_CreateDataBucket(strBucketId,intMinSize,intMaxSize,strPersistenceType){WriteToDebug("In SCORM2004_CreateDataBucket, strBucketId="+ strBucketId+", intMinSize="+ intMinSize+", intMaxSize="+ intMaxSize+", course="+ strPersistenceType);if(SCORM2004_DetectSSPSupport()){if(SCORM2004_DoesBucketExist(strBucketId)==true){WriteToDebug("Bucket already exists and can't be re-allocated.");return false;}
else{return SCORM2004_CallSetValue("ssp.allocate","{bucketID="+ strBucketId+"}{requested="+ intMaxSize+"}{minimum="+ intMinSize+"}{reducible=true}{persistence="+ strPersistenceType+"}")}}
else{WriteToDebug("SSP is not supported in this LMS, returning false.");return false;}}
function SCORM2004_GetDataFromBucket(strBucketId){WriteToDebug("In SCORM2004_GetDataFromBucket, strBucketId="+ strBucketId);if(SCORM2004_DetectSSPSupport()){var data=SCORM2004_CallGetValue("ssp.data.{bucketID="+ strBucketId+"}");return data;}
else{WriteToDebug("SSP is not supported in this LMS, returning empty string.");return"";}}
function SCORM2004_PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("In SCORM2004_PutDataInBucket, strBucketId="+ strBucketId+", blnAppendToEnd="+ blnAppendToEnd+", strData="+ strData);if(SCORM2004_DetectSSPSupport()){if(blnAppendToEnd==true){return SCORM2004_CallSetValue("ssp.appendData","{bucketID="+ strBucketId+"}"+ strData);}
else{return SCORM2004_CallSetValue("ssp.data","{bucketID="+ strBucketId+"}"+ strData);}}
else{WriteToDebug("SSP is not supported in this LMS, returning false.");return false;}}
function SCORM2004_DetectSSPSupport(){WriteToDebug("In SCORM2004_DetectSSPSupport");if(blnSCORM2004_SSP_Is_Supported==true){WriteToDebug("Support already detected, returning true");return true;}
else if(blnSCORM2004_SSP_Is_Supported==false){WriteToDebug("Support already determined to me missing, returning false");return false;}
else{var intBucketCount=SCORM2004_CallGetValue("ssp._count");if(SCORM2004_GetLastError()==NO_ERROR){WriteToDebug("SSP data model call succeeded, SSP is supported");blnSCORM2004_SSP_Is_Supported=true;return true;}
else{WriteToDebug("SSP data model call failed, SSP is NOT supported");blnSCORM2004_SSP_Is_Supported=false;return false;}}}
function SCORM2004_GetBucketInfo(strBucketId){WriteToDebug("In SCORM2004_GetBucketInfo, strBucketId="+ strBucketId);var intTotalSpace=0;var intUsedSpace=0;var strBucketState=new String(SCORM2004_CallGetValue("ssp.bucket_state.{bucketID="+ strBucketId+"}"));if(strBucketState==""||strBucketState==null||strBucketState==undefined){WriteToDebug("Could not retrieve bucket state, returning 0 total size and 0 used size");return new SSPBucketSize(0,0);}
var sectionArray=strBucketState.split("{");for(var section in sectionArray){section=new String(sectionArray[section]);section=section.replace("}","");if(section.indexOf("totalSpace",0)==0){WriteToDebug("Found total space");intTotalSpace=parseInt(section.substr(11),10);WriteToDebug("total space="+ intTotalSpace);}
else if(section.indexOf("used",0)==0){WriteToDebug("Found used space");intUsedSpace=parseInt(section.substr(5),10);WriteToDebug("used="+ intUsedSpace);}}
var returnValue=new SSPBucketSize(intTotalSpace,intUsedSpace);return returnValue;}
function SCORM2004_DoesBucketExist(strBucketId){WriteToDebug("In SCORM2004_DoesBucketExist, strBucketId="+ strBucketId);var intBucketCount=SCORM2004_CallGetValue("ssp._count");intBucketCount=parseInt(intBucketCount,10);for(var i=0;i&lt;intBucketCount;i++){if(strBucketId==SCORM2004_CallGetValue("ssp."+ i+".id")){WriteToDebug("Bucket '"+ strBucketId+"' Exists");return true;}}
WriteToDebug("Bucket '"+ strBucketId+"' DOES NOT Exist");return false;}
function SCORM2004_CallInitialize(){var strResult;WriteToDebug("In SCORM2004_CallInitialize");SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Calling Initialize");strResult=SCORM2004_objAPI.Initialize("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM2004_FALSE){WriteToDebug("Detected failed call to initialize");SCORM2004_SetErrorInfo();WriteToDebug("Error calling Initialize:");WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM2004_CallSetValue(strElement,strValue){var strResult;WriteToDebug("SCORM2004_CallSetValue strElement="+ strElement+", strValue="+ strValue);if(blnReviewModeSoReadOnly===true){WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");return true;}
SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Calling SetValue");strElement=strElement+"";strValue=strValue+"";strResult=SCORM2004_objAPI.SetValue(strElement,strValue)
strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM2004_FALSE){WriteToDebug("Detected Failed call to SetValue");SCORM2004_SetErrorInfo();WriteToDebug("Error calling SetValue:");WriteToDebug("              strElement="+ strElement);WriteToDebug("              strValue="+ strValue);WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM2004_CallGetValue(strElement){var strResult
WriteToDebug("In SCORM2004_CallGetValue strElement="+ strElement);SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Call GetValue");strElement=strElement+"";strResult=SCORM2004_objAPI.GetValue(strElement)+""
WriteToDebug("strResult="+ strResult);intSCORM2004Error=SCORM2004_objAPI.GetLastError()
intSCORM2004Error=intSCORM2004Error+"";WriteToDebug("intSCORM2004Error="+ intSCORM2004Error);if(intSCORM2004Error!=SCORM2004_NO_ERROR){WriteToDebug("Detected failed called to GetValue");SCORM2004_SetErrorInfo();WriteToDebug("Error calling LMSGetValue:");WriteToDebug("              strElement="+ strElement);WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);}
WriteToDebug("Returning "+ strResult);return strResult;}
function SCORM2004_CallCommit(){var strResult;WriteToDebug("In SCORM2004_CallCommit");SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Calling Commit");strResult=SCORM2004_objAPI.Commit("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM2004_FALSE){WriteToDebug("Detected failed call to Commit");SCORM2004_SetErrorInfo();WriteToDebug("Error calling Commit:");WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM2004_CallTerminate(){var strResult;WriteToDebug("In SCORM2004_CallTerminate");SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Calling Terminate");strResult=SCORM2004_objAPI.Terminate("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM2004_FALSE){WriteToDebug("Detected failed call to Terminate");SCORM2004_SetErrorInfo();WriteToDebug("Error calling Terminate:");WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);return false;}
WriteToDebug("Returning True");return true;}
function SCORM2004_ClearErrorInfo(){WriteToDebug("In SCORM2004_ClearErrorInfo");intSCORM2004Error=SCORM2004_NO_ERROR;strSCORM2004ErrorString="";strSCORM2004ErrorDiagnostic="";}
function SCORM2004_SetErrorInfo(){WriteToDebug("In SCORM2004_SetErrorInfo");intSCORM2004Error=SCORM2004_objAPI.GetLastError();strSCORM2004ErrorString=SCORM2004_objAPI.GetErrorString(intSCORM2004Error);strSCORM2004ErrorDiagnostic=SCORM2004_objAPI.GetDiagnostic("");intSCORM2004Error=intSCORM2004Error+"";strSCORM2004ErrorString=strSCORM2004ErrorString+"";strSCORM2004ErrorDiagnostic=strSCORM2004ErrorDiagnostic+"";WriteToDebug("intSCORM2004Error="+ intSCORM2004Error);WriteToDebug("strSCORM2004ErrorString="+ strSCORM2004ErrorString);WriteToDebug("strSCORM2004ErrorDiagnostic="+ strSCORM2004ErrorDiagnostic);}
function SCORM2004_SetErrorInfoManually(intNum,strString,strDiagnostic){WriteToDebug("In SCORM2004_SetErrorInfoManually");WriteToDebug("ERROR-Num="+ intNum);WriteToDebug("      String="+ strString);WriteToDebug("      Diag="+ strDiagnostic);intSCORM2004Error=intNum;strSCORM2004ErrorString=strString;strSCORM2004ErrorDiagnostic=strDiagnostic;}
function SCORM2004_GetLastError(){WriteToDebug("In SCORM2004_GetLastError");if(intSCORM2004Error==SCORM2004_NO_ERROR){WriteToDebug("Returning No Error");return NO_ERROR;}
else{WriteToDebug("Returning "+ intSCORMError);return intSCORM2004Error;}}
function SCORM2004_GetLastErrorDesc(){WriteToDebug("In SCORM2004_GetLastErrorDesc, "+ strSCORM2004ErrorString+"\n"+ strSCORM2004ErrorDiagnostic);return strSCORM2004ErrorString+"\n"+ strSCORM2004ErrorDiagnostic;}
function SCORM2004_GrabAPI(){WriteToDebug("In SCORM2004_GrabAPI");if(typeof(SCORM2004_objAPI)=="undefined"||SCORM2004_objAPI==null){WriteToDebug("Searching with Rustici Software algorithm");SCORM2004_objAPI=SCORM2004_GetAPI();}
if(typeof(SCORM2004_objAPI)=="undefined"||SCORM2004_objAPI==null||SCORM2004_objAPI==false){WriteToDebug("Searching with SearchForAPI");SCORM2004_objAPI=SCORM2004_SearchForAPI(window);}
WriteToDebug("Grab API, returning, found API = "+(SCORM2004_objAPI!=null));return SCORM2004_objAPI;}
function SCORM2004_ScanParentsForApi(win)
{var MAX_PARENTS_TO_SEARCH=500;var nParentsSearched=0;while((win.API_1484_11==null||win.API_1484_11==undefined)&amp;&amp;(win.parent!=null)&amp;&amp;(win.parent!=win)&amp;&amp;(nParentsSearched&lt;=MAX_PARENTS_TO_SEARCH))
{nParentsSearched++;win=win.parent;}
return win.API_1484_11;}
function SCORM2004_GetAPI()
{var API=null;if((window.parent!=null)&amp;&amp;(window.parent!=window))
{API=SCORM2004_ScanParentsForApi(window.parent);}
if((API==null)&amp;&amp;(window.top.opener!=null))
{API=SCORM2004_ScanParentsForApi(window.top.opener);}
return API;}
function SCORM2004_SearchForAPI(wndLookIn){WriteToDebug("SCORM2004_SearchForAPI");var objAPITemp=null;var strDebugID="";strDebugID="Name="+ wndLookIn.name+", href="+ wndLookIn.location.href
objAPITemp=wndLookIn.API_1484_11;if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in this window - "+ strDebugID);return objAPITemp;}
if(SCORM2004_WindowHasParent(wndLookIn)){WriteToDebug("Searching Parent - "+ strDebugID);objAPITemp=SCORM2004_SearchForAPI(wndLookIn.parent);}
if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in a parent - "+ strDebugID);return objAPITemp;}
if(SCORM2004_WindowHasOpener(wndLookIn)){WriteToDebug("Searching Opener - "+ strDebugID);objAPITemp=SCORM2004_SearchForAPI(wndLookIn.opener);}
if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in an opener - "+ strDebugID);return objAPITemp;}
WriteToDebug("Looking in children - "+ strDebugID);objAPITemp=SCORM2004_LookInChildren(wndLookIn);if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in Children - "+ strDebugID);return objAPITemp;}
WriteToDebug("Didn't find API in this window - "+ strDebugID);return null;}
function SCORM2004_LookInChildren(wnd){WriteToDebug("SCORM2004_LookInChildren");var objAPITemp=null;var strDebugID="";strDebugID="Name="+ wnd.name+", href="+ wnd.location.href
for(var i=0;i&lt;wnd.frames.length;i++){WriteToDebug("Looking in child frame "+ i);objAPITemp=wnd.frames[i].API_1484_11;if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in child frame of "+ strDebugID);return objAPITemp;}
WriteToDebug("Looking in this child's children "+ strDebugID);objAPITemp=SCORM2004_LookInChildren(wnd.frames[i]);if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("API found in this child's children "+ strDebugID);return objAPITemp;}}
return null;}
function SCORM2004_WindowHasOpener(wnd){WriteToDebug("In SCORM2004_WindowHasOpener");if((wnd.opener!=null)&amp;&amp;(wnd.opener!=wnd)&amp;&amp;(typeof(wnd.opener)!="undefined")){WriteToDebug("Window Does Have Opener");return true;}
else{WriteToDebug("Window Does Not Have Opener");return false;}}
function SCORM2004_WindowHasParent(wnd){WriteToDebug("In SCORM2004_WindowHasParent");if((wnd.parent!=null)&amp;&amp;(wnd.parent!=wnd)&amp;&amp;(typeof(wnd.parent)!="undefined")){WriteToDebug("Window Does Have Parent");return true;}
else{WriteToDebug("Window Does Not Have Parent");return false;}}
function SCORM2004_APIFound(obj){WriteToDebug("In SCORM2004_APIFound");if(obj==null||typeof(obj)=="undefined"){WriteToDebug("API NOT Found");return false;}
else{WriteToDebug("API Found");return true;}}</text>
				</content>
				<redirectionURL/>
				<headersSize>292</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/SCORMFunctions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>373</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="SCORMFunctions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var SCORM_LOGOUT="logout";var SCORM_SUSPEND="suspend";var SCORM_NORMAL_EXIT="";var SCORM_TIMEOUT="time-out";var SCORM_PASSED="passed";var SCORM_FAILED="failed";var SCORM_COMPLETED="completed";var SCORM_BROWSED="browsed";var SCORM_INCOMPLETE="incomplete";var SCORM_NOT_ATTEMPTED="not attempted";var SCORM_CREDIT="credit";var SCORM_NO_CREDIT="no-credit";var SCORM_BROWSE="browse";var SCORM_NORMAL="normal";var SCORM_REVIEW="review";var SCORM_ENTRY_ABINITIO="ab-initio";var SCORM_ENTRY_RESUME="resume";var SCORM_ENTRY_NORMAL="";var SCORM_TLA_EXIT_MESSAGE="exit,message";var SCORM_TLA_EXIT_NO_MESSAGE="exit,no message";var SCORM_TLA_CONTINUE_MESSAGE="continue,message";var SCORM_TLA_CONTINUE_NO_MESSAGE="continue,no message";var SCORM_RESULT_CORRECT="correct";var SCORM_RESULT_WRONG="wrong";var SCORM_RESULT_UNANTICIPATED="unanticipated";var SCORM_RESULT_NEUTRAL="neutral";var SCORM_INTERACTION_TYPE_TRUE_FALSE="true-false";var SCORM_INTERACTION_TYPE_CHOICE="choice";var SCORM_INTERACTION_FILL_IN="fill-in";var SCORM_INTERACTION_TYPE_MATCHING="matching";var SCORM_INTERACTION_TYPE_PERFORMANCE="performance";var SCORM_INTERACTION_TYPE_SEQUENCING="sequencing";var SCORM_INTERACTION_TYPE_LIKERT="likert";var SCORM_INTERACTION_TYPE_NUMERIC="numeric";var SCORM_NO_ERROR="0";var SCORM_ERROR_INVALID_PREFERENCE="-1";var SCORM_ERROR_INVALID_STATUS="-2";var SCORM_ERROR_INVALID_SPEED="-3";var SCORM_ERROR_INVALID_TIMESPAN="-4";var SCORM_ERROR_INVALID_TIME_LIMIT_ACTION="-5";var SCORM_ERROR_INVALID_DECIMAL="-6";var SCORM_ERROR_INVALID_CREDIT="-7";var SCORM_ERROR_INVALID_LESSON_MODE="-8";var SCORM_ERROR_INVALID_ENTRY="-9";var SCORM_TRUE="true";var SCORM_FALSE="false";var SCORM_findAPITries=0;var SCORM_objAPI=null;var intSCORMError=SCORM_NO_ERROR;var strSCORMErrorString="";var strSCORMErrorDiagnostic="";var blnReviewModeSoReadOnly=false;function SCORM_Initialize(){var blnResult=true;WriteToDebug("In SCORM_Initialize");SCORM_ClearErrorInfo();WriteToDebug("Grabbing API");try{SCORM_objAPI=SCORM_GrabAPI();}
catch(e){WriteToDebug("Error grabbing 1.2 API-"+ e.name+":"+ e.message);}
if(typeof(SCORM_objAPI)=="undefined"||SCORM_objAPI==null){WriteToDebug("Unable to acquire SCORM API:")
WriteToDebug("SCORM_objAPI="+ typeof(SCORM_objAPI));InitializeExecuted(false,"Error - unable to acquire LMS API, content may not play properly and results may not be recorded.  Please contact technical support.");return false;}
WriteToDebug("Calling LMSInit");blnResult=SCORM_CallLMSInitialize();if(!blnResult){WriteToDebug("ERROR Initializing LMS");InitializeExecuted(false,"Error initializing communications with LMS");return false;}
if(SCORM_GetLessonMode()!=MODE_REVIEW){if(SCORM_IsContentInBrowseMode()){WriteToDebug("Setting Status to Browsed");blnResult=SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_BROWSED);}
else{if(SCORM_GetStatus()==LESSON_STATUS_NOT_ATTEMPTED){WriteToDebug("Setting Status to Incomplete");blnResult=SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_INCOMPLETE);}}
blnResult=SCORM_CallLMSSetValue("cmi.core.exit",SCORM_TranslateExitTypeToSCORM(DEFAULT_EXIT_TYPE))&amp;&amp;blnResult;}
else{if(!(typeof(REVIEW_MODE_IS_READ_ONLY)=="undefined")&amp;&amp;REVIEW_MODE_IS_READ_ONLY===true){blnReviewModeSoReadOnly=true;}}
WriteToDebug("Calling InitializeExecuted with parameter-"+ blnResult);InitializeExecuted(blnResult,"");return;}
function SCORM_Finish(strExitType,blnStatusWasSet){var strStatusAfterCompletion;var blnResult=true;WriteToDebug("In SCORM_Finish strExitType="+ strExitType+", blnStatusWasSet="+ blnStatusWasSet);SCORM_ClearErrorInfo();if((strExitType==EXIT_TYPE_FINISH)&amp;&amp;!blnStatusWasSet){WriteToDebug("Getting completion status");strStatusAfterCompletion=SCORM_GetCompletionStatus();WriteToDebug("Setting completion status to "+ strStatusAfterCompletion);blnResult=SCORM_CallLMSSetValue("cmi.core.lesson_status",strStatusAfterCompletion)&amp;&amp;blnResult;}
WriteToDebug("Setting Exit");blnResult=SCORM_CallLMSSetValue("cmi.core.exit",SCORM_TranslateExitTypeToSCORM(strExitType))&amp;&amp;blnResult;WriteToDebug("Calling Commit");blnResult=SCORM_CallLMSCommit()&amp;&amp;blnResult;WriteToDebug("Calling Finish");blnResult=SCORM_CallLMSFinish()&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_CommitData(){WriteToDebug("In SCORM_CommitData");SCORM_ClearErrorInfo();return SCORM_CallLMSCommit();}
function SCORM_GetStudentID(){WriteToDebug("In SCORM_GetStudentID");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.core.student_id");}
function SCORM_GetStudentName(){WriteToDebug("In SCORM_GetStudentName");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.core.student_name");}
function SCORM_GetBookmark(){WriteToDebug("In SCORM_GetBookmark");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.core.lesson_location");}
function SCORM_SetBookmark(strBookmark){WriteToDebug("In SCORM_SetBookmark strBookmark="+ strBookmark);SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_location",strBookmark);}
function SCORM_GetDataChunk(){WriteToDebug("In SCORM_GetDataChunk");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.suspend_data");}
function SCORM_SetDataChunk(strData){WriteToDebug("In SCORM_SetDataDChunk");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.suspend_data",strData);}
function SCORM_GetLaunchData(){WriteToDebug("In SCORM_GetLaunchData");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.launch_data");}
function SCORM_GetComments(){WriteToDebug("In SCORM_GetComments");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.comments");}
function SCORM_WriteComment(strComment){WriteToDebug("In SCORM_WriteComment strComment="+ strComment);SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.comments",strComment);}
function SCORM_GetLMSComments(){WriteToDebug("In SCORM_GetLMSComments");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.comments_from_lms");}
function SCORM_GetAudioPlayPreference(){var intTempPreference;WriteToDebug("In SCORM_GetAudioPlayPreference");SCORM_ClearErrorInfo();intTempPreference=SCORM_CallLMSGetValue("cmi.student_preference.audio");if(intTempPreference==""){intTempPreference=0;}
intTempPreference=parseInt(intTempPreference,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0){WriteToDebug("Returning On");return PREFERENCE_ON;}
else if(intTempPreference==0){WriteToDebug("Returning Default");return PREFERENCE_DEFAULT;}
else if(intTempPreference&lt;0){WriteToDebug("returning Off");return PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS","intTempPreference="+ intTempPreference);return null;}}
function SCORM_GetAudioVolumePreference(){var intTempPreference;WriteToDebug("In SCORM_GetAudioVollumePreference");SCORM_ClearErrorInfo();intTempPreference=SCORM_CallLMSGetValue("cmi.student_preference.audio");WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference==""){intTempPreference=100;}
intTempPreference=parseInt(intTempPreference,10);if(intTempPreference&lt;=0){WriteToDebug("Setting to 100");intTempPreference=100;}
if(!(intTempPreference&gt;0&amp;&amp;intTempPreference&lt;=100)){WriteToDebug("ERROR: invalid preference");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS","intTempPreference="+ intTempPreference);return null;}
WriteToDebug("Returning "+ intTempPreference);return intTempPreference;}
function SCORM_SetAudioPreference(PlayPreference,intPercentOfMaxVolume){WriteToDebug("In SCORM_SetAudioPreference PlayPreference="+ PlayPreference+", intPercentOfMaxVolume="+ intPercentOfMaxVolume);SCORM_ClearErrorInfo();if(PlayPreference==PREFERENCE_OFF){WriteToDebug("Setting percent to -1");intPercentOfMaxVolume=-1;}
return SCORM_CallLMSSetValue("cmi.student_preference.audio",intPercentOfMaxVolume);}
function SCORM_SetLanguagePreference(strLanguage){WriteToDebug("In SCORM_SetLanguagePreference strLanguage="+ strLanguage);SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.student_preference.language",strLanguage);}
function SCORM_GetLanguagePreference(){WriteToDebug("In SCORM_GetLanguagePreference");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.student_preference.language");}
function SCORM_SetSpeedPreference(intPercentOfMax){var intSCORMSpeed;WriteToDebug("In SCORM_SetSpeedPreference intPercentOfMax="+ intPercentOfMax);SCORM_ClearErrorInfo();intSCORMSpeed=(intPercentOfMax*2)- 100;WriteToDebug("intSCORMSpeed="+ intSCORMSpeed);return SCORM_CallLMSSetValue("cmi.student_preference.speed",intSCORMSpeed);}
function SCORM_GetSpeedPreference(){var intSCORMSpeed;var intPercentOfMax;WriteToDebug("In SCORM_GetSpeedPreference");SCORM_ClearErrorInfo();intSCORMSpeed=SCORM_CallLMSGetValue("cmi.student_preference.speed");WriteToDebug("intSCORMSpeed="+ intSCORMSpeed);if(intSCORMSpeed==""){WriteToDebug("Detected empty string, defaulting to 100");intSCORMSpeed=100;}
if(!ValidInteger(intSCORMSpeed)){WriteToDebug("ERROR - invalid integer");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - not an integer","intSCORMSpeed="+ intSCORMSpeed);return null;}
intSCORMSpeed=parseInt(intSCORMSpeed,10);if(intSCORMSpeed&lt;-100||intSCORMSpeed&gt;100){WriteToDebug("ERROR - out of range");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - out of range","intSCORMSpeed="+ intSCORMSpeed);return null;}
intPercentOfMax=(intSCORMSpeed+ 100)/2;intPercentOfMax=parseInt(intPercentOfMax,10);WriteToDebug("Returning "+ intPercentOfMax);return intPercentOfMax;}
function SCORM_SetTextPreference(intPreference){WriteToDebug("In SCORM_SetTextPreference intPreference="+ intPreference);SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.student_preference.text",intPreference);}
function SCORM_GetTextPreference(){var intTempPreference;WriteToDebug("In SCORM_GetTextPreference");SCORM_ClearErrorInfo();intTempPreference=SCORM_CallLMSGetValue("cmi.student_preference.text");intTempPreference=parseInt(intTempPreference,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0){WriteToDebug("Returning On");return PREFERENCE_ON;}
else if(intTempPreference==0||intTempPreference==""){WriteToDebug("Returning Default");return PREFERENCE_DEFAULT;}
else if(intTempPreference&lt;0){WriteToDebug("returning Off");return PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_PREFERENCE,"Invalid text preference received from LMS","intTempPreference="+ intTempPreference);return null;}}
function SCORM_GetPreviouslyAccumulatedTime(){var strCMITime;var intMilliseconds;WriteToDebug("In SCORM_GetPreviouslyAccumulatedTime");SCORM_ClearErrorInfo();strCMITime=SCORM_CallLMSGetValue("cmi.core.total_time")
WriteToDebug("strCMITime="+ strCMITime);if(!IsValidCMITimeSpan(strCMITime)){WriteToDebug("ERROR - Invalid CMITimeSpan");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_TIMESPAN,"Invalid timespan received from LMS","strTime="+ strCMITime);return null;}
intMilliseconds=ConvertCMITimeSpanToMS(strCMITime);WriteToDebug("Returning "+ intMilliseconds);return intMilliseconds;}
function SCORM_SaveTime(intMilliSeconds){var strCMITime;WriteToDebug("In SCORM_SaveTime intMilliSeconds="+ intMilliSeconds);SCORM_ClearErrorInfo();strCMITime=ConvertMilliSecondsToSCORMTime(intMilliSeconds,true);WriteToDebug("strCMITime="+ strCMITime);return SCORM_CallLMSSetValue("cmi.core.session_time",strCMITime);}
function SCORM_GetMaxTimeAllowed(){var strCMITime;var intMilliseconds;WriteToDebug("In SCORM_GetMaxTimeAllowed");SCORM_ClearErrorInfo();strCMITime=SCORM_CallLMSGetValue("cmi.student_data.max_time_allowed")
WriteToDebug("strCMITime="+ strCMITime);if(strCMITime==""){strCMITime="9999:99:99.99";}
if(!IsValidCMITimeSpan(strCMITime)){WriteToDebug("ERROR - Invalid CMITimeSpan");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_TIMESPAN,"Invalid timespan received from LMS","strTime="+ strCMITime);return null;}
intMilliseconds=ConvertCMITimeSpanToMS(strCMITime);WriteToDebug("intMilliseconds="+ intMilliseconds);return intMilliseconds;}
function SCORM_DisplayMessageOnTimeout(){var strTLA;SCORM_ClearErrorInfo();WriteToDebug("In SCORM_DisplayMessageOnTimeout");strTLA=SCORM_CallLMSGetValue("cmi.student_data.time_limit_action");WriteToDebug("strTLA="+ strTLA);if(strTLA==SCORM_TLA_EXIT_MESSAGE||strTLA==SCORM_TLA_CONTINUE_MESSAGE){WriteToDebug("returning true");return true;}
else if(strTLA==SCORM_TLA_EXIT_NO_MESSAGE||strTLA==SCORM_TLA_CONTINUE_NO_MESSAGE||strTLA==""){WriteToDebug("returning false");return false;}
else{WriteToDebug("Error invalid TLA");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS","strTLA="+ strTLA);return null;}}
function SCORM_ExitOnTimeout(){var strTLA;WriteToDebug("In SCORM_ExitOnTimeout");SCORM_ClearErrorInfo();strTLA=SCORM_CallLMSGetValue("cmi.student_data.time_limit_action");WriteToDebug("strTLA="+ strTLA);if(strTLA==SCORM_TLA_EXIT_MESSAGE||strTLA==SCORM_TLA_EXIT_NO_MESSAGE){WriteToDebug("returning true");return true;}
else if(strTLA==SCORM_TLA_CONTINUE_MESSAGE||strTLA==SCORM_TLA_CONTINUE_NO_MESSAGE||strTLA==""){WriteToDebug("returning false");return false;}
else{WriteToDebug("ERROR invalid TLA");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS","strTLA="+ strTLA);return null;}}
function SCORM_GetPassingScore(){var fltScore;WriteToDebug("In SCORM_GetPassingScore");SCORM_ClearErrorInfo();fltScore=SCORM_CallLMSGetValue("cmi.student_data.mastery_score")
WriteToDebug("fltScore="+ fltScore);if(fltScore==""){fltScore=0;}
if(!IsValidDecimal(fltScore)){WriteToDebug("Error - score is not a valid decimal");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_DECIMAL,"Invalid mastery score received from LMS","fltScore="+ fltScore);return null;}
fltScore=parseFloat(fltScore);WriteToDebug("returning fltScore");return fltScore;}
function SCORM_SetScore(intScore,intMaxScore,intMinScore){var blnResult;WriteToDebug("In SCORM_SetScore intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM_ClearErrorInfo();blnResult=SCORM_CallLMSSetValue("cmi.core.score.raw",intScore);blnResult=SCORM_CallLMSSetValue("cmi.core.score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM_CallLMSSetValue("cmi.core.score.min",intMinScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_GetScore(){WriteToDebug("In SCORM_GetScore");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.core.score.raw");}
function SCORM_SetPointBasedScore(intScore,intMaxScore,intMinScore){WriteToDebug("SCORM_SetPointBasedScore - SCORM 1.1 and 1.2 do not support SetPointBasedScore, returning false");return false;}
function SCORM_GetScaledScore(intScore,intMaxScore,intMinScore){WriteToDebug("SCORM_GetScaledScore - SCORM 1.1 and 1.2 do not support GetScaledScore, returning false");return false;}
function SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,scormInteractionType,strAlternateResponse,strAlternateCorrectResponse){var blnResult;var blnTempResult;var intInteractionIndex;var strResult;SCORM_ClearErrorInfo();intInteractionIndex=SCORM_CallLMSGetValue("cmi.interactions._count");WriteToDebug("intInteractionIndex="+ intInteractionIndex);if(intInteractionIndex==""){WriteToDebug("Setting Interaction Index to 0");intInteractionIndex=0;}
if(blnCorrect==true||blnCorrect==INTERACTION_RESULT_CORRECT){strResult=SCORM_RESULT_CORRECT;}
else if(blnCorrect==""||blnCorrect=="false"||blnCorrect==INTERACTION_RESULT_WRONG){strResult=SCORM_RESULT_WRONG;}
else if(blnCorrect==INTERACTION_RESULT_UNANTICIPATED){strResult=SCORM_RESULT_UNANTICIPATED;}
else if(blnCorrect==INTERACTION_RESULT_NEUTRAL){strResult=SCORM_RESULT_NEUTRAL;}
WriteToDebug("strResult="+ strResult);blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".id",strID);blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".type",scormInteractionType)&amp;&amp;blnResult;blnTempResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".student_response",strResponse);if(blnTempResult==false){blnTempResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".student_response",strAlternateResponse);}
blnResult=blnResult&amp;&amp;blnTempResult;if(strCorrectResponse!=undefined&amp;&amp;strCorrectResponse!=null&amp;&amp;strCorrectResponse!=""){blnTempResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".correct_responses.0.pattern",strCorrectResponse);if(blnTempResult==false){blnTempResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".correct_responses.0.pattern",strAlternateCorrectResponse);}
blnResult=blnResult&amp;&amp;blnTempResult;}
if(strResult!=undefined&amp;&amp;strResult!=null&amp;&amp;strResult!=""){blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".result",strResult)&amp;&amp;blnResult;}
if(intWeighting!=undefined&amp;&amp;intWeighting!=null&amp;&amp;intWeighting!=""){blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".weighting",intWeighting)&amp;&amp;blnResult;}
if(intLatency!=undefined&amp;&amp;intLatency!=null&amp;&amp;intLatency!=""){blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".latency",ConvertMilliSecondsToSCORMTime(intLatency,true))&amp;&amp;blnResult;}
if(strLearningObjectiveID!=undefined&amp;&amp;strLearningObjectiveID!=null&amp;&amp;strLearningObjectiveID!=""){blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".objectives.0.id",strLearningObjectiveID)&amp;&amp;blnResult;}
blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".time",ConvertDateToCMITime(dtmTime))&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordTrueFalseInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse=null;if(blnResponse==true){strResponse="t";}
else{strResponse="f";}
if(blnCorrectResponse==true){strCorrectResponse="t";}
else if(blnCorrectResponse==false){strCorrectResponse="f";}
return SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_TRUE_FALSE,strResponse,strCorrectResponse);}
function SCORM_RecordMultipleChoiceInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordMultipleChoiceInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Short;strResponseLong+=aryResponse[i].Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Short;strCorrectResponseLong+=aryCorrectResponse[i].Long;}
var blnSuccessfullySaved;blnSuccessfullySaved=SCORM_RecordInteraction(strID,strResponseLong,blnCorrect,strCorrectResponseLong,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_CHOICE,strResponse,strCorrectResponse);return blnSuccessfullySaved;}
function SCORM_RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordFillInInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);strResponse=new String(strResponse);if(strResponse.length&gt;255){strResponse=strResponse.substr(0,255);}
if(strCorrectResponse==null){strCorrectResponse="";}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;255){strCorrectResponse=strCorrectResponse.substr(0,255);}
return SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_FILL_IN,strResponse,strCorrectResponse);}
function SCORM_RecordMatchingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordMatchingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Source.Short+"."+ aryResponse[i].Target.Short;strResponseLong+=aryResponse[i].Source.Long+"."+ aryResponse[i].Target.Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Source.Short+"."+ aryCorrectResponse[i].Target.Short;strCorrectResponseLong+=aryCorrectResponse[i].Source.Long+"."+ aryCorrectResponse[i].Target.Long;}
var blnSuccessfullySaved;blnSuccessfullySaved=SCORM_RecordInteraction(strID,strResponseLong,blnCorrect,strCorrectResponseLong,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_MATCHING,strResponse,strCorrectResponse);return blnSuccessfullySaved;}
function SCORM_RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordPerformanceInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);strResponse=new String(strResponse);if(strResponse.length&gt;255){strResponse=strResponse.substr(0,255);}
if(strCorrectResponse==null){strCorrectResponse="";}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;255){strCorrectResponse=strCorrectResponse.substr(0,255);}
return SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_PERFORMANCE,strResponse,strCorrectResponse);}
function SCORM_RecordSequencingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordSequencingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Short;strResponseLong+=aryResponse[i].Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Short;strCorrectResponseLong+=aryCorrectResponse[i].Long;}
var blnSuccessfullySaved;blnSuccessfullySaved=SCORM_RecordInteraction(strID,strResponseLong,blnCorrect,strCorrectResponseLong,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_SEQUENCING,strResponse,strCorrectResponse);return blnSuccessfullySaved;}
function SCORM_RecordLikertInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordLikertInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse;var strResponseLong;var strCorrectResponse="";var strCorrectResponseLong="";strResponse=response.Short;strResponseLong=response.Long;if(correctResponse!=null){strCorrectResponse=correctResponse.Short;strCorrectResponseLong=correctResponse.Long;}
var blnSuccessfullySaved;blnSuccessfullySaved=SCORM_RecordInteraction(strID,strResponseLong,blnCorrect,strCorrectResponseLong,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_LIKERT,strResponse,strCorrectResponse);return blnSuccessfullySaved;}
function SCORM_RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordNumericInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);return SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_NUMERIC,strResponse,strCorrectResponse);}
function SCORM_GetEntryMode(){var strEntry;WriteToDebug("In SCORM_GetEntryMode");SCORM_ClearErrorInfo();strEntry=SCORM_CallLMSGetValue("cmi.core.entry");WriteToDebug("strEntry="+ strEntry);if(strEntry==SCORM_ENTRY_ABINITIO){WriteToDebug("Returning first time");return ENTRY_FIRST_TIME;}
else if(strEntry==SCORM_ENTRY_RESUME){WriteToDebug("Returning resume");return ENTRY_RESUME;}
else if(strEntry==SCORM_ENTRY_NORMAL){WriteToDebug("returning normal");return ENTRY_REVIEW;}
else{WriteToDebug("ERROR - invalide entry mode");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_ENTRY,"Invalid entry vocab received from LMS","strEntry="+ strEntry);return null;}}
function SCORM_GetLessonMode(){var strLessonMode;WriteToDebug("In SCORM_GetLessonMode");SCORM_ClearErrorInfo();strLessonMode=SCORM_CallLMSGetValue("cmi.core.lesson_mode");WriteToDebug("strLessonMode="+ strLessonMode);if(strLessonMode==SCORM_BROWSE){WriteToDebug("Returning browse");return MODE_BROWSE;}
else if(strLessonMode==SCORM_NORMAL){WriteToDebug("returning normal");return MODE_NORMAL;}
else if(strLessonMode==SCORM_REVIEW){WriteToDebug("Returning Review");return MODE_REVIEW;}
else{WriteToDebug("ERROR - invalid lesson mode");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_LESSON_MODE,"Invalid lesson_mode vocab received from LMS","strLessonMode="+ strLessonMode);return null;}}
function SCORM_GetTakingForCredit(){var strCredit;WriteToDebug("In SCORM_GetTakingForCredit");SCORM_ClearErrorInfo();strCredit=SCORM_CallLMSGetValue("cmi.core.credit");WriteToDebug("strCredit="+ strCredit);if(strCredit=="credit"){WriteToDebug("Returning true");return true;}
else if(strCredit=="no-credit"){WriteToDebug("Returning false");return false;}
else{WriteToDebug("ERROR - invalid credit");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_CREDIT,"Invalid credit vocab received from LMS","strCredit="+ strCredit);return null;}}
function SCORM_SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){var intObjectiveIndex;var blnResult;WriteToDebug("In SCORM_SetObjectiveScore, strObejctiveID="+ strObjectiveID+", intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM_ClearErrorInfo();intObjectiveIndex=SCORM_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".score.raw",intScore)&amp;&amp;blnResult;blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".score.min",intMinScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_SetObjectiveDescription(strObjectiveID,strObjectiveDescription){var intObjectiveIndex;var blnResult;WriteToDebug("In SCORM_SetObjectiveDescription, strObjectiveDescription="+ strObjectiveDescription);WriteToDebug("Objective Descriptions are not supported prior to SCORM 2004");SCORM_ClearErrorInfo();blnResult=SCORM_TRUE;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_SetObjectiveStatus(strObjectiveID,Lesson_Status){var intObjectiveIndex;var blnResult;var strSCORMStatus="";WriteToDebug("In SCORM_SetObjectiveStatus strObjectiveID="+ strObjectiveID+", Lesson_Status="+ Lesson_Status);SCORM_ClearErrorInfo();intObjectiveIndex=SCORM_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);if(Lesson_Status==LESSON_STATUS_PASSED){strSCORMStatus=SCORM_PASSED;}
else if(Lesson_Status==LESSON_STATUS_FAILED){strSCORMStatus=SCORM_FAILED;}
else if(Lesson_Status==LESSON_STATUS_COMPLETED){strSCORMStatus=SCORM_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_BROWSED){strSCORMStatus=SCORM_BROWSED;}
else if(Lesson_Status==LESSON_STATUS_INCOMPLETE){strSCORMStatus=SCORM_INCOMPLETE;}
else if(Lesson_Status==LESSON_STATUS_NOT_ATTEMPTED){strSCORMStatus=SCORM_NOT_ATTEMPTED;}
WriteToDebug("strSCORMStatus="+ strSCORMStatus);blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".status",strSCORMStatus)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_GetObjectiveScore(strObjectiveID){var intObjectiveIndex;WriteToDebug("In SCORM_GetObjectiveScore, strObejctiveID="+ strObjectiveID);SCORM_ClearErrorInfo();intObjectiveIndex=SCORM_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);return SCORM_CallLMSGetValue("cmi.objectives."+ intObjectiveIndex+".score.raw");}
function SCORM_GetObjectiveDescription(strObjectiveID){WriteToDebug("In SCORM_GetObjectiveDescription, strObejctiveID="+ strObjectiveID);WriteToDebug("ObjectiveDescription is not supported prior to SCORM 2004");return"";}
function SCORM_GetObjectiveStatus(strObjectiveID){var intObjectiveIndex;var strStatus;WriteToDebug("In SCORM_GetObjectiveStatus, strObejctiveID="+ strObjectiveID);SCORM_ClearErrorInfo();intObjectiveIndex=SCORM_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);strStatus=SCORM_CallLMSGetValue("cmi.objectives."+ intObjectiveIndex+".status");if(strStatus==SCORM_PASSED){WriteToDebug("returning Passed");return LESSON_STATUS_PASSED;}
else if(strStatus==SCORM_FAILED){WriteToDebug("Returning Failed");return LESSON_STATUS_FAILED;}
else if(strStatus==SCORM_COMPLETED){WriteToDebug("Returning Completed");return LESSON_STATUS_COMPLETED;}
else if(strStatus==SCORM_BROWSED){WriteToDebug("Returning Browsed");return LESSON_STATUS_BROWSED;}
else if(strStatus==SCORM_INCOMPLETE){WriteToDebug("Returning Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strStatus==SCORM_NOT_ATTEMPTED||strStatus==""){WriteToDebug("Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_STATUS,"Invalid objective status received from LMS or initial status not yet recorded for objective","strStatus="+ strStatus);return null;}}
function SCORM_FindObjectiveIndexFromID(strObjectiveID){var intCount;var i;var strTempID;WriteToDebug("In SCORM_FindObjectiveIndexFromID");intCount=SCORM_CallLMSGetValue("cmi.objectives._count");if(intCount==""){WriteToDebug("Setting intCount=0");return 0;}
intCount=parseInt(intCount,10);WriteToDebug("intCount="+ intCount);for(i=0;i&lt;intCount;i++){WriteToDebug("Checking index "+ i);strTempID=SCORM_CallLMSGetValue("cmi.objectives."+ i+".id");WriteToDebug("ID="+ strTempID);if(strTempID==strObjectiveID){WriteToDebug("Found Matching index");return i;}}
WriteToDebug("Did not find match, returning count");return intCount;}
function SCORM_FindInteractionIndexFromID(strInteractionID){WriteToDebug("SCORM_FindInteractionIndexFromID - SCORM does not support interaction retrieval, returning null");return null;}
function SCORM_GetInteractionType(strInteractionID)
{WriteToDebug("SCORM_GetInteractionType - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionTimestamp(strInteractionID)
{WriteToDebug("SCORM_GetInteractionTimestamp - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("SCORM_GetInteractionCorrectResponses - SCORM does not support interaction retrieval, returning empty array");return new Array();}
function SCORM_GetInteractionWeighting(strInteractionID)
{WriteToDebug("SCORM_GetInteractionWeighting - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("SCORM_GetInteractionLearnerResponses - SCORM does not support interaction retrieval, returning empty array");return new Array();}
function SCORM_GetInteractionResult(strInteractionID)
{WriteToDebug("SCORM_GetInteractionResult - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionLatency(strInteractionID)
{WriteToDebug("SCORM_GetInteractionDescription - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionDescription(strInteractionID)
{WriteToDebug("SCORM_GetInteractionDescription - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_CreateDataBucket(strBucketId,intMinSize,intMaxSize){WriteToDebug("SCORM_CreateDataBucket - SCORM 1.1 and 1.2 do not support SSP, returning false");return false;}
function SCORM_GetDataFromBucket(strBucketId){WriteToDebug("SCORM_GetDataFromBucket - SCORM 1.1 and 1.2 do not support SSP, returning empty string");return"";}
function SCORM_PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("SCORM_PutDataInBucket - SCORM 1.1 and 1.2 do not support SSP, returning false");return false;}
function SCORM_DetectSSPSupport(){WriteToDebug("SCORM_DetectSSPSupport - SCORM 1.1 and 1.2 do not support SSP, returning false");return false;}
function SCORM_GetBucketInfo(strBucketId){WriteToDebug("AICC_DetectSSPSupport - SCORM 1.1 and 1.2 do not support SSP, returning empty SSPBucketSize");return new SSPBucketSize(0,0);}
function SCORM_SetFailed(){WriteToDebug("In SCORM_SetFailed");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_FAILED);}
function SCORM_SetPassed(){WriteToDebug("In SCORM_SetPassed");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_PASSED);}
function SCORM_SetCompleted(){WriteToDebug("In SCORM_SetPassed");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_COMPLETED);}
function SCORM_ResetStatus(){WriteToDebug("In SCORM_ResetStatus");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_INCOMPLETE);}
function SCORM_GetStatus(){var strStatus;WriteToDebug("In SCORM_GetStatus");SCORM_ClearErrorInfo();strStatus=SCORM_CallLMSGetValue("cmi.core.lesson_status");WriteToDebug("strStatus="+ strStatus);if(strStatus==SCORM_PASSED){WriteToDebug("returning Passed");return LESSON_STATUS_PASSED;}
else if(strStatus==SCORM_FAILED){WriteToDebug("Returning Failed");return LESSON_STATUS_FAILED;}
else if(strStatus==SCORM_COMPLETED){WriteToDebug("Returning Completed");return LESSON_STATUS_COMPLETED;}
else if(strStatus==SCORM_BROWSED){WriteToDebug("Returning Browsed");return LESSON_STATUS_BROWSED;}
else if(strStatus==SCORM_INCOMPLETE){WriteToDebug("Returning Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strStatus==SCORM_NOT_ATTEMPTED){WriteToDebug("Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_STATUS,"Invalid lesson status received from LMS","strStatus="+ strStatus);return null;}}
function SCORM_GetProgressMeasure(){WriteToDebug("SCORM_GetProgressMeasure - SCORM 1.1 and 1.2 do not support progress_measure, returning false");return false;}
function SCORM_SetProgressMeasure(){WriteToDebug("SCORM_SetProgressMeasure - SCORM 1.1 and 1.2 do not support progress_measure, returning false");return false;}
function SCORM_GetObjectiveProgressMeasure(){WriteToDebug("SCORM_GetObjectiveProgressMeasure - SCORM 1.1 and 1.2 do not support progress_measure, returning false");return false;}
function SCORM_SetObjectiveProgressMeasure(){WriteToDebug("SCORM_SetObjectiveProgressMeasure - SCORM 1.1 and 1.2 do not support progress_measure, returning false");return false;}
function SCORM_IsContentInBrowseMode(){var strLessonMode
WriteToDebug("In SCORM_IsContentInBrowseMode");strLessonMode=SCORM_CallLMSGetValue("cmi.core.lesson_mode");WriteToDebug("SCORM_IsContentInBrowseMode,  strLessonMode="+ strLessonMode);if(strLessonMode==SCORM_BROWSE){WriteToDebug("Returning true");return true;}
else{WriteToDebug("Returning false");return false;}}
function SCORM_TranslateExitTypeToSCORM(strExitType){WriteToDebug("In SCORM_TranslatgeExitTypeToSCORM strExitType-"+ strExitType);if(strExitType==EXIT_TYPE_SUSPEND){WriteToDebug("Returning suspend");return SCORM_SUSPEND;}
else if(strExitType==EXIT_TYPE_UNLOAD){WriteToDebug("Returning Exit");return SCORM_NORMAL_EXIT;}
else if(strExitType==EXIT_TYPE_FINISH){WriteToDebug("Returning Logout");return SCORM_NORMAL_EXIT;}
else if(strExitType==EXIT_TYPE_TIMEOUT){WriteToDebug("Returning Timout");return SCORM_TIMEOUT;}}
function SCORM_GetCompletionStatus(){WriteToDebug("In SCORM_GetCompletionStatus");if(SCORM_IsContentInBrowseMode()){WriteToDebug("Returning browsed");return SCORM_BROWSED;}
else{WriteToDebug("Returning Completed");return SCORM_COMPLETED;}}
function SCORM_CallLMSInitialize(){var strResult;WriteToDebug("In SCORM_CallLMSInitialize");SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Calling LMSInitialize");strResult=SCORM_objAPI.LMSInitialize("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM_FALSE){WriteToDebug("Detected failed call to initialize");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSInitialize:");WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM_CallLMSSetValue(strElement,strValue){var strResult;WriteToDebug("SCORM_CallLMSSetValue strElement="+ strElement+", strValue="+ strValue);if(blnReviewModeSoReadOnly===true){WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");return true;}
SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Calling LMSSetValue");strElement=strElement+"";strValue=strValue+"";strResult=SCORM_objAPI.LMSSetValue(strElement,strValue)
strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM_FALSE){WriteToDebug("Detected Failed call to LMSSetvalue");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSSetValue:");WriteToDebug("              strElement="+ strElement);WriteToDebug("              strValue="+ strValue);WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM_CallLMSGetValue(strElement){var strResult
WriteToDebug("In SCORM_CallLMSGetValue strElement="+ strElement);SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Call LMSGetValue");strElement=strElement+"";strResult=SCORM_objAPI.LMSGetValue(strElement)+""
WriteToDebug("strResult="+ strResult);intSCORMError=SCORM_objAPI.LMSGetLastError()
intSCORMError=intSCORMError+"";WriteToDebug("intSCORMError="+ intSCORMError);if(intSCORMError!=SCORM_NO_ERROR){WriteToDebug("Detected failed called to LMSGetValue");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSGetValue:");WriteToDebug("              strElement="+ strElement);WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);}
WriteToDebug("Returning "+ strResult);return strResult;}
function SCORM_CallLMSCommit(){var strResult;WriteToDebug("In SCORM_CallLMSCommit");SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Calling LMSCommit");strResult=SCORM_objAPI.LMSCommit("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM_FALSE){WriteToDebug("Detected failed call to LMSCommit");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSCommit:");WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM_CallLMSFinish(){var strResult;WriteToDebug("In SCORM_CallLMSFinish");SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Calling LMS Finish");strResult=SCORM_objAPI.LMSFinish("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM_FALSE){WriteToDebug("Detected failed call to LMSFinish");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSFinish:");WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);return false;}
WriteToDebug("Returning True");return true;}
function SCORM_ClearErrorInfo(){WriteToDebug("In SCORM_ClearErrorInfo");intSCORMError=SCORM_NO_ERROR;strSCORMErrorString="";strSCORMErrorDiagnostic="";}
function SCORM_SetErrorInfo(){WriteToDebug("In SCORM_SetErrorInfo");intSCORMError=SCORM_objAPI.LMSGetLastError();strSCORMErrorString=SCORM_objAPI.LMSGetErrorString(intSCORMError);strSCORMErrorDiagnostic=SCORM_objAPI.LMSGetDiagnostic("");intSCORMError=intSCORMError+"";strSCORMErrorString=strSCORMErrorString+"";strSCORMErrorDiagnostic=strSCORMErrorDiagnostic+"";WriteToDebug("intSCORMError="+ intSCORMError);WriteToDebug("strSCORMErrorString="+ strSCORMErrorString);WriteToDebug("strSCORMErrorDiagnostic="+ strSCORMErrorDiagnostic);}
function SCORM_SetErrorInfoManually(intNum,strString,strDiagnostic){WriteToDebug("In SCORM_SetErrorInfoManually");WriteToDebug("ERROR-Num="+ intNum);WriteToDebug("      String="+ strString);WriteToDebug("      Diag="+ strDiagnostic);intSCORMError=intNum;strSCORMErrorString=strString;strSCORMErrorDiagnostic=strDiagnostic;}
function SCORM_GetLastError(){WriteToDebug("In SCORM_GetLastError");if(intSCORMError==SCORM_NO_ERROR){WriteToDebug("Returning No Error");return NO_ERROR;}
else{WriteToDebug("Returning "+ intSCORMError);return intSCORMError;}}
function SCORM_GetLastErrorDesc(){WriteToDebug("In SCORM_GetLastErrorDesc, "+ strSCORMErrorString+"\n"+ strSCORMErrorDiagnostic);return strSCORMErrorString+"\n"+ strSCORMErrorDiagnostic;}
function SCORM_GrabAPI(){WriteToDebug("In SCORM_GrabAPI");if(typeof(SCORM_objAPI)=="undefined"||SCORM_objAPI==null){WriteToDebug("Searching with improved ADL algorithm");SCORM_objAPI=SCORM_GetAPI();}
if(typeof(SCORM_objAPI)=="undefined"||SCORM_objAPI==null){SCORM_objAPI=SCORM_SearchForAPI(window);}
WriteToDebug("SCORM_GrabAPI, returning");return SCORM_objAPI;}
function SCORM_SearchForAPI(wndLookIn){WriteToDebug("SCORM_SearchForAPI");var objAPITemp=null;var strDebugID="";strDebugID="Name="+ wndLookIn.name+", href="+ wndLookIn.location.href
objAPITemp=wndLookIn.API;if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in this window - "+ strDebugID);return objAPITemp;}
if(SCORM_WindowHasParent(wndLookIn)){WriteToDebug("Searching Parent - "+ strDebugID);objAPITemp=SCORM_SearchForAPI(wndLookIn.parent);}
if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in a parent - "+ strDebugID);return objAPITemp;}
if(SCORM_WindowHasOpener(wndLookIn)){WriteToDebug("Searching Opener - "+ strDebugID);objAPITemp=SCORM_SearchForAPI(wndLookIn.opener);}
if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in an opener - "+ strDebugID);return objAPITemp;}
WriteToDebug("Looking in children - "+ strDebugID);objAPITemp=SCORM_LookInChildren(wndLookIn);if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in Children - "+ strDebugID);return objAPITemp;}
WriteToDebug("Didn't find API in this window - "+ strDebugID);return null;}
function SCORM_LookInChildren(wnd){WriteToDebug("SCORM_LookInChildren");var objAPITemp=null;var strDebugID="";strDebugID="Name="+ wnd.name+", href="+ wnd.location.href
for(var i=0;i&lt;wnd.frames.length;i++){WriteToDebug("Looking in child frame "+ i);objAPITemp=wnd.frames[i].API;if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in child frame of "+ strDebugID);return objAPITemp;}
WriteToDebug("Looking in this child's children "+ strDebugID);objAPITemp=SCORM_LookInChildren(wnd.frames[i]);if(SCORM_APIFound(objAPITemp)){WriteToDebug("API found in this child's children "+ strDebugID);return objAPITemp;}}
return null;}
function SCORM_WindowHasOpener(wnd){WriteToDebug("In SCORM_WindowHasOpener");if((wnd.opener!=null)&amp;&amp;(wnd.opener!=wnd)&amp;&amp;(typeof(wnd.opener)!="undefined")){WriteToDebug("Window Does Have Opener");return true;}
else{WriteToDebug("Window Does Not Have Opener");return false;}}
function SCORM_WindowHasParent(wnd){WriteToDebug("In SCORM_WindowHasParent");if((wnd.parent!=null)&amp;&amp;(wnd.parent!=wnd)&amp;&amp;(typeof(wnd.parent)!="undefined")){WriteToDebug("Window Does Have Parent");return true;}
else{WriteToDebug("Window Does Not Have Parent");return false;}}
function SCORM_APIFound(obj){WriteToDebug("In SCORM_APIFound");if(obj==null||typeof(obj)=="undefined"){WriteToDebug("API NOT Found");return false;}
else{WriteToDebug("API Found");return true;}}
function SCORM_ScanParentsForApi(win)
{WriteToDebug("In SCORM_ScanParentsForApi, win="+ win.location);var MAX_PARENTS_TO_SEARCH=500;var nParentsSearched=0;while((win.API==null||win.API===undefined)&amp;&amp;(win.parent!=null)&amp;&amp;(win.parent!=win)&amp;&amp;(nParentsSearched&lt;=MAX_PARENTS_TO_SEARCH))
{nParentsSearched++;win=win.parent;}
return win.API;}
function SCORM_GetAPI()
{WriteToDebug("In SCORM_GetAPI");var API=null;if((window.parent!=null)&amp;&amp;(window.parent!=window))
{WriteToDebug("SCORM_GetAPI, searching parent");API=SCORM_ScanParentsForApi(window.parent);}
if((API==null)&amp;&amp;(window.top.opener!=null))
{WriteToDebug("SCORM_GetAPI, searching opener");API=SCORM_ScanParentsForApi(window.top.opener);}
return API;}</text>
				</content>
				<redirectionURL/>
				<headersSize>288</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/AICCFunctions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>372</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="AICCFunctions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var blnDirtyAICCData=false;var blnCommitSavedData=false;var intAICCErrorNum=NO_ERROR;var strAICCErrorDesc="";var aryAICCFoundItems=new Array();var blnUseLongInteractionResultValues=true;var blnReviewModeSoReadOnly=false;var AICC_LMS_Version="";var AICC_Student_ID="";var AICC_Student_Name="";var AICC_Lesson_Location="";var AICC_Score="";var AICC_Credit="";var AICC_Lesson_Status="";var AICC_Time="";var AICC_Mastery_Score="";var AICC_Lesson_Mode="";var AICC_Max_Time_Allowed="";var AICC_Time_Limit_Action="";var AICC_Audio="";var AICC_Speed="";var AICC_Language="";var AICC_Text="";var AICC_Launch_Data="";var AICC_Data_Chunk="";var AICC_Comments="";var AICC_Objectives=null;var AICC_CourseID="";var AICC_fltScoreRaw="";var AICC_fltScoreMax="";var AICC_fltScoreMin="";var AICC_blnCredit=true;var AICC_strLessonMode=MODE_NORMAL;var AICC_intPreviouslyAccumulatedMilliseconds=0;var AICC_intMaxTimeAllowedMilliseconds=MAX_CMI_TIME;var AICC_blnExitOnTimeout=false;var AICC_blnShowMessageOnTimeout=true;var AICC_TextPreference=PREFERENCE_DEFAULT;var AICC_Status=LESSON_STATUS_NOT_ATTEMPTED;var AICC_Entry=AICC_ENTRY_FLAG_DEFAULT;var AICC_AudioPlayPreference=PREFERENCE_DEFAULT;var AICC_intAudioVolume=100;var AICC_intPercentOfMaxSpeed=100;var AICC_intSessionTimeMilliseconds=0;var AICC_aryObjectivesRead=new Array();var AICC_aryObjectivesWrite=new Array();var AICC_aryCommentsFromLearner=new Array();var AICC_aryInteractions=new Array();var AICC_OBJ_ARRAY_ID=0;var AICC_OBJ_ARRAY_SCORE=1;var AICC_OBJ_ARRAY_STATUS=2;var AICC_INTERACTIONS_ID=0;var AICC_INTERACTIONS_RESPONSE=1;var AICC_INTERACTIONS_CORRECT=2;var AICC_INTERACTIONS_CORRECT_RESPONSE=3;var AICC_INTERACTIONS_TIME_STAMP=4;var AICC_INTERACTIONS_TYPE=5;var AICC_INTERACTIONS_WEIGHTING=6;var AICC_INTERACTIONS_LATENCY=7;var AICC_INTERACTIONS_RESPONSE_LONG=8;var AICC_INTERACTIONS_CORRECT_RESPONSE_LONG=9;var AICC_INTERACTION_TYPE_TRUE_FALSE="T";var AICC_INTERACTION_TYPE_CHOICE="C";var AICC_INTERACTION_TYPE_FILL_IN="F";var AICC_INTERACTION_TYPE_MATCHING="M";var AICC_INTERACTION_TYPE_PERFORMANCE="P";var AICC_INTERACTION_TYPE_SEQUENCING="S";var AICC_INTERACTION_TYPE_LIKERT="L";var AICC_INTERACTION_TYPE_NUMERIC="N";var AICC_RESULT_CORRECT="C";var AICC_RESULT_WRONG="W";var AICC_RESULT_UNANTICIPATED="U";var AICC_RESULT_NEUTRAL="N";var AICC_NO_ERROR="0";var AICC_ERROR_INVALID_PREFERENCE="-1";var AICC_ERROR_INVALID_STATUS="-2";var AICC_ERROR_INVALID_SPEED="-3";var AICC_ERROR_INVALID_TIMESPAN="-4";var AICC_ERROR_INVALID_TIME_LIMIT_ACTION="-5";var AICC_ERROR_INVALID_DECIMAL="-6";var AICC_ERROR_INVALID_CREDIT="-7";var AICC_ERROR_INVALID_LESSON_MODE="-8";var AICC_ERROR_INVALID_ENTRY="-9";var blnReviewModeSoReadOnly=false;function AICC_Initialize(){WriteToDebug("In AICC_Initialize");window.AICCComm.MakeGetParamRequest();return;}
function AICC_Finish(strExitType,blnStatusWasSet){WriteToDebug("In AICC_Finish, strExitType="+ strExitType+", blnStatusWasSet="+ blnStatusWasSet);if(!blnStatusWasSet){if((strExitType==EXIT_TYPE_FINISH)){WriteToDebug("Setting status to complete");AICC_Status=LESSON_STATUS_COMPLETED;}
else{WriteToDebug("Setting status to incomplete");AICC_Status=LESSON_STATUS_INCOMPLETE;}}
AICC_CommitData();if(blnCommitSavedData==true){KillTime();}
window.AICCComm.MakeExitAURequest();return true;}
function AICC_CommitData(){var strAICCData;WriteToDebug("In AICC_CommitData");if(blnReviewModeSoReadOnly===true){WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");return true;}
blnCommitSavedData=false;if(IsThereDirtyAICCData()){blnCommitSavedData=true;WriteToDebug("Found Dirty Data");strAICCData=FormAICCPostData();window.AICCComm.MakePutParamRequest(strAICCData);if(AICC_aryInteractions.length&gt;0){WriteToDebug("Saving Interactions");KillTime();AICC_SendInteractions();}
ClearDirtyAICCData();}
return true;}
function KillTime(){WriteToDebug("In KillTime");if(USE_AICC_KILL_TIME===false){WriteToDebug("Configuration disallows use of KillTime, exiting");return;}
var start=new Date();if(window.AICCComm.blnCanUseXMLHTTP==false){if(window.AICCComm.blnXMLHTTPIsAvailable==true){var numBlankRequests=3;for(var i=0;i&lt;numBlankRequests;i++){window.AICCComm.GetBlankHtmlPage(i);}}
else{window.NothingFrame.document.open();var numLoops=1000;for(var i=0;i&lt;numLoops;i++){window.NothingFrame.document.write("waiting");}
window.NothingFrame.document.close();}}
var end=new Date();WriteToDebug("Killed "+(end- start)+"milliseconds.");}
function AICC_SendInteractions(){WriteToDebug("In AICC_SendInteractions.");if(blnReviewModeSoReadOnly===true){WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");return true;}
var strAICCData=FormAICCInteractionsData();window.AICCComm.MakePutInteractionsRequest(strAICCData);}
function AICC_GetStudentID(){WriteToDebug("In AICC_GetStudentID, Returning "+ AICC_Student_ID);return AICC_Student_ID;}
function AICC_GetStudentName(){WriteToDebug("In AICC_GetStudentName, Returning "+ AICC_Student_Name);return AICC_Student_Name;}
function AICC_GetBookmark(){WriteToDebug("In AICC_GetBookmark, Returning "+ AICC_Lesson_Location);return AICC_Lesson_Location;}
function AICC_SetBookmark(strBookmark){WriteToDebug("In AICC_SetBookmark, strBookmark="+ strBookmark);SetDirtyAICCData();AICC_Lesson_Location=strBookmark;return true;}
function AICC_GetDataChunk(){WriteToDebug("In AICC_GetDataChunk, Returning "+ AICC_Data_Chunk);return AICC_Data_Chunk;}
function AICC_SetDataChunk(strData){WriteToDebug("In AICC_SetDataChunk, strData="+ strData);SetDirtyAICCData();AICC_Data_Chunk=strData;return true;}
function AICC_GetLaunchData(){WriteToDebug("In AICC_GetLaunchData, Returning "+ AICC_Launch_Data);return AICC_Launch_Data;}
function AICC_GetComments(){WriteToDebug("In AICC_GetComments, Returning "+ AICC_aryCommentsFromLearner.join(" | "));return AICC_aryCommentsFromLearner.join(" | ");}
function AICC_WriteComment(strComment){WriteToDebug("In AICC_WriteComment, strComment="+ strComment);var intNextIndex;if(strComment.search(/ \| /)==0){strComment=strComment.substr(3);}
strComment.replace(/\|\|/g,"|")
intNextIndex=AICC_aryCommentsFromLearner.length;WriteToDebug("Adding comment to array");AICC_aryCommentsFromLearner[intNextIndex]=strComment;SetDirtyAICCData();return true;}
function AICC_GetLMSComments(){WriteToDebug("In AICC_GetLMSComments, Returning "+ AICC_Comments);return AICC_Comments;}
function AICC_GetAudioPlayPreference(){WriteToDebug("In AICC_GetAudioPlayPreference, Returning "+ AICC_AudioPlayPreference);return AICC_AudioPlayPreference;}
function AICC_GetAudioVolumePreference(){WriteToDebug("In AICC_GetAudioVolumePreference, Returning "+ AICC_intAudioVolume);return AICC_intAudioVolume;}
function AICC_SetAudioPreference(PlayPreference,intPercentOfMaxVolume){WriteToDebug("In AICC_SetAudioPreference, Returning true");AICC_AudioPlayPreference=PlayPreference;AICC_intAudioVolume=intPercentOfMaxVolume;SetDirtyAICCData();return true;}
function AICC_SetLanguagePreference(strLanguage){WriteToDebug("In AICC_SetLanguagePreference, Returning true");SetDirtyAICCData();AICC_Language=strLanguage;return true;}
function AICC_GetLanguagePreference(){WriteToDebug("In AICC_GetLanguagePreference, Returning "+ AICC_Language);return AICC_Language;}
function AICC_SetSpeedPreference(intPercentOfMax){WriteToDebug("In AICC_SetSpeedPreference, Returning true");AICC_intPercentOfMaxSpeed=intPercentOfMax;SetDirtyAICCData();return true;}
function AICC_GetSpeedPreference(){WriteToDebug("In AICC_GetSpeedPreference, Returning "+ AICC_intPercentOfMaxSpeed);return AICC_intPercentOfMaxSpeed;}
function AICC_SetTextPreference(intPreference){WriteToDebug("In AICC_SetTextPreference, Returning true");AICC_TextPreference=intPreference;SetDirtyAICCData();return true;}
function AICC_GetTextPreference(){WriteToDebug("In AICC_GetTextPreference, Returning "+ AICC_TextPreference);return AICC_TextPreference;}
function AICC_GetPreviouslyAccumulatedTime(){WriteToDebug("In AICC_GetPreviouslyAccumulatedTime, Returning "+ AICC_intPreviouslyAccumulatedMilliseconds);return AICC_intPreviouslyAccumulatedMilliseconds;}
function AICC_SaveTime(intMilliSeconds){WriteToDebug("In intMilliSeconds, Returning true");AICC_intSessionTimeMilliseconds=intMilliSeconds;SetDirtyAICCData();return true;}
function AICC_GetMaxTimeAllowed(){WriteToDebug("In AICC_GetMaxTimeAllowed, Returning "+ AICC_intMaxTimeAllowedMilliseconds);return AICC_intMaxTimeAllowedMilliseconds;}
function AICC_DisplayMessageOnTimeout(){WriteToDebug("In AICC_DisplayMessageOnTimeout, Returning "+ AICC_blnShowMessageOnTimeout);return AICC_blnShowMessageOnTimeout;}
function AICC_ExitOnTimeout(){WriteToDebug("In AICC_ExitOnTimeout, Returning "+ AICC_blnExitOnTimeout);return AICC_blnExitOnTimeout;}
function AICC_GetPassingScore(){WriteToDebug("In AICC_GetPassingScore, Returning "+ AICC_Mastery_Score);return AICC_Mastery_Score;}
function AICC_GetScore(){WriteToDebug("In AICC_GetScore, Returning "+ AICC_fltScoreRaw);return AICC_fltScoreRaw;}
function AICC_SetScore(fltScore,fltMaxScore,fltMinScore){WriteToDebug("In AICC_SetScore, fltScore="+ fltScore+", fltMaxScore="+ fltMaxScore+", fltMinScore="+ fltMinScore);AICC_fltScoreRaw=fltScore;AICC_fltScoreMax=fltMaxScore;AICC_fltScoreMin=fltMinScore;SetDirtyAICCData();return true;}
function AICC_RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordTrueFalseInteraction strID="+ strID+", blnResponse="+ blnResponse+", blnCorrect="+ blnCorrect+", blnCorrectResponse="+ blnCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse="";var strCorrectResponse="";if(blnResponse){strResponse="t";}
else{strResponse="f";}
if(blnCorrectResponse==true){strCorrectResponse="t";}
else if(blnCorrectResponse==false){strCorrectResponse="f";}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_TRUE_FALSE;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponse;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponse;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordMultipleChoiceInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordMultipleChoiceInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Short.replace(",","");strResponseLong+=aryResponse[i].Long.replace(",","");}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Short.replace(",","");strCorrectResponseLong+=aryCorrectResponse[i].Long.replace(",","");}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_CHOICE;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponseLong;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponseLong;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordFillInInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
if(strCorrectResponse==null||strCorrectResponse==undefined){strCorrectResponse="";}
strResponse=new String(strResponse);if(strResponse.length&gt;255){strResponse=strResponse.substr(0,255);}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;255){strCorrectResponse=strCorrectResponse.substr(0,255);}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_FILL_IN;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponse;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponse;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordMatchingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordMatchingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Source.Short.replace(",","").replace(".","")+"."+ aryResponse[i].Target.Short.replace(",","").replace(".","");strResponseLong+=aryResponse[i].Source.Long.replace(",","").replace(".","")+"."+ aryResponse[i].Target.Long.replace(",","").replace(".","");}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
if(aryCorrectResponse[i].Source.Short!=""&amp;&amp;aryCorrectResponse[i].Source.Long!=""){strCorrectResponse+=aryCorrectResponse[i].Source.Short.replace(",","").replace(".","")+"."+ aryCorrectResponse[i].Target.Short.replace(",","").replace(".","");strCorrectResponseLong+=aryCorrectResponse[i].Source.Long.replace(",","").replace(".","")+"."+ aryCorrectResponse[i].Target.Long.replace(",","").replace(".","");}}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_MATCHING;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponseLong;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponseLong;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordPerformanceInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
if(strCorrectResponse==null||strCorrectResponse==undefined){strCorrectResponse="";}
strResponse=new String(strResponse);if(strResponse.length&gt;255){strResponse=strResponse.substr(0,255);}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;255){strCorrectResponse=strCorrectResponse.substr(0,255);}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_PERFORMANCE;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponse;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponse;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordSequencingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordSequencingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Short.replace(",","");strResponseLong+=aryResponse[i].Long.replace(",","");}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Short.replace(",","");strCorrectResponseLong+=aryCorrectResponse[i].Long.replace(",","");}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_SEQUENCING;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponseLong;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponseLong;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordLikertInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In RecordLikertInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse=response.Short;var strResponseLong=response.Long;var strCorrectResponse="";var strCorrectResponseLong="";if(correctResponse!=null){strCorrectResponse=correctResponse.Short;strCorrectResponseLong=correctResponse.Long;}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_LIKERT;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponseLong;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponseLong;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordNumericInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
if(strCorrectResponse==null||strCorrectResponse==undefined){strCorrectResponse="";}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_NUMERIC;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponse;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponse;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_GetEntryMode(){WriteToDebug("In AICC_GetEntryMode, Returning "+ AICC_Entry);return AICC_Entry;}
function AICC_GetLessonMode(){WriteToDebug("In AICC_GetLessonMode, Returning "+ AICC_strLessonMode);return AICC_strLessonMode;}
function AICC_GetTakingForCredit(){WriteToDebug("In AICC_GetTakingForCredit, Returning "+ AICC_blnCredit);return AICC_blnCredit;}
function AICC_SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){WriteToDebug("In AICC_SetObjectiveScore, strObjectiveID="+ strObjectiveID+", intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);var intNextID;var intObjIndex;var strAICCScore="";intObjIndex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesRead);if(intObjIndex!=null){WriteToDebug("Found read objective");AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_SCORE]=intScore;}
else{WriteToDebug("Adding new read objective");intNextID=AICC_aryObjectivesRead.length;AICC_aryObjectivesRead[parseInt(intNextID,10)]=new Array(3);AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_ID]=strObjectiveID;AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_SCORE]=intScore;AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_STATUS]="";}
intObjIndex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesWrite);if(intObjIndex!=null){WriteToDebug("Found write objective");AICC_aryObjectivesWrite[intObjIndex][AICC_OBJ_ARRAY_SCORE]=intScore;}
else{WriteToDebug("Adding new write objective");intNextID=AICC_aryObjectivesWrite.length;AICC_aryObjectivesWrite[parseInt(intNextID,10)]=new Array(3);strAICCScore=intScore;if(AICC_LMS_Version&lt;3&amp;&amp;strAICCScore!=""){strAICCScore=parseInt(strAICCScore,10);}
if((AICC_REPORT_MIN_MAX_SCORE===undefined||AICC_REPORT_MIN_MAX_SCORE===null||AICC_REPORT_MIN_MAX_SCORE===true)&amp;&amp;(AICC_LMS_Version&gt;=3)){if((intMaxScore!="")||(intMinScore!="")){WriteToDebug("Appending Max and Min scores");strAICCScore+=","+ intMaxScore+","+ intMinScore;}}
AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_ID]=strObjectiveID;AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_SCORE]=strAICCScore;AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_STATUS]="";}
SetDirtyAICCData();return true;}
function AICC_SetObjectiveStatus(strObjectiveID,Lesson_Status){WriteToDebug("In AICC_SetObjectiveStatus, strObjectiveID="+ strObjectiveID+", Lesson_Status="+ Lesson_Status);var intNextID;var intObjIdex;intObjIdex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesRead);if(intObjIdex!=null){WriteToDebug("Found read objective");AICC_aryObjectivesRead[intObjIdex][AICC_OBJ_ARRAY_STATUS]=Lesson_Status;}
else{WriteToDebug("Adding new read objective");intNextID=AICC_aryObjectivesRead.length;AICC_aryObjectivesRead[parseInt(intNextID,10)]=new Array(3);AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_ID]=strObjectiveID;AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_STATUS]=Lesson_Status;AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_SCORE]="";}
intObjIdex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesWrite);if(intObjIdex!=null){WriteToDebug("Found write objective");AICC_aryObjectivesWrite[intObjIdex][AICC_OBJ_ARRAY_STATUS]=Lesson_Status;}
else{WriteToDebug("Adding new write objective");intNextID=AICC_aryObjectivesWrite.length;AICC_aryObjectivesWrite[parseInt(intNextID,10)]=new Array(3);AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_ID]=strObjectiveID;AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_STATUS]=Lesson_Status;AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_SCORE]="";}
SetDirtyAICCData();return true;}
function AICC_SetObjectiveDescription(strObjectiveID,strObjectiveDescription){WriteToDebug("In AICC_SetObjectiveDescription, strObjectiveID="+ strObjectiveID+", strObjectiveDescription="+ strObjectiveDescription);WriteToDebug("Objective descriptions are not supported prior to SCORM 2004");return true;}
function AICC_GetObjectiveScore(strObjectiveID){WriteToDebug("In AICC_SetObjectiveScore, strObjectiveID="+ strObjectiveID);var intObjIndex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesRead)
if(intObjIndex!=null){WriteToDebug("Found objective, returning "+ AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_SCORE]);return AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_SCORE];}
else{WriteToDebug("Did not find objective, returning ''");return"";}}
function AICC_GetObjectiveDescription(strObjectiveID){WriteToDebug("In AICC_GetObjectiveDescription, strObjectiveID="+ strObjectiveID);WriteToDebug("Objective descriptions are not supported prior to SCORM 2004");return"";}
function AICC_GetObjectiveStatus(strObjectiveID){WriteToDebug("In AICC_SetObjectiveStatus, strObjectiveID="+ strObjectiveID);var intObjIndex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesRead)
if(intObjIndex!=null){WriteToDebug("Found objective, returning "+ AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_STATUS]);return AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_STATUS];}
else{WriteToDebug("Did not find objective, returning "+ LESSON_STATUS_NOT_ATTEMPTED);return LESSON_STATUS_NOT_ATTEMPTED;}}
function AICC_SetFailed(){WriteToDebug("In AICC_SetFailed, Returning true");AICC_Status=LESSON_STATUS_FAILED;SetDirtyAICCData();return true;}
function AICC_SetPassed(){WriteToDebug("In AICC_SetPassed, Returning true");AICC_Status=LESSON_STATUS_PASSED;SetDirtyAICCData();return true;}
function AICC_SetCompleted(){WriteToDebug("In AICC_SetCompleted, Returning true");AICC_Status=LESSON_STATUS_COMPLETED;SetDirtyAICCData();return true;}
function AICC_ResetStatus(){WriteToDebug("In AICC_ResetStatus, Returning true");AICC_Status=LESSON_STATUS_INCOMPLETE;SetDirtyAICCData();return true;}
function AICC_GetStatus(){WriteToDebug("In AICC_GetStatus, Returning "+ AICC_Status);return AICC_Status;}
function AICC_GetProgressMeasure(){WriteToDebug("AICC_GetProgressMeasure - AICC does not support progress_measure, returning false");return false;}
function AICC_SetProgressMeasure(){WriteToDebug("AICC_SetProgressMeasure - AICC does not support progress_measure, returning false");return false;}
function AICC_GetObjectiveProgressMeasure(){WriteToDebug("AICC_GetObjectiveProgressMeasure - AICC does not support progress_measure, returning false");return false;}
function AICC_SetObjectiveProgressMeasure(){WriteToDebug("AICC_SetObjectiveProgressMeasure - AICC does not support progress_measure, returning false");return false;}
function AICC_SetPointBasedScore(intScore,intMaxScore,intMinScore){WriteToDebug("AICC_SetPointBasedScore - AICC does not support SetPointBasedScore, returning false");return false;}
function AICC_GetScaledScore(intScore,intMaxScore,intMinScore){WriteToDebug("AICC_GetScaledScore - AICC does not support GetScaledScore, returning false");return false;}
function AICC_GetLastError(){WriteToDebug("In AICC_GetLastError, Returning "+ intAICCErrorNum);return intAICCErrorNum;}
function AICC_GetLastErrorDesc(){WriteToDebug("In AICC_GetLastErrorDesc, Returning '"+ strAICCErrorDesc+"'");return strAICCErrorDesc;}
function AICC_PutParamFailed(){WriteToDebug("ERROR: In AICC_PutParamFailed");SetDirtyAICCData();return;}
function AICC_PutInteractionsFailed(){WriteToDebug("ERROR: In AICC_PutInteractionsFailed");SetDirtyAICCData();if(parent.blnUseLongInteractionResultValues==true){parent.blnUseLongInteractionResultValues=false;parent.AICC_CommitData();}
return;}
function AICC_SetErrorInfo(strErrorNumLine,strErrorDescLine){WriteToDebug("ERROR: In AICC_SetErrorInfo, strErrorNumLine="+ strErrorNumLine+", strErrorDescLine="+ strErrorDescLine);if(strErrorNumLine.toLowerCase().search(/error\s*=\s*0/)==-1){WriteToDebug("Detected No Error");intAICCErrorNum=NO_ERROR;strAICCErrorDesc="";}
else{WriteToDebug("Setting Error Info");AICC_SetError(GetValueFromAICCLine(strAICCErrorLine),GetValueFromAICCLine(strAICCErrorDesc))}}
function AICC_SetError(intErrorNum,strErrorDesc){WriteToDebug("ERROR: In AICC_SetError, intErrorNum="+ intErrorNum+", strErrorDesc="+ strErrorDesc);intAICCErrorNum=intErrorNum;strAICCErrorDesc=strAICCErrorDesc;}
function SetDirtyAICCData(){WriteToDebug("In SetDirtyAICCData");blnDirtyAICCData=true;}
function ClearDirtyAICCData(){WriteToDebug("In ClearDirtyAICCData");blnDirtyAICCData=false;}
function IsThereDirtyAICCData(){WriteToDebug("In IsThereDirtyAICCData, returning "+ blnDirtyAICCData);return blnDirtyAICCData;}
function GetValueFromAICCLine(strLine){WriteToDebug("In GetValueFromAICCLine, strLine="+ strLine);var intPos;var strValue="";var strTemp;strLine=new String(strLine);intPos=strLine.indexOf("=");WriteToDebug("intPos="+ intPos);if(intPos&gt;-1&amp;&amp;((intPos+ 1)&lt;strLine.length)){WriteToDebug("Grabbing value");strTemp=strLine.substring(intPos+1);WriteToDebug("strTemp="+ strTemp);strTemp=strTemp.replace(/^\s*/,"");strTemp=strTemp.replace(/\s*$/,"");strValue=strTemp;}
WriteToDebug("returning "+ strValue);return strValue;}
function GetNameFromAICCLine(strLine){WriteToDebug("In GetNameFromAICCLine, strLine="+ strLine);var intPos;var strTemp;var strName="";strLine=new String(strLine);intPos=strLine.indexOf("=");WriteToDebug("intPos="+ intPos);if(intPos&gt;-1&amp;&amp;intPos&lt;strLine.length){WriteToDebug("Grabbing name from name/value pair");strTemp=strLine.substring(0,intPos);WriteToDebug("strTemp="+ strTemp);strTemp=strTemp.replace(/^\s*/,"");strTemp=strTemp.replace(/\s*$/,"");strName=strTemp;}
else{WriteToDebug("Grabbing name from group / section heading");intPos=strLine.indexOf("[");WriteToDebug("intPos="+ intPos);if(intPos&gt;-1){WriteToDebug("Replacing []");strTemp=strLine.replace(/[\[|\]]/g,"");WriteToDebug("strTemp="+ strTemp);strTemp=strTemp.replace(/^\s*/,"");strTemp=strTemp.replace(/\s*$/,"");strName=strTemp;}}
WriteToDebug("returning "+ strName);return strName;}
function GetIndexFromAICCName(strLineName){WriteToDebug("In GetIndexFromAICCName, strLineName="+ strLineName);var intPos;var strIndex="";var strTemp="";strLine=new String(strLineName);intPos=strLine.indexOf(".");WriteToDebug("intPos="+ intPos);if(intPos&gt;-1&amp;&amp;(intPos+1)&lt;strLine.length){WriteToDebug("Grabbing index");strTemp=strLine.substring(intPos+ 1);WriteToDebug("strTemp="+ strTemp);WriteToDebug("Checking for equal sign");intPos=strTemp.indexOf("=");if(intPos&gt;-1&amp;&amp;intPos&lt;strTemp.length){WriteToDebug("Found and removing equal sign");strTemp=strLine.substring(0,intPos);}
WriteToDebug("Removing white space");strTemp=strTemp.replace(/^\s*/,"");strTemp=strTemp.replace(/\s*$/,"");strIndex=strTemp;}
WriteToDebug("returning "+ strIndex);return strIndex;}
function ParseGetParamData(strLMSResult){WriteToDebug("In ParseGetParamData");var aryAICCResponseLines;var strLine;var strLineName;var strLineValue;var i,j;strLMSResult=new String(strLMSResult);aryAICCResponseLines=strLMSResult.split("\n");WriteToDebug("Split String");for(i=0;i&lt;aryAICCResponseLines.length;i++){WriteToDebug("Processing Line #"+ i+": "+ aryAICCResponseLines[i]);strLine=aryAICCResponseLines[i];strLineName="";strLineValue="";if(strLine.length&gt;0){WriteToDebug("Found non-zero length string");if(strLine.charAt(0)=="\r"){WriteToDebug("Detected leading \\r");strLine=strLine.substr(1);}
if(strLine.charAt(strLine.length- 1)=="\r"){WriteToDebug("Detected trailing \\r");strLine=strLine.substr(0,strLine.length- 1);}
if(strLine.charAt(0)!=";"){WriteToDebug("Found non-comment line");strLineName=GetNameFromAICCLine(strLine);strLineValue=GetValueFromAICCLine(strLine);WriteToDebug("strLineName="+ strLineName+", strLineValue="+ strLineValue);}}
strLineName=strLineName.toLowerCase();if(!AICC_HasItemBeenFound(strLineName)){WriteToDebug("Detected an un-found item");AICC_FoundItem(strLineName);switch(strLineName){case"version":WriteToDebug("Item is version");var tempVersion=parseFloat(strLineValue);if(isNaN(tempVersion)){tempVersion=0;}
AICC_LMS_Version=tempVersion;break;case"student_id":WriteToDebug("Item is student_id");AICC_Student_ID=strLineValue;break;case"student_name":WriteToDebug("Item is student_name");AICC_Student_Name=strLineValue;break;case"lesson_location":WriteToDebug("Item is lesson_location");AICC_Lesson_Location=strLineValue;break;case"score":WriteToDebug("Item is score");AICC_Score=strLineValue;AICC_SeperateScoreValues(AICC_Score);break;case"credit":WriteToDebug("Item is credit");AICC_Credit=strLineValue;AICC_TranslateCredit(AICC_Credit);break;case"lesson_status":WriteToDebug("Item is lesson_status");AICC_Lesson_Status=strLineValue;AICC_TranslateLessonStatus(AICC_Lesson_Status);break;case"time":WriteToDebug("Item is time");AICC_Time=strLineValue;AICC_TranslateTimeToMilliseconds(AICC_Time);break;case"mastery_score":WriteToDebug("Item is mastery_score");AICC_Mastery_Score=strLineValue;AICC_ValidateMasteryScore(AICC_Mastery_Score);break;case"lesson_mode":WriteToDebug("Item is lesson_mode");AICC_Lesson_Mode=strLineValue;AICC_TranslateLessonMode(AICC_Lesson_Mode);break;case"max_time_allowed":WriteToDebug("Item is max_time_allowed");AICC_Max_Time_Allowed=strLineValue;AICC_TranslateMaxTimeToMilliseconds(AICC_Max_Time_Allowed);break;case"time_limit_action":WriteToDebug("Item is time_limit_action");AICC_Time_Limit_Action=strLineValue;AICC_TranslateTimeLimitAction(AICC_Time_Limit_Action);break;case"audio":WriteToDebug("Item is audio");AICC_Audio=strLineValue;AICC_TranslateAudio(AICC_Audio);break;case"speed":WriteToDebug("Item is speed");AICC_Speed=strLineValue;AICC_TranslateSpeed(AICC_Speed);break;case"language":WriteToDebug("Item is language");AICC_Language=strLineValue;break;case"text":WriteToDebug("Item is text");AICC_Text=strLineValue;AICC_TranslateTextPreference(AICC_Text);break;case"course_id":WriteToDebug("Item is course id");AICC_CourseID=strLineValue;break;case"core_vendor":WriteToDebug("Item is core_vendor");AICC_Launch_Data="";strLine="";j=1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}
while(((i+j)&lt;aryAICCResponseLines.length)&amp;&amp;(!IsGroupIdentifier(strLine))){if(strLine.charAt(0)!=";"){AICC_Launch_Data+=strLine+"\n";}
j=j+ 1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}}
i=i+ j- 1
AICC_Launch_Data=AICC_Launch_Data.replace(/\s*$/,"");break;case"core_lesson":WriteToDebug("Item is core_lesson");AICC_Data_Chunk="";strLine="";j=1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}
while(((i+j)&lt;aryAICCResponseLines.length)&amp;&amp;(!IsGroupIdentifier(strLine))){if(strLine.charAt(0)!=";"){AICC_Data_Chunk+=strLine+"\n";}
j=j+ 1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}}
i=i+ j- 1
AICC_Data_Chunk=AICC_Data_Chunk.replace(/\s*$/,"");break;case"comments":WriteToDebug("Item is comments");AICC_Comments="";strLine="";j=1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}
while(((i+j)&lt;aryAICCResponseLines.length)&amp;&amp;(!IsGroupIdentifier(strLine))){if(strLine.charAt(0)!=";"){AICC_Comments+=strLine+"\n";}
j=j+ 1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}}
i=i+ j- 1
AICC_Comments=AICC_Comments.replace(/\s*$/,"");break;case"objectives_status":WriteToDebug("Item is objectives_status");AICC_Objectives="";strLine="";j=1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}
while(((i+j)&lt;aryAICCResponseLines.length)&amp;&amp;(!IsGroupIdentifier(strLine))){if(strLine.charAt(0)!=";"){AICC_Objectives+=strLine+"\n";}
j=j+ 1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}}
i=i+ j- 1
AICC_Objectives=AICC_Objectives.replace(/\s*$/,"");AICC_FormatObjectives(AICC_Objectives);break;default:WriteToDebug("Unknown Item Found");break;}}}
return true;}
function IsGroupIdentifier(strLine){WriteToDebug("In IsGroupIdentifier, strLine="+ strLine);var intPos;strLine=strLine.replace(/^\s*/,"");intPos=strLine.search(/\[[\w]+\]/);WriteToDebug("intPos="+ intPos);if(intPos==0){WriteToDebug("Returning True");return true;}
else{WriteToDebug("Returning False");return false;}}
function AICC_FoundItem(strItem){WriteToDebug("In AICC_FoundItem, strItem="+ strItem);aryAICCFoundItems[strItem]=true;}
function AICC_HasItemBeenFound(strItem){WriteToDebug("In AICC_HasItemBeenFound, strItem="+ strItem);if(aryAICCFoundItems[strItem]==true){WriteToDebug("Returning True");return true;}
else{WriteToDebug("Returning False");return false;}}
function AICC_SeperateScoreValues(AICC_Score){WriteToDebug("In AICC_SeperateScoreValues, AICC_Score="+ AICC_Score);var aryScores;aryScore=AICC_Score.split(",");AICC_fltScoreRaw=aryScore[0];if(IsValidDecimal(AICC_fltScoreRaw)){WriteToDebug("Found a valid decimal");AICC_fltScoreRaw=parseFloat(AICC_fltScoreRaw);}
else{WriteToDebug("ERROR - score from LMS is not a valid decimal");AICC_SetError(AICC_ERROR_INVALID_DECIMAL,"score is not a valid decimal")}
if(aryScore.length&gt;1){WriteToDebug("Max score found");AICC_fltScoreMax=aryScore[1];if(IsValidDecimal(AICC_fltScoreMax)){WriteToDebug("Found a valid decimal");AICC_fltScoreMax=parseFloat(AICC_fltScoreMax);}
else{WriteToDebug("ERROR - max score from LMS is not a valid decimal");AICC_SetError(AICC_ERROR_INVALID_DECIMAL,"max score is not a valid decimal")}}
if(aryScore.length&gt;2){WriteToDebug("Max score found");AICC_fltScoreMin=aryScore[2];if(IsValidDecimal(AICC_fltScoreMin)){WriteToDebug("Found a valid decimal");AICC_fltScoreMin=parseFloat(AICC_fltScoreMin);}
else{WriteToDebug("ERROR - min score from LMS is not a valid decimal");AICC_SetError(AICC_ERROR_INVALID_DECIMAL,"min score is not a valid decimal")}}}
function AICC_ValidateMasteryScore(strScore){WriteToDebug("In AICC_ValidateMasteryScore, strScore="+ strScore);if(IsValidDecimal(strScore)){AICC_Mastery_Score=parseFloat(strScore);}
else{WriteToDebug("ERROR - mastery score from LMS is not a valid decimal");AICC_SetError(AICC_ERROR_INVALID_DECIMAL,"mastery score is not a valid decimal")}}
function AICC_TranslateCredit(strCredit){WriteToDebug("In AICC_TranslateCredit, strCredit="+ strCredit);var strFirstChar;strFirstChar=strCredit.toLowerCase().charAt(0);if(strFirstChar=="c"){WriteToDebug("Credit = true");AICC_blnCredit=true;}
else if(strFirstChar=="n"){WriteToDebug("Credit = false");AICC_blnCredit=false}
else{WriteToDebug("ERROR - credit value from LMS is not a valid");AICC_SetError(AICC_ERROR_INVALID_CREDIT,"credit value from LMS is not a valid")}}
function AICC_TranslateLessonMode(strMode){WriteToDebug("In AICC_TranslateLessonMode, strMode="+ strMode);var strFirstChar;strFirstChar=strMode.toLowerCase().charAt(0);if(strFirstChar=="b"){WriteToDebug("Lesson Mode = Browse");AICC_strLessonMode=MODE_BROWSE;}
else if(strFirstChar=="n"){WriteToDebug("Lesson Mode = normal");AICC_strLessonMode=MODE_NORMAL;}
else if(strFirstChar=="r"){WriteToDebug("Lesson Mode = review");AICC_strLessonMode=MODE_REVIEW;if(!(typeof(REVIEW_MODE_IS_READ_ONLY)=="undefined")&amp;&amp;REVIEW_MODE_IS_READ_ONLY===true){blnReviewModeSoReadOnly=true;}}
else{WriteToDebug("ERROR - lesson_mode value from LMS is not a valid");AICC_SetError(AICC_ERROR_INVALID_LESSON_MODE,"lesson_mode value from LMS is not a valid")}}
function AICC_TranslateTimeToMilliseconds(strCMITime){WriteToDebug("In AICC_TranslateTimeToMilliseconds, strCMITime="+ strCMITime);if(IsValidCMITimeSpan(strCMITime)){AICC_intPreviouslyAccumulatedMilliseconds=ConvertCMITimeSpanToMS(strCMITime);}
else{WriteToDebug("ERROR - Invalid CMITimeSpan");AICC_SetError(AICC_ERROR_INVALID_TIMESPAN,"Invalid timespan (previously accumulated time) received from LMS");}}
function AICC_TranslateMaxTimeToMilliseconds(strCMITime){WriteToDebug("In AICC_TranslateMaxTimeToMilliseconds, strCMITime="+ strCMITime);if(IsValidCMITimeSpan(strCMITime)){AICC_intMaxTimeAllowedMilliseconds=ConvertCMITimeSpanToMS(strCMITime);}
else{WriteToDebug("ERROR - Invalid CMITimeSpan");AICC_SetError(AICC_ERROR_INVALID_TIMESPAN,"Invalid timespan (max time allowed) received from LMS");}}
function AICC_TranslateTimeLimitAction(strTimeLimitAction){WriteToDebug("In AICC_TranslateTimeLimitAction, strTimeLimitAction="+ strTimeLimitAction);var arySplit;var blnError=false;var strChar1="";var strChar2="";arySplit=strTimeLimitAction.split(",");if(arySplit.length==2){WriteToDebug("Found 2 elements");strChar1=arySplit[0].charAt(0).toLowerCase();strChar2=arySplit[1].charAt(0).toLowerCase();WriteToDebug("Got characters, strChar1="+ strChar1+", strChar2="+ strChar2);if((strChar1!="e"&amp;&amp;strChar1!="c"&amp;&amp;strChar1!="m"&amp;&amp;strChar1!="n")||(strChar2!="e"&amp;&amp;strChar2!="c"&amp;&amp;strChar2!="m"&amp;&amp;strChar2!="n")||(strChar1==strChar2)){blnError=true
WriteToDebug("Found an invalid character, or 2 identical characters");}
if(strChar1=="e"||strChar2=="e"){AICC_blnExitOnTimeout=true;}
if(strChar1=="c"||strChar2=="c"){AICC_blnExitOnTimeout=false;}
if(strChar1=="n"||strChar2=="n"){AICC_blnShowMessageOnTimeout=false;}
if(strChar1=="m"||strChar2=="m"){AICC_blnShowMessageOnTimeout=true;}
WriteToDebug("AICC_blnExitOnTimeout="+ AICC_blnExitOnTimeout+", AICC_blnShowMessageOnTimeout"+ AICC_blnShowMessageOnTimeout);}
else{WriteToDebug("Line does not contain two comma-delimited elements");blnError=true;}
if(blnError){WriteToDebug("ERROR - Invalid Time Limit Action");AICC_SetError(AICC_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS");}}
function AICC_TranslateTextPreference(strPreference){WriteToDebug("In AICC_TranslateTextPreference, strPreference="+ strPreference);if(strPreference==-1){WriteToDebug("Text Preference = off");AICC_TextPreference=PREFERENCE_OFF;}
else if(strPreference==0){WriteToDebug("Text Preference = default");AICC_TextPreference=PREFERENCE_DEFAULT;}
else if(strPreference==1){WriteToDebug("Text Preference = on");AICC_TextPreference=PREFERENCE_ON;}
else{WriteToDebug("ERROR - Invalid Text Preference");AICC_SetError(AICC_ERROR_INVALID_PREFERENCE,"Invalid Text Preference received from LMS");}}
function AICC_TranslateLessonStatus(strStatus){WriteToDebug("In AICC_TranslateLessonStatus, strStatus="+ strStatus);var strFirstChar;var intPos;var strEntry;strFirstChar=strStatus.charAt(0).toLowerCase();AICC_Status=AICC_ConvertAICCStatusIntoLocalStatus(strFirstChar);WriteToDebug("AICC_Status="+ AICC_Status);intPos=strStatus.indexOf(",");if(intPos&gt;0){strEntry=strStatus.substr(intPos);strEntry=strEntry.replace(/,/,"");strFirstChar=strEntry.charAt(0).toLowerCase();if(strFirstChar=="a"){WriteToDebug("Entry is Ab initio");AICC_Entry=ENTRY_FIRST_TIME;}
else if(strFirstChar=="r"){WriteToDebug("Entry is Resume");AICC_Entry=ENTRY_RESUME;}
else{WriteToDebug("ERROR - entry not found");AICC_SetError(AICC_ERROR_INVALID_ENTRY,"Invalid lesson status received from LMS");}}}
function AICC_ConvertAICCStatusIntoLocalStatus(strFirstCharOfAICCStatus){WriteToDebug("In AICC_ConvertAICCStatusIntoLocalStatus, strFirstCharOfAICCStatus="+ strFirstCharOfAICCStatus);if(strFirstCharOfAICCStatus=="p"){WriteToDebug("Status is Passed");return LESSON_STATUS_PASSED;}
else if(strFirstCharOfAICCStatus=="f"){WriteToDebug("Status is Failed");return LESSON_STATUS_FAILED;}
else if(strFirstCharOfAICCStatus=="c"){WriteToDebug("Status is Completed");return LESSON_STATUS_COMPLETED;}
else if(strFirstCharOfAICCStatus=="b"){WriteToDebug("Status is Browsed");return LESSON_STATUS_BROWSED;}
else if(strFirstCharOfAICCStatus=="i"){WriteToDebug("Status is Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strFirstCharOfAICCStatus=="n"){WriteToDebug("Status is Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");AICC_SetError(SCORM_ERROR_INVALID_STATUS,"Invalid status");return LESSON_STATUS_NOT_ATTEMPTED;}}
function AICC_TranslateAudio(strAudio){WriteToDebug("In AICC_TranslateAudio, strAudio="+ strAudio);var intTempPreference=parseInt(strAudio,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0&amp;&amp;intTempPreference&lt;=100){WriteToDebug("Returning On");AICC_AudioPlayPreference=PREFERENCE_ON;AICC_intAudioVolume=intTempPreference;}
else if(intTempPreference==0){WriteToDebug("Returning Default");AICC_AudioPlayPreference=PREFERENCE_DEFAULT;}
else if(intTempPreference&lt;0){WriteToDebug("returning Off");AICC_AudioPlayPreference=PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");AICC_SetError(AICC_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS");}}
function AICC_TranslateSpeed(intAICCSpeed){WriteToDebug("In AICC_TranslateSpeed, intAICCSpeed="+ intAICCSpeed);var intPercentOfMax;if(!ValidInteger(intAICCSpeed)){WriteToDebug("ERROR - invalid integer");AICC_SetError(AICC_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - not an integer");return;}
intAICCSpeed=parseInt(intAICCSpeed,10)
if(intAICCSpeed&lt;-100||intAICCSpeed&gt;100){WriteToDebug("ERROR - out of range");AICC_SetError(AICC_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - out of range");return;}
AICC_Speed=intAICCSpeed;intPercentOfMax=(intAICCSpeed+ 100)/2;intPercentOfMax=parseInt(intPercentOfMax,10);WriteToDebug("Returning "+ intPercentOfMax);AICC_intPercentOfMaxSpeed=intPercentOfMax;}
function AICC_FormatObjectives(strObjectivesFromLMS){WriteToDebug("In AICC_FormatObjectives, strObjectivesFromLMS="+ strObjectivesFromLMS);var aryLines;var i;var strLineName;var strLineValue;var strLineType;var strIndex;aryLines=strObjectivesFromLMS.split("\n");for(i=0;i&lt;aryLines.length;i++){WriteToDebug("Extracting Index From Line: "+ aryLines[i]);strLineName=GetNameFromAICCLine(aryLines[i]);strIndex=GetIndexFromAICCName(strLineName);strIndex=parseInt(strIndex,10);WriteToDebug("strIndex: "+ strIndex);AICC_aryObjectivesRead[parseInt(strIndex,10)]=new Array(3);}
for(i=0;i&lt;aryLines.length;i++){WriteToDebug("Populating Line "+ aryLines[i]);strLineName=GetNameFromAICCLine(aryLines[i]);strLineValue=GetValueFromAICCLine(aryLines[i]);strIndex=GetIndexFromAICCName(strLineName);strIndex=strIndex;WriteToDebug("strLineName: "+ strLineName);WriteToDebug("strLineValue: "+ strLineValue);WriteToDebug("strIndex: "+ strIndex);strLineType=strLineName.substr(0,4).toLowerCase();if(strLineType=="j_id"){WriteToDebug("Found ID");AICC_aryObjectivesRead[parseInt(strIndex,10)][AICC_OBJ_ARRAY_ID]=strLineValue;}
else if(strLineType=="j_st"){WriteToDebug("Found Status");AICC_aryObjectivesRead[parseInt(strIndex,10)][AICC_OBJ_ARRAY_STATUS]=AICC_ConvertAICCStatusIntoLocalStatus(strLineValue.charAt(0).toLowerCase());}
else if(strLineType=="j_sc"){WriteToDebug("Found Score");AICC_aryObjectivesRead[parseInt(strIndex,10)][AICC_OBJ_ARRAY_SCORE]=AICC_ExtractSingleScoreFromObjective(strLineValue);}
else{WriteToDebug("WARNING - unidentified objective data found - "+ aryLines[i]);}}}
function AICC_ExtractSingleScoreFromObjective(strLineValue){WriteToDebug("In AICC_ExtractSingleScoreFromObjective, strLineValue="+ strLineValue);var aryParts;aryParts=strLineValue.split(";");aryParts=aryParts[0].split(",");WriteToDebug("returning "+ aryParts[0]);return aryParts[0];}
function FindObjectiveById(strID,aryObjectives){WriteToDebug("In FindObjectiveById, strID="+ strID);for(var i=0;i&lt;=aryObjectives.length;i++){WriteToDebug("Searching element "+ i);if(aryObjectives[i]){WriteToDebug("Element Exists");if(aryObjectives[i][AICC_OBJ_ARRAY_ID].toString()==strID.toString()){WriteToDebug("Element matches");return i;}}}
return null;}
function AICC_FindInteractionIndexFromID(strInteractionID){WriteToDebug("AICC_FindInteractionIndexFromID - AICC does not support interaction retrieval, returning null");return null;}
function AICC_GetInteractionType(strInteractionID)
{WriteToDebug("AICC_GetInteractionType - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionTimestamp(strInteractionID)
{WriteToDebug("AICC_GetInteractionTimestamp - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("AICC_GetInteractionCorrectResponses - AICC does not support interaction retrieval, returning empty array");return new Array();}
function AICC_GetInteractionWeighting(strInteractionID)
{WriteToDebug("AICC_GetInteractionWeighting - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("AICC_GetInteractionLearnerResponses - AICC does not support interaction retrieval, returning empty array");return new Array();}
function AICC_GetInteractionResult(strInteractionID)
{WriteToDebug("AICC_GetInteractionResult - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionLatency(strInteractionID)
{WriteToDebug("AICC_GetInteractionDescription - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionDescription(strInteractionID)
{WriteToDebug("AICC_GetInteractionDescription - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_CreateDataBucket(strBucketId,intMinSize,intMaxSize){WriteToDebug("AICC_CreateDataBucket - AICC does not support SSP, returning false");return false;}
function AICC_GetDataFromBucket(strBucketId){WriteToDebug("AICC_GetDataFromBucket - AICC does not support SSP, returning empty string");return"";}
function AICC_PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("AICC_PutDataInBucket - AICC does not support SSP, returning false");return false;}
function AICC_DetectSSPSupport(){WriteToDebug("AICC_DetectSSPSupport - AICC does not support SSP, returning false");return false;}
function AICC_GetBucketInfo(strBucketId){WriteToDebug("AICC_DetectSSPSupport - AICC does not support SSP, returning empty SSPBucketSize");return new SSPBucketSize(0,0);}
function FormAICCPostData(){WriteToDebug("In FormAICCPostData");var strAICCData="";strAICCData+="[Core]\r\n";strAICCData+="Lesson_Location="+ AICC_Lesson_Location+"\r\n";strAICCData+="Lesson_Status="+ AICC_TranslateLessonStatusToAICC(AICC_Status)+"\r\n";strAICCData+="Score="+ AICC_TranslateScoreToAICC()+"\r\n";strAICCData+="Time="+ AICC_TranslateTimeToAICC()+"\r\n";strAICCData+="[Comments]\r\n"+ AICC_TranslateCommentsToAICC()+"\r\n";strAICCData+="[Objectives_Status]\r\n"+ AICC_TranslateObjectivesToAICC()+"\r\n";strAICCData+="[Student_Preferences]\r\n";strAICCData+="Audio="+ AICC_TranslateAudioToAICC()+"\r\n";strAICCData+="Language="+ AICC_Language+"\r\n";strAICCData+="Speed="+ AICC_TranslateSpeedToAICC()+"\r\n";strAICCData+="Text="+ AICC_TranslateTextToAICC()+"\r\n";strAICCData+="[Core_Lesson]\r\n";strAICCData+=AICC_Data_Chunk;WriteToDebug("FormAICCPostData returning: "+ strAICCData);return strAICCData;}
function AICC_TranslateLessonStatusToAICC(intStatus){WriteToDebug("In AICC_TranslateLessonStatusToAICC");switch(intStatus){case LESSON_STATUS_PASSED:WriteToDebug("Status is passed");AICC_Lesson_Status="P";break;case LESSON_STATUS_COMPLETED:WriteToDebug("Status is completed");AICC_Lesson_Status="C";break;case LESSON_STATUS_FAILED:WriteToDebug("Status is failed");AICC_Lesson_Status="F";break;case LESSON_STATUS_INCOMPLETE:WriteToDebug("Status is incomplete");AICC_Lesson_Status="I";break;case LESSON_STATUS_BROWSED:WriteToDebug("Status is browsed");AICC_Lesson_Status="B";break;case LESSON_STATUS_NOT_ATTEMPTED:WriteToDebug("Status is not attempted");AICC_Lesson_Status="N";break;}
return AICC_Lesson_Status;}
function AICC_TranslateScoreToAICC(){WriteToDebug("In AICC_TranslateScoreToAICC");AICC_Score=AICC_fltScoreRaw;if(AICC_LMS_Version&lt;3&amp;&amp;AICC_fltScoreRaw!=""){AICC_Score=parseInt(AICC_Score,10);}
if((AICC_REPORT_MIN_MAX_SCORE===undefined||AICC_REPORT_MIN_MAX_SCORE===null||AICC_REPORT_MIN_MAX_SCORE===true)&amp;&amp;(AICC_LMS_Version&gt;=3)){WriteToDebug("Using max and min values if available.");if((AICC_fltScoreMax!="")||(AICC_fltScoreMin!="")){WriteToDebug("Appending Max and Min scores");AICC_Score+=","+ AICC_fltScoreMax+","+ AICC_fltScoreMin;}}
WriteToDebug("AICC_Score="+ AICC_Score);return AICC_Score;}
function AICC_TranslateTimeToAICC(){WriteToDebug("In AICC_TranslateTimeToAICC");var strTime;strTime=ConvertMilliSecondsToSCORMTime(AICC_intSessionTimeMilliseconds,false);return strTime;}
function AICC_TranslateCommentsToAICC(){WriteToDebug("In AICC_TranslateCommentsToAICC");var strComments="";for(var i=0;i&lt;AICC_aryCommentsFromLearner.length;i++){strComments+="&lt;"+(i+1)+"&gt;"+ AICC_aryCommentsFromLearner[i]+"&lt;e."+(i+1)+"&gt;";}
return strComments;}
function AICC_TranslateObjectivesToAICC(){WriteToDebug("In AICC_TranslateObjectivesToAICC");var strObjectives="";for(var i=0;i&lt;AICC_aryObjectivesWrite.length;i++){WriteToDebug("Looking at index: "+ i);if(AICC_aryObjectivesWrite[i]){WriteToDebug("Element "+ i+" exists, id="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_ID]+", score="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_SCORE]+", status="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_STATUS]);strObjectives+="J_ID."+(i+1)+"="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_ID]+"\r\n";if(AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_SCORE]!=""){strObjectives+="J_Score."+(i+1)+"="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_SCORE]+"\r\n";}
if(AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_STATUS]!=""){strObjectives+="J_Status."+(i+1)+"="+ AICC_TranslateLessonStatusToAICC(AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_STATUS])+"\r\n";}}}
return strObjectives;}
function AICC_TranslateAudioToAICC(){WriteToDebug("In AICC_TranslateAudioToAICC");var strReturn;switch(AICC_AudioPlayPreference){case PREFERENCE_ON:WriteToDebug("Preference is ON");strReturn=AICC_intAudioVolume;break;case PREFERENCE_DEFAULT:WriteToDebug("Preference is DEFAULT");strReturn=0;break;case PREFERENCE_OFF:WriteToDebug("Preference is OFF");strReturn=-1;break;}
return strReturn;}
function AICC_TranslateSpeedToAICC(){WriteToDebug("In AICC_TranslateSpeedToAICC");var intAICCSpeed;intAICCSpeed=(AICC_intPercentOfMaxSpeed*2)- 100;return intAICCSpeed;}
function AICC_TranslateTextToAICC(){WriteToDebug("In AICC_TranslateTextToAICC");var strPreference=0;if(AICC_TextPreference==PREFERENCE_OFF){strPreference=-1;}
else if(AICC_TextPreference==PREFERENCE_DEFAULT){strPreference=0;}
else if(AICC_TextPreference==PREFERENCE_ON){strPreference=1;}
return strPreference;}
function FormAICCInteractionsData(){WriteToDebug("In FormAICCInteractionsData");var strInteractions;var strDate;var strTime;var strResult="";strInteractions='"course_id","student_id","lesson_id","date","time","interaction_id",'+'"objective_id","type_interaction","correct_response","student_response",'+'"result","weighting","latency"\r\n';var blnCorrect="";var strResponse="";var strCorrectResponse="";var strLatency="";for(var i=0;i&lt;AICC_aryInteractions.length;i++){blnCorrect=AICC_aryInteractions[i][AICC_INTERACTIONS_CORRECT];strResult="";if(blnCorrect==true||blnCorrect==INTERACTION_RESULT_CORRECT){strResult=AICC_RESULT_CORRECT;}
else if(blnCorrect=="false"||blnCorrect==INTERACTION_RESULT_WRONG){strResult=AICC_RESULT_WRONG;}
else if(blnCorrect==INTERACTION_RESULT_UNANTICIPATED){strResult=AICC_RESULT_UNANTICIPATED;}
else if(blnCorrect==INTERACTION_RESULT_NEUTRAL){strResult=AICC_RESULT_NEUTRAL;}
strDate=ConvertDateToCMIDate(AICC_aryInteractions[i][AICC_INTERACTIONS_TIME_STAMP]);strTime=ConvertDateToCMITime(AICC_aryInteractions[i][AICC_INTERACTIONS_TIME_STAMP]);if(blnUseLongInteractionResultValues==true){strResponse=AICC_aryInteractions[i][AICC_INTERACTIONS_RESPONSE_LONG];strCorrectResponse=AICC_aryInteractions[i][AICC_INTERACTIONS_CORRECT_RESPONSE_LONG];}
else{strResponse=AICC_aryInteractions[i][AICC_INTERACTIONS_RESPONSE];strCorrectResponse=AICC_aryInteractions[i][AICC_INTERACTIONS_CORRECT_RESPONSE];}
strResponse=new String(strResponse);strCorrectResponse=new String(strCorrectResponse);var tempLatency=AICC_aryInteractions[i][AICC_INTERACTIONS_LATENCY];if(tempLatency!==null&amp;&amp;tempLatency!==undefined&amp;&amp;tempLatency!=""){strLatency=ConvertMilliSecondsToSCORMTime(tempLatency,false);}
strInteractions+='"'+ AICC_CourseID.replace("\"","")+'","'+ AICC_Student_ID.replace("\"","")+'","'+ AICC_LESSON_ID.replace("\"","")+'","'+
strDate+'","'+ strTime+'","'+ AICC_aryInteractions[i][AICC_INTERACTIONS_ID].replace("\"","")+'",'+'""'+',"'+ AICC_aryInteractions[i][AICC_INTERACTIONS_TYPE]+'","'+ strCorrectResponse.replace("\"","")+'","'+
strResponse.replace("\"","")+'","'+ strResult+'","'+
AICC_aryInteractions[i][AICC_INTERACTIONS_WEIGHTING]+'","'+ strLatency+'"\r\n';}
return strInteractions;}
function DisplayAICCVariables(){var strAlert="";strAlert+="AICC_Student_ID = "+ AICC_Student_ID+"\n";strAlert+="AICC_Student_Name = "+ AICC_Student_Name+"\n";strAlert+="AICC_Lesson_Location = "+ AICC_Lesson_Location+"\n";strAlert+="AICC_Score = "+ AICC_Score+"\n";strAlert+="AICC_Credit = "+ AICC_Credit+"\n";strAlert+="AICC_Lesson_Status = "+ AICC_Lesson_Status+"\n";strAlert+="AICC_Time = "+ AICC_Time+"\n";strAlert+="AICC_Mastery_Score = "+ AICC_Mastery_Score+"\n";strAlert+="AICC_Lesson_Mode = "+ AICC_Lesson_Mode+"\n";strAlert+="AICC_Max_Time_Allowed = "+ AICC_Max_Time_Allowed+"\n";strAlert+="AICC_Time_Limit_Action = "+ AICC_Time_Limit_Action+"\n";strAlert+="AICC_Audio = "+ AICC_Audio+"\n";strAlert+="AICC_Speed = "+ AICC_Speed+"\n";strAlert+="AICC_Language = "+ AICC_Language+"\n";strAlert+="AICC_Text = "+ AICC_Text+"\n";strAlert+="AICC_Launch_Data = "+ AICC_Launch_Data+"\n";strAlert+="AICC_Data_Chunk = "+ AICC_Data_Chunk+"\n";strAlert+="AICC_Comments = "+ AICC_Comments+"\n";strAlert+="AICC_Objectives = "+ AICC_Objectives+"\n";alert(strAlert)}</text>
				</content>
				<redirectionURL/>
				<headersSize>287</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/NONEFunctions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>372</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="NONEFunctions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>function NONE_Initialize(){WriteToDebug("In NONE_Initialize, Returning true");InitializeExecuted(true,"");return true;}
function NONE_Finish(strExitType,blnStatusWasSet){WriteToDebug("In NONE_Finish, Returning true");return true;}
function NONE_CommitData(){WriteToDebug("In NONE_CommitData, Returning true");return true;}
function NONE_GetStudentID(){WriteToDebug("In NONE_GetStudentID, Returning ''");return"";}
function NONE_GetStudentName(){WriteToDebug("In NONE_GetStudentName, Returning ''");return"";}
function NONE_GetBookmark(){WriteToDebug("In NONE_GetBookmark, Returning ''");return"";}
function NONE_SetBookmark(strBookmark){WriteToDebug("In NONE_SetBookmark, Returning true");return true;}
function NONE_GetDataChunk(){WriteToDebug("In NONE_GetDataChunk, Returning ''");return"";}
function NONE_SetDataChunk(strData){WriteToDebug("In NONE_SetDataChunk, Returning true");return true;}
function NONE_GetLaunchData(){WriteToDebug("In NONE_GetLaunchData, Returning ''");return"";}
function NONE_GetComments(){WriteToDebug("In NONE_GetComments, Returning ''");return"";}
function NONE_WriteComment(strComment){WriteToDebug("In NONE_WriteComment, Returning true");return true;}
function NONE_GetLMSComments(){WriteToDebug("In NONE_GetLMSComments, Returning ''");return"";}
function NONE_GetAudioPlayPreference(){WriteToDebug("In NONE_GetAudioPlayPreference, Returning "+ PREFERENCE_DEFAULT);return PREFERENCE_DEFAULT;}
function NONE_GetAudioVolumePreference(){WriteToDebug("In NONE_GetAudioVolumePreference, Returning 100");return 100;}
function NONE_SetAudioPreference(PlayPreference,intPercentOfMaxSpeed){WriteToDebug("In NONE_SetAudioPreference, Returning true");return true;}
function NONE_SetLanguagePreference(strLanguage){WriteToDebug("In NONE_SetLanguagePreference, Returning true");return true;}
function NONE_GetLanguagePreference(){WriteToDebug("In NONE_GetLanguagePreference, Returning ''");return"";}
function NONE_SetSpeedPreference(intPercentOfMax){WriteToDebug("In NONE_SetSpeedPreference, Returning true");return true;}
function NONE_GetSpeedPreference(){WriteToDebug("In NONE_GetSpeedPreference, Returning 100");return 100;}
function NONE_SetTextPreference(intPreference){WriteToDebug("In NONE_SetTextPreference, Returning true");return true;}
function NONE_GetTextPreference(){WriteToDebug("In NONE_GetTextPreference, Returning "+ PREFERENCE_DEFAULT);return PREFERENCE_DEFAULT;}
function NONE_GetPreviouslyAccumulatedTime(){WriteToDebug("In NONE_GetPreviouslyAccumulatedTime, Returning 0");return 0;}
function NONE_SaveTime(intMilliSeconds){WriteToDebug("In intMilliSeconds, Returning true");return true;}
function NONE_GetMaxTimeAllowed(){WriteToDebug("In NONE_GetMaxTimeAllowed, Returning 36002439999");return MAX_CMI_TIME;}
function NONE_DisplayMessageOnTimeout(){WriteToDebug("In NONE_DisplayMessageOnTimeout, Returning false");return false;}
function NONE_ExitOnTimeout(){WriteToDebug("In NONE_ExitOnTimeout, Returning false");return false;}
function NONE_GetPassingScore(){WriteToDebug("In NONE_GetPassingScore, Returning ''");return'';}
function NONE_GetScore(){WriteToDebug("In NONE_GetScore, Returning 0");return 0;}
function NONE_SetScore(intScore,intMaxScore,intMinScore){WriteToDebug("In NONE_SetScore, Returning true");return true;}
function NONE_RecordTrueFalseInteraction(){WriteToDebug("In NONE_RecordTrueFalseInteraction, Returning true");return true;}
function NONE_RecordMultipleChoiceInteraction(strID,strResponse,blnCorrect,strCorrectResponse){WriteToDebug("In NONE_RecordMultipleChoiceInteraction, Returning true");return true;}
function NONE_RecordFillInInteraction(){WriteToDebug("In NONE_RecordFillInInteraction, Returning true");return true;}
function NONE_RecordMatchingInteraction(){WriteToDebug("In NONE_RecordMatchingInteraction, Returning true");return true;}
function NONE_RecordPerformanceInteraction(){WriteToDebug("In NONE_RecordPerformanceInteraction, Returning true");return true;}
function NONE_RecordSequencingInteraction(){WriteToDebug("In NONE_RecordSequencingInteraction, Returning true");return true;}
function NONE_RecordLikertInteraction(){WriteToDebug("In RecordLikertInteraction, Returning true");return true;}
function NONE_RecordNumericInteraction(){WriteToDebug("In NONE_RecordNumericInteraction, Returning true");return true;}
function NONE_GetEntryMode(){WriteToDebug("In NONE_GetEntryMode, Returning "+ ENTRY_FIRST_TIME);return ENTRY_FIRST_TIME;}
function NONE_GetLessonMode(){WriteToDebug("In NONE_GetLessonMode, Returning "+ MODE_NORMAL);return MODE_NORMAL;}
function NONE_GetTakingForCredit(){WriteToDebug("In NONE_GetTakingForCredit, Returning true");return true;}
function NONE_SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){WriteToDebug("In NONE_SetObjectiveScore, Returning true");return true;}
function NONE_SetObjectiveStatus(strObjectiveID,Lesson_Status){WriteToDebug("In NONE_SetObjectiveStatus, Returning true");return true;}
function NONE_SetObjectiveDescription(strObjectiveID,strObjectiveDescription){WriteToDebug("In NONE_SetObjectiveDescription, Returning true");return true;}
function NONE_GetObjectiveScore(strObjectiveID){WriteToDebug("In NONE_SetObjectiveScore, Returning ''");return'';}
function NONE_GetObjectiveStatus(strObjectiveID){WriteToDebug("In NONE_SetObjectiveStatus, Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
function NONE_GetObjectiveDescription(strObjectiveID){WriteToDebug("In NONE_GetObjectiveDescription, ''");return"";}
function NONE_FindInteractionIndexFromID(strInteractionID){WriteToDebug("NONE_FindInteractionIndexFromID - NONE does not support interaction retrieval, returning null");return null;}
function NONE_GetInteractionType(strInteractionID)
{WriteToDebug("NONE_GetInteractionType - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionTimestamp(strInteractionID)
{WriteToDebug("NONE_GetInteractionTimestamp - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("NONE_GetInteractionCorrectResponses - NONE does not support interaction retrieval, returning empty array");return new Array();}
function NONE_GetInteractionWeighting(strInteractionID)
{WriteToDebug("NONE_GetInteractionWeighting - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("NONE_GetInteractionLearnerResponses - NONE does not support interaction retrieval, returning empty array");return new Array();}
function NONE_GetInteractionResult(strInteractionID)
{WriteToDebug("NONE_GetInteractionResult - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionLatency(strInteractionID)
{WriteToDebug("NONE_GetInteractionDescription - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionDescription(strInteractionID)
{WriteToDebug("NONE_GetInteractionDescription - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_CreateDataBucket(strBucketId,intMinSize,intMaxSize){WriteToDebug("NONE_CreateDataBucket - NONE does not support SSP, returning false");return false;}
function NONE_GetDataFromBucket(strBucketId){WriteToDebug("NONE_GetDataFromBucket - NONE does not support SSP, returning empty string");return"";}
function NONE_PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("NONE_PutDataInBucket - NONE does not support SSP, returning false");return false;}
function NONE_DetectSSPSupport(){WriteToDebug("NONE_DetectSSPSupport - NONE does not support SSP, returning false");return false;}
function NONE_GetBucketInfo(strBucketId){WriteToDebug("NONE_DetectSSPSupport - NONE does not support SSP, returning empty SSPBucketSize");return new SSPBucketSize(0,0);}
function NONE_SetFailed(){WriteToDebug("In NONE_SetFailed, Returning true");return true;}
function NONE_SetPassed(){WriteToDebug("In NONE_SetPassed, Returning true");return true;}
function NONE_SetCompleted(){WriteToDebug("In NONE_SetCompleted, Returning true");return true;}
function NONE_ResetStatus(){WriteToDebug("In NONE_ResetStatus, Returning true");return true;}
function NONE_GetStatus(){WriteToDebug("In NONE_GetStatus, Returning "+ LESSON_STATUS_INCOMPLETE);return LESSON_STATUS_INCOMPLETE;}
function NONE_GetProgressMeasure(){WriteToDebug("NONE_GetProgressMeasure - NONE does not support progress_measure, returning false");return false;}
function NONE_SetProgressMeasure(){WriteToDebug("NONE_SetProgressMeasure - NONE does not support progress_measure, returning false");return false;}
function NONE_GetObjectiveProgressMeasure(){WriteToDebug("NONE_GetObjectiveProgressMeasure - NONE does not support progress_measure, returning false");return false;}
function NONE_SetObjectiveProgressMeasure(){WriteToDebug("NONE_SetObjectiveProgressMeasure - NONE does not support progress_measure, returning false");return false;}
function NONE_SetPointBasedScore(intScore,intMaxScore,intMinScore){WriteToDebug("NONE_SetPointBasedScore - NONE does not support SetPointBasedScore, returning false");return false;}
function NONE_GetScaledScore(intScore,intMaxScore,intMinScore){WriteToDebug("NONE_GetScaledScore - NONE does not support GetScaledScore, returning false");return false;}
function NONE_GetLastError(){WriteToDebug("In NONE_GetLastError, Returning "+ NO_ERROR);return NO_ERROR;}
function NONE_GetLastErrorDesc(){WriteToDebug("In NONE_GetLastErrorDesc, Returning ''");return"";}</text>
				</content>
				<redirectionURL/>
				<headersSize>287</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/LMSAPI.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>365</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="LMSAPI.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>function LMSStandardAPI(strStandard){WriteToDebug("In LMSStandardAPI strStandard="+ strStandard);if(strStandard==""){WriteToDebug("No standard specified, using NONE");strStandard="NONE";}
eval("this.Initialize = "+ strStandard+"_Initialize");eval("this.Finish = "+ strStandard+"_Finish");eval("this.CommitData = "+ strStandard+"_CommitData");eval("this.GetStudentID = "+ strStandard+"_GetStudentID");eval("this.GetStudentName = "+ strStandard+"_GetStudentName");eval("this.GetBookmark = "+ strStandard+"_GetBookmark");eval("this.SetBookmark = "+ strStandard+"_SetBookmark");eval("this.GetDataChunk = "+ strStandard+"_GetDataChunk");eval("this.SetDataChunk = "+ strStandard+"_SetDataChunk");eval("this.GetLaunchData = "+ strStandard+"_GetLaunchData");eval("this.GetComments = "+ strStandard+"_GetComments");eval("this.WriteComment = "+ strStandard+"_WriteComment");eval("this.GetLMSComments = "+ strStandard+"_GetLMSComments");eval("this.GetAudioPlayPreference = "+ strStandard+"_GetAudioPlayPreference");eval("this.GetAudioVolumePreference = "+ strStandard+"_GetAudioVolumePreference");eval("this.SetAudioPreference = "+ strStandard+"_SetAudioPreference");eval("this.SetLanguagePreference = "+ strStandard+"_SetLanguagePreference");eval("this.GetLanguagePreference = "+ strStandard+"_GetLanguagePreference");eval("this.SetSpeedPreference = "+ strStandard+"_SetSpeedPreference");eval("this.GetSpeedPreference = "+ strStandard+"_GetSpeedPreference");eval("this.SetTextPreference = "+ strStandard+"_SetTextPreference");eval("this.GetTextPreference = "+ strStandard+"_GetTextPreference");eval("this.GetPreviouslyAccumulatedTime = "+ strStandard+"_GetPreviouslyAccumulatedTime");eval("this.SaveTime = "+ strStandard+"_SaveTime");eval("this.GetMaxTimeAllowed = "+ strStandard+"_GetMaxTimeAllowed");eval("this.DisplayMessageOnTimeout = "+ strStandard+"_DisplayMessageOnTimeout");eval("this.ExitOnTimeout = "+ strStandard+"_ExitOnTimeout");eval("this.GetPassingScore = "+ strStandard+"_GetPassingScore");eval("this.SetScore = "+ strStandard+"_SetScore");eval("this.GetScore = "+ strStandard+"_GetScore");eval("this.GetScaledScore = "+ strStandard+"_GetScaledScore");eval("this.RecordTrueFalseInteraction = "+ strStandard+"_RecordTrueFalseInteraction");eval("this.RecordMultipleChoiceInteraction = "+ strStandard+"_RecordMultipleChoiceInteraction");eval("this.RecordFillInInteraction = "+ strStandard+"_RecordFillInInteraction");eval("this.RecordMatchingInteraction = "+ strStandard+"_RecordMatchingInteraction");eval("this.RecordPerformanceInteraction = "+ strStandard+"_RecordPerformanceInteraction");eval("this.RecordSequencingInteraction = "+ strStandard+"_RecordSequencingInteraction");eval("this.RecordLikertInteraction = "+ strStandard+"_RecordLikertInteraction");eval("this.RecordNumericInteraction = "+ strStandard+"_RecordNumericInteraction");eval("this.GetEntryMode = "+ strStandard+"_GetEntryMode");eval("this.GetLessonMode = "+ strStandard+"_GetLessonMode");eval("this.GetTakingForCredit = "+ strStandard+"_GetTakingForCredit");eval("this.SetObjectiveScore = "+ strStandard+"_SetObjectiveScore");eval("this.SetObjectiveStatus = "+ strStandard+"_SetObjectiveStatus");eval("this.GetObjectiveScore = "+ strStandard+"_GetObjectiveScore");eval("this.GetObjectiveStatus = "+ strStandard+"_GetObjectiveStatus");eval("this.SetObjectiveDescription = "+ strStandard+"_SetObjectiveDescription");eval("this.GetObjectiveDescription = "+ strStandard+"_GetObjectiveDescription");eval("this.SetFailed = "+ strStandard+"_SetFailed");eval("this.SetPassed = "+ strStandard+"_SetPassed");eval("this.SetCompleted = "+ strStandard+"_SetCompleted");eval("this.ResetStatus = "+ strStandard+"_ResetStatus");eval("this.GetStatus = "+ strStandard+"_GetStatus");eval("this.GetLastError = "+ strStandard+"_GetLastError");eval("this.GetLastErrorDesc = "+ strStandard+"_GetLastErrorDesc");eval("this.GetInteractionType = "+ strStandard+"_GetInteractionType");eval("this.GetInteractionTimestamp = "+ strStandard+"_GetInteractionTimestamp");eval("this.GetInteractionCorrectResponses = "+ strStandard+"_GetInteractionCorrectResponses");eval("this.GetInteractionWeighting = "+ strStandard+"_GetInteractionWeighting");eval("this.GetInteractionLearnerResponses = "+ strStandard+"_GetInteractionLearnerResponses");eval("this.GetInteractionResult = "+ strStandard+"_GetInteractionResult");eval("this.GetInteractionLatency = "+ strStandard+"_GetInteractionLatency");eval("this.GetInteractionDescription = "+ strStandard+"_GetInteractionDescription");eval("this.CreateDataBucket = "+ strStandard+"_CreateDataBucket");eval("this.GetDataFromBucket = "+ strStandard+"_GetDataFromBucket");eval("this.PutDataInBucket = "+ strStandard+"_PutDataInBucket");eval("this.DetectSSPSupport = "+ strStandard+"_DetectSSPSupport");eval("this.GetBucketInfo = "+ strStandard+"_GetBucketInfo");eval("this.GetProgressMeasure = "+ strStandard+"_GetProgressMeasure");eval("this.SetProgressMeasure = "+ strStandard+"_SetProgressMeasure");eval("this.SetPointBasedScore = "+ strStandard+"_SetPointBasedScore");this.Standard=strStandard;}</text>
				</content>
				<redirectionURL/>
				<headersSize>280</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/API.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>362</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="API.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var blnCalledFinish=false;var blnStandAlone=false;var blnLoaded=false;var blnReachedEnd=false;var blnStatusWasSet=false;var blnLmsPresent=false;var dtmStart=null;var dtmEnd=null;var intAccumulatedMS=0;var blnOverrodeTime=false;var intTimeOverrideMS=null;var aryDebug=new Array();var strDebug="";var winDebug;var intError=NO_ERROR;var strErrorDesc="";var objLMS=null;function Start(){var strStandAlone;var strShowInteractiveDebug;var objTempAPI=null;var strTemp="";WriteToDebug("----------------------------------------");WriteToDebug("----------------------------------------");WriteToDebug("In Start - Version: "+ VERSION+"  Last Modified="+ window.document.lastModified);WriteToDebug("Browser Info ("+ navigator.appName+" "+ navigator.appVersion+")");WriteToDebug("URL: "+ window.document.location.href);WriteToDebug("----------------------------------------");WriteToDebug("----------------------------------------");ClearErrorInfo();strStandAlone=GetQueryStringValue("StandAlone",window.location.search);strShowInteractiveDebug=GetQueryStringValue("ShowDebug",window.location.search);WriteToDebug("strStandAlone="+ strStandAlone+"  strShowInteractiveDebug="+ strShowInteractiveDebug);if(ConvertStringToBoolean(strStandAlone)){WriteToDebug("Entering Stand Alone Mode");blnStandAlone=true;}
if(blnStandAlone){WriteToDebug("Using NONE Standard");objLMS=new LMSStandardAPI("NONE");}
else{WriteToDebug("Standard From Configuration File - "+ strLMSStandard);if(strLMSStandard.toUpperCase()=="AUTO"){WriteToDebug("Searching for AICC querystring parameters");strTemp=GetQueryStringValue("AICC_URL",document.location.search);if(strTemp!=null&amp;&amp;strTemp!="")
{WriteToDebug("Found AICC querystring parameters, using AICC");objLMS=new LMSStandardAPI("AICC");blnLmsPresent=true;}else{WriteToDebug("Auto-detecting standard - Searching for SCORM 2004 API");try{objTempAPI=SCORM2004_GrabAPI();}
catch(e){WriteToDebug("Error grabbing 2004 API-"+ e.name+":"+ e.message);}
if(!(typeof(objTempAPI)=="undefined"||objTempAPI==null)){WriteToDebug("Found SCORM 2004 API, using SCORM 2004");objLMS=new LMSStandardAPI("SCORM2004");blnLmsPresent=true;}else{WriteToDebug("Searching for SCORM 1.2 API");try{objTempAPI=SCORM_GrabAPI();}
catch(e){WriteToDebug("Error grabbing 1.2 API-"+ e.name+":"+ e.message);}
if(!(typeof(objTempAPI)=="undefined"||objTempAPI==null)){WriteToDebug("Found SCORM API, using SCORM");objLMS=new LMSStandardAPI("SCORM");blnLmsPresent=true;}else{if(ALLOW_NONE_STANDARD===true)
{WriteToDebug("Could not determine standard, defaulting to Stand Alone");objLMS=new LMSStandardAPI("NONE");}else{WriteToDebug("Could not determine standard, Stand Alone is disabled in configuration");DisplayError("Could not determine standard. Neither SCORM nor AICC APIs could be found");return;}}}}}else{WriteToDebug("Using Standard From Configuration File - "+ strLMSStandard);objLMS=new LMSStandardAPI(strLMSStandard);blnLmsPresent=true;}}
if(ConvertStringToBoolean(strShowInteractiveDebug)||(!(typeof(SHOW_DEBUG_ON_LAUNCH)=="undefined")&amp;&amp;SHOW_DEBUG_ON_LAUNCH===true)){WriteToDebug("Showing Interactive Debug Windows");ShowDebugWindow();}
WriteToDebug("Calling Standard Initialize");objLMS.Initialize();return;}
function InitializeExecuted(blnSuccess,strErrorMessage){WriteToDebug("In InitializeExecuted, blnSuccess="+ blnSuccess+", strErrorMessage="+ strErrorMessage);if(!blnSuccess){WriteToDebug("ERROR - LMS Initialize Failed");if(strErrorMessage==""){strErrorMessage="An Error Has Occurred";}
blnLmsPresent=false;DisplayError(strErrorMessage);return;}
blnLoaded=true;dtmStart=new Date();LoadContent();return;}
function ExecFinish(ExitType){WriteToDebug("In ExecFinish, ExiType="+ ExitType);ClearErrorInfo();if(blnLoaded&amp;&amp;!blnCalledFinish){WriteToDebug("Haven't called finish before, finishing");blnCalledFinish=true;if(blnReachedEnd){WriteToDebug("Reached End, overiding exit type to FINISH");ExitType=EXIT_TYPE_FINISH;}
if(!blnOverrodeTime){WriteToDebug("Did not override time");dtmEnd=new Date();AccumulateTime();objLMS.SaveTime(intAccumulatedMS);}
blnLoaded=false;WriteToDebug("Calling LMS Finish");return objLMS.Finish(ExitType,blnStatusWasSet);}
return true;}
function IsLoaded(){WriteToDebug("In IsLoaded, returning -"+ blnLoaded);return blnLoaded;}
function WriteToDebug(strInfo){if(blnDebug){var dtm=new Date();var strLine;strLine=aryDebug.length+":"+ dtm.toString()+" - "+ strInfo;aryDebug[aryDebug.length]=strLine;if(winDebug&amp;&amp;!winDebug.closed){winDebug.document.write(strLine+"&lt;br&gt;\n");}}
return;}
function ShowDebugWindow(){if(winDebug&amp;&amp;!winDebug.closed){winDebug.close();}
winDebug=window.open("blank.html","Debug","width=600,height=300,resizable,scrollbars");winDebug.document.write(aryDebug.join("&lt;br&gt;\n"));winDebug.document.close();winDebug.focus();return;}
function DisplayError(strMessage){var blnShowDebug;WriteToDebug("In DisplayError, strMessage="+ strMessage);blnShowDebug=confirm("An error has occured:\n\n"+ strMessage+"\n\nPress 'OK' to view debug information to send to technical support.");if(blnShowDebug){ShowDebugWindow();}}
function GetLastError(){WriteToDebug("In GetLastError, intError="+ intError);if(intError!=NO_ERROR){WriteToDebug("Returning API Error");return intError;}
else if(IsLoaded()&amp;&amp;objLMS.GetLastError()!=NO_ERROR){WriteToDebug("Returning LMS Error");return ERROR_LMS;}
WriteToDebug("Returning No Error");return NO_ERROR;}
function GetLastLMSErrorCode(){WriteToDebug("In GetLastLMSErrorCode, intError="+ intError);var LMSError=objLMS.GetLastError();if(IsLoaded()&amp;&amp;LMSError!=NO_ERROR){WriteToDebug("Returning LMS Error: "+ LMSError);return LMSError;}
WriteToDebug("Returning No Error");return NO_ERROR;}
function GetLastErrorDesc(){WriteToDebug("In GetLastErrorDesc");if(intError!=NO_ERROR){WriteToDebug("Returning API Error - "+ strErrorDesc);return strErrorDesc;}
else if(IsLoaded()&amp;&amp;objLMS.GetLastError()!=NO_ERROR){WriteToDebug("returning LMS Error");return objLMS.GetLastErrorDesc;}
WriteToDebug("Returning No Error");return"";}
function SetErrorInfo(intErrorNumToSet,strErrorDescToSet){WriteToDebug("In SetErrorInfo - Num="+ intErrorNumToSet+" Desc="+ strErrorDescToSet);intError=intErrorNumToSet;strErrorDesc=strErrorDescToSet;}
function ClearErrorInfo(){WriteToDebug("In ClearErrorInfo");var intError=NO_ERROR;var strErrorDesc="";}
function CommitData(){WriteToDebug("In CommitData");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!blnOverrodeTime){WriteToDebug("Did not override time, saving incremental time");dtmEnd=new Date();AccumulateTime();dtmStart=new Date();objLMS.SaveTime(intAccumulatedMS);}
return objLMS.CommitData();}
function Suspend(){WriteToDebug("In Suspend");ClearErrorInfo();return ExecFinish(EXIT_TYPE_SUSPEND);}
function Finish(){WriteToDebug("In Finish");ClearErrorInfo();return ExecFinish(EXIT_TYPE_FINISH);}
function TimeOut(){WriteToDebug("In TimeOut");ClearErrorInfo();return ExecFinish(EXIT_TYPE_TIMEOUT);}
function Unload(){WriteToDebug("In Unload");ClearErrorInfo();return ExecFinish(DEFAULT_EXIT_TYPE);}
function SetReachedEnd(){WriteToDebug("In SetReachedEnd");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(blnStatusWasSet==false){objLMS.SetCompleted();}
blnReachedEnd=true;return true;}
function ConcedeControl()
{WriteToDebug("Conceding control with type: "+ EXIT_BEHAVIOR);ClearErrorInfo();var contentRoot=null;var urlBase=null;switch(EXIT_BEHAVIOR)
{case"SCORM_RECOMMENDED":contentRoot=SearchParentsForContentRoot();if(contentRoot==window.top)
{Suspend();contentRoot.window.close();}
else
{Suspend();if(contentRoot!=null){if(IsAbsoluteUrl(EXIT_TARGET)){contentRoot.scormdriver_content.location.href=EXIT_TARGET;}else{urlBase=GetContentRootUrlBase(contentRoot);contentRoot.scormdriver_content.location.href=urlBase+ EXIT_TARGET;}}}
break;case"ALWAYS_CLOSE":Suspend();window.close();break;case"ALWAYS_CLOSE_TOP":Suspend();window.top.close();break;case"NOTHING":Suspend();break;case"REDIR_CONTENT_FRAME":Suspend();contentRoot=SearchParentsForContentRoot();if(contentRoot!=null){if(IsAbsoluteUrl(EXIT_TARGET)){contentRoot.scormdriver_content.location.href=EXIT_TARGET;}else{urlBase=GetContentRootUrlBase(contentRoot);contentRoot.scormdriver_content.location.href=urlBase+ EXIT_TARGET;}}
break;}
return true;}
function GetContentRootUrlBase(contentRoot){var urlParts=contentRoot.location.href.split("/");delete urlParts[urlParts.length- 1];contentRoot=urlParts.join("/");return contentRoot;}
function SearchParentsForContentRoot(){var contentRoot=null;var wnd=window;var i=0;if(wnd.scormdriver_content){contentRoot=wnd;return contentRoot;}
while(contentRoot==null&amp;&amp;wnd!=window.top&amp;&amp;(i++&lt;100)){if(wnd.scormdriver_content){contentRoot=wnd;return contentRoot;}
else{wnd=wnd.parent;}}
WriteToDebug("Unable to locate content root");return null;}
function GetStudentID(){WriteToDebug("In GetStudentID");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetStudentID();}
function GetStudentName(){WriteToDebug("In GetStudentName");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetStudentName();}
function GetBookmark(){WriteToDebug("In GetBookmark");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetBookmark();}
function SetBookmark(strBookmark){WriteToDebug("In SetBookmkar - strBookmark="+ strBookmark);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.SetBookmark(strBookmark);}
function GetDataChunk(){WriteToDebug("In GetDataChunk");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetDataChunk();}
function SetDataChunk(strData){WriteToDebug("In SetDataChunk strData="+ strData);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.SetDataChunk(strData);}
function GetLaunchData(){WriteToDebug("In GetLaunchData");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetLaunchData();}
function GetComments(){var strCommentString;var aryComments;var i;WriteToDebug("In GetComments");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return null;}
strCommentString=objLMS.GetComments();WriteToDebug("strCommentString="+ strCommentString);strCommentString=new String(strCommentString);if(strCommentString!=""){aryComments=strCommentString.split(" | ");for(i=0;i&lt;aryComments.length;i++){WriteToDebug("Returning Comment #"+ i);aryComments[i]=new String(aryComments[i]);aryComments[i]=aryComments[i].replace(/\|\|/g,"|");WriteToDebug("Comment #"+ i+"="+ aryComments[i]);}}
else{aryComments=new Array(0);}
return aryComments;}
function WriteComment(strComment){var strExistingCommentString;WriteToDebug("In WriteComment strComment="+ strComment);ClearErrorInfo();strComment=new String(strComment);if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strComment=strComment.replace(/\|/g,"||");strExistingCommentString=objLMS.GetComments();if(strExistingCommentString!=""){strComment=" | "+ strComment;}
strComment=strComment;return objLMS.WriteComment(strComment);}
function GetLMSComments(){WriteToDebug("In GetLMSComments");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetLMSComments();}
function GetAudioPlayPreference(){WriteToDebug("In GetAudioPlayPreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return PREFERENCE_DEFAULT;}
return objLMS.GetAudioPlayPreference();}
function GetAudioVolumePreference(){WriteToDebug("GetAudioVolumePreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 100;}
return objLMS.GetAudioVolumePreference();}
function SetAudioPreference(PlayPreference,intPercentOfMaxVolume){WriteToDebug("In SetAudioPreference PlayPreference="+ PlayPreference+" intPercentOfMaxVolume="+ intPercentOfMaxVolume);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(PlayPreference!=PREFERENCE_OFF&amp;&amp;PlayPreference!=PREFERENCE_ON){WriteToDebug("Error Invalid PlayPreference");SetErrorInfo(ERROR_INVALID_PREFERENCE,"Invalid PlayPreference passed to SetAudioPreference, PlayPreference="+ PlayPreference);return false;}
if(!ValidInteger(intPercentOfMaxVolume)){WriteToDebug("Error Invalid PercentOfMaxVolume - not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid PercentOfMaxVolume passed to SetAudioPreference (not an integer), intPercentOfMaxVolume="+ intPercentOfMaxVolume);return false;}
intPercentOfMaxVolume=parseInt(intPercentOfMaxVolume,10);if(intPercentOfMaxVolume&lt;1||intPercentOfMaxVolume&gt;100){WriteToDebug("Error Invalid PercentOfMaxVolume - out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid PercentOfMaxVolume passed to SetAudioPreference (must be between 1 and 100), intPercentOfMaxVolume="+ intPercentOfMaxVolume);return false;}
WriteToDebug("Calling to LMS");return objLMS.SetAudioPreference(PlayPreference,intPercentOfMaxVolume);}
function GetLanguagePreference(){WriteToDebug("In GetLanguagePreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetLanguagePreference();}
function SetLanguagePreference(strLanguage){WriteToDebug("In SetLanguagePreference strLanguage="+ strLanguage);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.SetLanguagePreference(strLanguage);}
function GetSpeedPreference(){WriteToDebug("In GetSpeedPreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 100;}
return objLMS.GetSpeedPreference();}
function SetSpeedPreference(intPercentOfMax){WriteToDebug("In SetSpeedPreference intPercentOfMax="+ intPercentOfMax);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!ValidInteger(intPercentOfMax)){WriteToDebug("ERROR Invalid Percent of MaxSpeed, not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid PercentOfMaxSpeed passed to SetSpeedPreference (not an integer), intPercentOfMax="+ intPercentOfMax);return false;}
intPercentOfMax=parseInt(intPercentOfMax,10);if(intPercentOfMax&lt;0||intPercentOfMax&gt;100){WriteToDebug("ERROR Invalid Percent of MaxSpeed, out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid PercentOfMaxSpeed passed to SetSpeedPreference (must be between 1 and 100), intPercentOfMax="+ intPercentOfMax);return false;}
WriteToDebug("Calling to LMS");return objLMS.SetSpeedPreference(intPercentOfMax);}
function GetTextPreference(){WriteToDebug("In GetTextPreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetTextPreference();}
function SetTextPreference(intPreference){WriteToDebug("In SetTextPreference intPreference="+ intPreference);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(intPreference!=PREFERENCE_DEFAULT&amp;&amp;intPreference!=PREFERENCE_OFF&amp;&amp;intPreference!=PREFERENCE_ON){WriteToDebug("Error - Invalid Preference");SetErrorInfo(ERROR_INVALID_PREFERENCE,"Invalid Preference passed to SetTextPreference, intPreference="+ intPreference);return false;}
return objLMS.SetTextPreference(intPreference);}
function GetPreviouslyAccumulatedTime(){WriteToDebug("In GetPreviouslyAccumulatedTime");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 0;}
return objLMS.GetPreviouslyAccumulatedTime();}
function AccumulateTime(){WriteToDebug("In AccumulateTime dtmStart="+ dtmStart+" dtmEnd="+ dtmEnd+" intAccumulatedMS="+ intAccumulatedMS);if(dtmEnd!=null&amp;&amp;dtmStart!=null){WriteToDebug("Accumulating Time");intAccumulatedMS+=(dtmEnd.getTime()- dtmStart.getTime());WriteToDebug("intAccumulatedMS="+ intAccumulatedMS);}}
function GetSessionAccumulatedTime(){WriteToDebug("In GetSessionAccumulatedTime");ClearErrorInfo();WriteToDebug("Setting dtmEnd to now");dtmEnd=new Date();WriteToDebug("Accumulating Time");AccumulateTime();if(dtmStart!=null){WriteToDebug("Resetting dtmStart");dtmStart=new Date();}
WriteToDebug("Setting dtmEnd to null");dtmEnd=null;WriteToDebug("Returning "+ intAccumulatedMS);return intAccumulatedMS;}
function SetSessionTime(intMilliseconds){WriteToDebug("In SetSessionTime");ClearErrorInfo();if(!ValidInteger(intMilliseconds)){WriteToDebug("ERROR parameter is not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid intMilliseconds passed to SetSessionTime (not an integer), intMilliseconds="+ intMilliseconds);return false;}
intMilliseconds=parseInt(intMilliseconds,10);if(intMilliseconds&lt;0){WriteToDebug("Error, parameter is less than 0");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid intMilliseconds passed to SetSessionTime (must be greater than 0), intMilliseconds="+ intMilliseconds);return false;}
blnOverrodeTime=true;intTimeOverrideMS=intMilliseconds;objLMS.SaveTime(intTimeOverrideMS);return true;}
function PauseTimeTracking(){WriteToDebug("In PauseTimeTracking");ClearErrorInfo();WriteToDebug("Setting dtmEnd to now");dtmEnd=new Date();WriteToDebug("Accumulating Time");AccumulateTime();WriteToDebug("Setting Start and End times to null");dtmStart=null;dtmEnd=null;return true;}
function ResumeTimeTracking(){WriteToDebug("In ResumeTimeTracking");ClearErrorInfo();WriteToDebug("Setting dtmStart to now");dtmStart=new Date();return true;}
function GetMaxTimeAllowed(){WriteToDebug("In GetMaxTimeAllowed");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return MAX_CMI_TIME;}
return objLMS.GetMaxTimeAllowed();}
function DisplayMessageOnTimeout(){WriteToDebug("In DisplayMessageOnTimeOut");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.DisplayMessageOnTimeout();}
function ExitOnTimeout(){WriteToDebug("In ExitOnTimeOut");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.ExitOnTimeout();}
function GetPassingScore(){WriteToDebug("In GetPassingScore");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 0;}
return objLMS.GetPassingScore();}
function GetScore(){WriteToDebug("In GetScore");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 0;}
return objLMS.GetScore();}
function GetScaledScore(){WriteToDebug("In GetScaledScore");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 0;}
return objLMS.GetScaledScore();}
function SetScore(intScore,intMaxScore,intMinScore){WriteToDebug("In SetScore, intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!IsValidDecimal(intScore)){WriteToDebug("ERROR - intScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetScore (not a valid decimal), intScore="+ intScore);return false;}
if(!IsValidDecimal(intMaxScore)){WriteToDebug("ERROR - intMaxScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetScore (not a valid decimal), intMaxScore="+ intMaxScore);return false;}
if(!IsValidDecimal(intMinScore)){WriteToDebug("ERROR - intMinScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetScore (not a valid decimal), intMinScore="+ intMinScore);return false;}
WriteToDebug("Converting SCORES to floats");intScore=parseFloat(intScore);intMaxScore=parseFloat(intMaxScore);intMinScore=parseFloat(intMinScore);if(intScore&lt;0||intScore&gt;100){WriteToDebug("ERROR - intScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetScore (must be between 0-100), intScore="+ intScore);return false;}
if(intMaxScore&lt;0||intMaxScore&gt;100){WriteToDebug("ERROR - intMaxScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetScore (must be between 0-100), intMaxScore="+ intMaxScore);return false;}
if(intMinScore&lt;0||intMinScore&gt;100){WriteToDebug("ERROR - intMinScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetScore (must be between 0-100), intMinScore="+ intMinScore);return false;}
if(SCORE_CAN_ONLY_IMPROVE===true){var previousScore=GetScore();if(previousScore!=null&amp;&amp;previousScore!=""&amp;&amp;previousScore&gt;intScore){WriteToDebug("Previous score was greater than new score, configuration only allows scores to improve, returning.");return true;}}
WriteToDebug("Calling to LMS");return objLMS.SetScore(intScore,intMaxScore,intMinScore);}
function SetPointBasedScore(intScore,intMaxScore,intMinScore){WriteToDebug("In SetPointBasedScore, intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!IsValidDecimal(intScore)){WriteToDebug("ERROR - intScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetScore (not a valid decimal), intScore="+ intScore);return false;}
if(!IsValidDecimal(intMaxScore)){WriteToDebug("ERROR - intMaxScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetScore (not a valid decimal), intMaxScore="+ intMaxScore);return false;}
if(!IsValidDecimal(intMinScore)){WriteToDebug("ERROR - intMinScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetScore (not a valid decimal), intMinScore="+ intMinScore);return false;}
WriteToDebug("Converting SCORES to floats");intScore=parseFloat(intScore);intMaxScore=parseFloat(intMaxScore);intMinScore=parseFloat(intMinScore);if(intScore&lt;0||intScore&gt;100){WriteToDebug("ERROR - intScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetScore (must be between 0-100), intScore="+ intScore);return false;}
if(intMaxScore&lt;0||intMaxScore&gt;100){WriteToDebug("ERROR - intMaxScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetScore (must be between 0-100), intMaxScore="+ intMaxScore);return false;}
if(intMinScore&lt;0||intMinScore&gt;100){WriteToDebug("ERROR - intMinScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetScore (must be between 0-100), intMinScore="+ intMinScore);return false;}
if(SCORE_CAN_ONLY_IMPROVE===true){var previousScore=GetScore();if(previousScore!=null&amp;&amp;previousScore!=""&amp;&amp;previousScore&gt;intScore){WriteToDebug("Previous score was greater than new score, configuration only allows scores to improve, returning.");return true;}}
WriteToDebug("Calling to LMS");return objLMS.SetPointBasedScore(intScore,intMaxScore,intMinScore);}
function CreateResponseIdentifier(strShort,strLong){if(strShort.replace(" ","")==""){WriteToDebug("Short Identifier is empty");SetErrorInfo(ERROR_INVALID_ID,"Invalid short identifier, strShort="+ strShort);return false;}
if(strShort.length!=1){WriteToDebug("ERROR - Short Identifier  not 1 character");SetErrorInfo(ERROR_INVALID_ID,"Invalid short identifier, strShort="+ strShort);return false;}
if(!IsAlphaNumeric(strShort)){WriteToDebug("ERROR - Short Identifier  not alpha numeric");SetErrorInfo(ERROR_INVALID_ID,"Invalid short identifier, strShort="+ strShort);return false;}
strShort=strShort.toLowerCase();strLong=CreateValidIdentifier(strLong);return new ResponseIdentifier(strShort,strLong);}
function ResponseIdentifier(strShort,strLong){this.Short=new String(strShort);this.Long=new String(strLong);this.toString=function(){return"[Response Identifier "+ this.Short+", "+ this.Long+"]";};}
function MatchingResponse(source,target){if(source.constructor==String){source=CreateResponseIdentifier(source,source);}
if(target.constructor==String){target=CreateResponseIdentifier(target,target);}
this.Source=source;this.Target=target;this.toString=function(){return"[Matching Response "+ this.Source+", "+ this.Target+"]";};}
function CreateMatchingResponse(pattern)
{var aryPairs=new Array();var aryEachPair=new Array();pattern=new String(pattern);aryPairs=pattern.split("[,]");for(var i=0;i&lt;aryPairs.length;i++)
{var thisPair=new String(aryPairs[i]);aryEachPair=thisPair.split("[.]");WriteToDebug("Matching Response ["+ i+"]  source: "+ aryEachPair[0]+"  target: "+ aryEachPair[1]);aryPairs[i]=new MatchingResponse(aryEachPair[0],aryEachPair[1]);}
WriteToDebug("pattern: "+ pattern+" becomes "+ aryPairs[0]);if(aryPairs.length==0)return aryPairs[0];else return aryPairs;}
function CreateValidIdentifier(str){str=new String(str);str=Trim(str);if(str.toLowerCase().indexOf("urn:")==0){str=str.substr(4);}
str=str.replace(/[^\w\-\(\)\+\.\:\=\@\;\$\_\!\*\'\%]/g,"_");return str;}
function Trim(str){str=str.replace(/^\s*/,"");str=str.replace(/\s*$/,"");return str;}
function RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordTrueFalseInteraction strID="+ strID+", blnResponse="+ blnResponse+", blnCorrect="+ blnCorrect+", blnCorrectResponse="+ blnCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(blnResponse!=true&amp;&amp;blnResponse!=false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The Response parameter must be a valid boolean value.");return false;}
if(blnCorrectResponse!=null&amp;&amp;blnCorrectResponse!=true&amp;&amp;blnCorrectResponse!=false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The Correct Response parameter must be a valid boolean value or null.");return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordMultipleChoiceInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordMultipleChoiceInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strID=new String(strID);var aryResponse;var aryCorrectResponse;if(response.constructor==String){aryResponse=new Array();var responseIdentifier=CreateResponseIdentifier(response,response);if(responseIdentifier==false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
aryResponse[0]=responseIdentifier;}
else if(response.constructor==ResponseIdentifier){aryResponse=new Array();aryResponse[0]=response;}
else if(response.constructor==Array||response.constructor.toString().search("Array")&gt;0){aryResponse=response;}
else if(window.console&amp;&amp;response.constructor.toString()=='(Internal Function)'&amp;&amp;response.length&gt;0){aryResponse=response;}
else{if(window.console){window.console.log("ERROR_INVALID_INTERACTION_RESPONSE :: The response is not in the correct format.");}
SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
if(correctResponse!=null&amp;&amp;correctResponse!=undefined&amp;&amp;correctResponse!=""){if(correctResponse.constructor==String){aryCorrectResponse=new Array();responseIdentifier=CreateResponseIdentifier(correctResponse,correctResponse);if(responseIdentifier==false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The correct response is not in the correct format");return false;}
aryCorrectResponse[0]=responseIdentifier;}
else if(correctResponse.constructor==ResponseIdentifier){aryCorrectResponse=new Array();aryCorrectResponse[0]=correctResponse;}
else if(correctResponse.constructor==Array||correctResponse.constructor.toString().search("Array")&gt;0){aryCorrectResponse=correctResponse;}
else if(window.console&amp;&amp;correctResponse.constructor.toString()=='(Internal Function)'&amp;&amp;correctResponse.length&gt;0){aryCorrectResponse=correctResponse;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The correct response is not in the correct format");return false;}}
else{aryCorrectResponse=new Array();}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordMultipleChoiceInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordFillInInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordMatchingInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordMatchingInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var aryResponse;var aryCorrectResponse;if(response.constructor==MatchingResponse){aryResponse=new Array();aryResponse[0]=response;}
else if(response.constructor==Array||response.constructor.toString().search("Array")&gt;0){aryResponse=response;}
else if(window.console&amp;&amp;response.constructor.toString()=='(Internal Function)'&amp;&amp;response.length&gt;0){aryResponse=response;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
if(correctResponse!=null&amp;&amp;correctResponse!=undefined){if(correctResponse.constructor==MatchingResponse){aryCorrectResponse=new Array();aryCorrectResponse[0]=correctResponse;}
else if(correctResponse.constructor==Array||correctResponse.constructor.toString().search("Array")&gt;0){aryCorrectResponse=correctResponse;}
else if(window.console&amp;&amp;correctResponse.constructor.toString()=='(Internal Function)'&amp;&amp;correctResponse.length&gt;0){aryCorrectResponse=correctResponse;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}}
else{aryCorrectResponse=new Array();}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordMatchingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordPerformanceInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordSequencingInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordSequencingInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var aryResponse;var aryCorrectResponse;if(response.constructor==String){aryResponse=new Array();var responseIdentifier=CreateResponseIdentifier(response,response);if(responseIdentifier==false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
aryResponse[0]=responseIdentifier;}
else if(response.constructor==ResponseIdentifier){aryResponse=new Array();aryResponse[0]=response;}
else if(response.constructor==Array||response.constructor.toString().search("Array")&gt;0){aryResponse=response;}
else if(window.console&amp;&amp;response.constructor.toString()=='(Internal Function)'&amp;&amp;response.length&gt;0){aryResponse=response;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
if(correctResponse!=null&amp;&amp;correctResponse!=undefined&amp;&amp;correctResponse!=""){if(correctResponse.constructor==String){aryCorrectResponse=new Array();responseIdentifier=CreateResponseIdentifier(correctResponse,correctResponse);if(responseIdentifier==false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The correct response is not in the correct format");return false;}
aryCorrectResponse[0]=responseIdentifier;}
else if(correctResponse.constructor==ResponseIdentifier){aryCorrectResponse=new Array();aryCorrectResponse[0]=correctResponse;}
else if(correctResponse.constructor==Array||correctResponse.constructor.toString().search("Array")&gt;0){aryCorrectResponse=correctResponse;}
else if(window.console&amp;&amp;correctResponse.constructor.toString()=='(Internal Function)'&amp;&amp;correctResponse.length&gt;0){aryCorrectResponse=correctResponse;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The correct response is not in the correct format");return false;}}
else{aryCorrectResponse=new Array();}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordSequencingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordLikertInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordLikertInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var riResponse;var riCorrectResponse;if(response.constructor==String){riResponse=CreateResponseIdentifier(response,response);}
else if(response.constructor==ResponseIdentifier){riResponse=response;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
if(correctResponse==null||correctResponse==undefined){riCorrectResponse=null;}
else if(correctResponse.constructor==ResponseIdentifier){riCorrectResponse=correctResponse;}
else if(correctResponse.constructor==String){riCorrectResponse=CreateResponseIdentifier(correctResponse,correctResponse);}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordLikertInteraction(strID,riResponse,blnCorrect,riCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordNumericInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!IsValidDecimal(strResponse)){WriteToDebug("ERROR - Invalid Response, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Response passed to RecordNumericInteraction (not a valid decimal), strResponse="+ strResponse);return false;}
if(strCorrectResponse!=undefined&amp;&amp;strCorrectResponse!=null&amp;&amp;IsValidDecimal(strCorrectResponse)==false){WriteToDebug("ERROR - Invalid Correct Response, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Correct Response passed to RecordNumericInteraction (not a valid decimal), strCorrectResponse="+ strCorrectResponse);return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function GetStatus(){WriteToDebug("In GetStatus");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return LESSON_STATUS_INCOMPLETE;}
return objLMS.GetStatus();}
function ResetStatus(){WriteToDebug("In ResetStatus");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
WriteToDebug("Setting blnStatusWasSet to false");blnStatusWasSet=false;return objLMS.ResetStatus();}
function GetProgressMeasure(){WriteToDebug("In GetProgressMeasure");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return LESSON_STATUS_INCOMPLETE;}
return objLMS.GetProgressMeasure();}
function SetProgressMeasure(numMeasure){WriteToDebug("In SetProgressMeasure, passing in: "+ numMeasure);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return LESSON_STATUS_INCOMPLETE;}
return objLMS.SetProgressMeasure(numMeasure);}
function SetPassed(){WriteToDebug("In SetPassed");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
WriteToDebug("Setting blnStatusWasSet to true");blnStatusWasSet=true;return objLMS.SetPassed();}
function SetFailed(){WriteToDebug("In SetFailed");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
WriteToDebug("Setting blnStatusWasSet to true");blnStatusWasSet=true;return objLMS.SetFailed();}
function GetEntryMode(){WriteToDebug("In GetEntryMode");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return ENTRY_FIRST_TIME;}
return objLMS.GetEntryMode();}
function GetLessonMode(){WriteToDebug("In GetLessonMode");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return MODE_NORMAL;}
return objLMS.GetLessonMode();}
function GetTakingForCredit(){WriteToDebug("In GetTakingForCredit");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetTakingForCredit();}
function SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){WriteToDebug("In SetObjectiveScore, intObjectiveID="+ strObjectiveID+", intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strObjectiveID=new String(strObjectiveID);if(strObjectiveID.replace(" ","")==""){WriteToDebug("ERROR - Invalid ObjectiveID, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid ObjectiveID passed to SetObjectiveScore (must have a value), strObjectiveID="+ strObjectiveID);return false;}
if(!IsValidDecimal(intScore)){WriteToDebug("ERROR - Invalid Score, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetObjectiveScore (not a valid decimal), intScore="+ intScore);return false;}
if(!IsValidDecimal(intMaxScore)){WriteToDebug("ERROR - Invalid Max Score, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetObjectiveScore (not a valid decimal), intMaxScore="+ intMaxScore);return false;}
if(!IsValidDecimal(intMinScore)){WriteToDebug("ERROR - Invalid Min Score, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetObjectiveScore (not a valid decimal), intMinScore="+ intMinScore);return false;}
WriteToDebug("Converting Scores to floats");intScore=parseFloat(intScore);intMaxScore=parseFloat(intMaxScore);intMinScore=parseFloat(intMinScore);if(intScore&lt;0||intScore&gt;100){WriteToDebug("ERROR - Invalid Score, out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetObjectiveScore (must be between 0-100), intScore="+ intScore);return false;}
if(intMaxScore&lt;0||intMaxScore&gt;100){WriteToDebug("ERROR - Invalid Max Score, out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetObjectiveScore (must be between 0-100), intMaxScore="+ intMaxScore);return false;}
if(intMinScore&lt;0||intMinScore&gt;100){WriteToDebug("ERROR - Invalid Min Score, out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetObjectiveScore (must be between 0-100), intMinScore="+ intMinScore);return false;}
WriteToDebug("Calling To LMS");return objLMS.SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore);}
function SetObjectiveStatus(strObjectiveID,Lesson_Status){WriteToDebug("In SetObjectiveStatus strObjectiveID="+ strObjectiveID+", Lesson_Status="+ Lesson_Status);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strObjectiveID=new String(strObjectiveID);if(strObjectiveID.replace(" ","")==""){WriteToDebug("ERROR - Invalid ObjectiveID, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid ObjectiveID passed to SetObjectiveStatus (must have a value), strObjectiveID="+ strObjectiveID);return false;}
if((Lesson_Status!=LESSON_STATUS_PASSED)&amp;&amp;(Lesson_Status!=LESSON_STATUS_COMPLETED)&amp;&amp;(Lesson_Status!=LESSON_STATUS_FAILED)&amp;&amp;(Lesson_Status!=LESSON_STATUS_INCOMPLETE)&amp;&amp;(Lesson_Status!=LESSON_STATUS_BROWSED)&amp;&amp;(Lesson_Status!=LESSON_STATUS_NOT_ATTEMPTED)){WriteToDebug("ERROR - Invalid Status");SetErrorInfo(ERROR_INVALID_STATUS,"Invalid status passed to SetObjectiveStatus, Lesson_Status="+ Lesson_Status);return false;}
WriteToDebug("Calling To LMS");return objLMS.SetObjectiveStatus(strObjectiveID,Lesson_Status);}
function GetObjectiveStatus(strObjectiveID){WriteToDebug("In GetObjectiveStatus, strObjectiveID="+ strObjectiveID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetObjectiveStatus(strObjectiveID);}
function SetObjectiveDescription(strObjectiveID,strObjectiveDescription){WriteToDebug("In SetObjectiveDescription strObjectiveID="+ strObjectiveID+", strObjectiveDescription="+ strObjectiveDescription);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strObjectiveID=new String(strObjectiveID);if(strObjectiveID.replace(" ","")==""){WriteToDebug("ERROR - Invalid ObjectiveID, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid ObjectiveID passed to SetObjectiveStatus (must have a value), strObjectiveID="+ strObjectiveID);return false;}
WriteToDebug("Calling To LMS");return objLMS.SetObjectiveDescription(strObjectiveID,strObjectiveDescription);}
function GetObjectiveDescription(strObjectiveID){WriteToDebug("In GetObjectiveDescription, strObjectiveID="+ strObjectiveID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetObjectiveDescription(strObjectiveID);}
function GetObjectiveScore(strObjectiveID){WriteToDebug("In GetObjectiveScore, strObjectiveID="+ strObjectiveID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetObjectiveScore(strObjectiveID);}
function IsLmsPresent(){return blnLmsPresent;}
function SetObjectiveProgressMeasure(strObjectiveID,strObjectiveProgressMeasure){WriteToDebug("In SetObjectiveProgressMeasure strObjectiveID="+ strObjectiveID+", strObjectiveProgressMeasure="+ strObjectiveProgressMeasure);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strObjectiveID=new String(strObjectiveID);if(strObjectiveID.replace(" ","")==""){WriteToDebug("ERROR - Invalid ObjectiveID, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid ObjectiveID passed to SetObjectiveProgressMeasure (must have a value), strObjectiveID="+ strObjectiveID);return false;}
WriteToDebug("Calling To LMS");return objLMS.SetObjectiveProgressMeasure(strObjectiveID,strObjectiveProgressMeasure);}
function GetObjectiveProgressMeasure(strObjectiveID){WriteToDebug("In GetObjectiveProgressMeasure, strObjectiveID="+ strObjectiveID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetObjectiveProgressMeasure(strObjectiveID);}
function GetInteractionType(strInteractionID)
{WriteToDebug("In GetInteractionType, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionType(strInteractionID);}
function GetInteractionTimestamp(strInteractionID)
{WriteToDebug("In GetInteractionTimestamp, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionTimestamp(strInteractionID);}
function GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("In GetInteractionCorrectResponses, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionCorrectResponses(strInteractionID);}
function GetInteractionWeighting(strInteractionID)
{WriteToDebug("In GetInteractionWeighting, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionWeighting(strInteractionID);}
function GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("In GetInteractionLearnerResponses, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionLearnerResponses(strInteractionID);}
function GetInteractionResult(strInteractionID)
{WriteToDebug("In GetInteractionResult, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionResult(strInteractionID);}
function GetInteractionLatency(strInteractionID)
{WriteToDebug("In GetInteractionLatency, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionLatency(strInteractionID);}
function GetInteractionDescription(strInteractionID)
{WriteToDebug("In GetInteractionDescription, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionDescription(strInteractionID);}
function CreateDataBucket(strBucketId,intMinSize,intMaxSize){WriteToDebug("In CreateDataBucket, strBucketId="+ strBucketId+", intMinSize="+ intMinSize+", intMaxSize="+ intMaxSize);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strBucketId=new String(strBucketId);if(strBucketId.replace(" ","")==""){WriteToDebug("ERROR - Invalid BucketId, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid strBucketId passed to CreateDataBucket (must have a value), strBucketId="+ strBucketId);return false;}
if(!ValidInteger(intMinSize)){WriteToDebug("ERROR Invalid Min Size, not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid intMinSize passed to CreateDataBucket (not an integer), intMinSize="+ intMinSize);return false;}
if(!ValidInteger(intMaxSize)){WriteToDebug("ERROR Invalid Max Size, not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid intMaxSize passed to CreateDataBucket (not an integer), intMaxSize="+ intMaxSize);return false;}
intMinSize=parseInt(intMinSize,10);intMaxSize=parseInt(intMaxSize,10);if(intMinSize&lt;0){WriteToDebug("ERROR Invalid Min Size, must be greater than or equal to 0");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Size passed to CreateDataBucket (must be greater than or equal to 0), intMinSize="+ intMinSize);return false;}
if(intMaxSize&lt;=0){WriteToDebug("ERROR Invalid Max Size, must be greater than 0");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Size passed to CreateDataBucket (must be greater than 0), intMaxSize="+ intMaxSize);return false;}
intMinSize=(intMinSize*2);intMaxSize=(intMaxSize*2);return objLMS.CreateDataBucket(strBucketId,intMinSize,intMaxSize);}
function GetDataFromBucket(strBucketId){WriteToDebug("In GetDataFromBucket, strBucketId="+ strBucketId);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strBucketId=new String(strBucketId);if(strBucketId.replace(" ","")==""){WriteToDebug("ERROR - Invalid BucketId, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid strBucketId passed to GetDataFromBucket (must have a value), strBucketId="+ strBucketId);return false;}
return objLMS.GetDataFromBucket(strBucketId);}
function PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("In PutDataInBucket, strBucketId="+ strBucketId+", blnAppendToEnd="+ blnAppendToEnd+", strData="+ strData);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strBucketId=new String(strBucketId);if(strBucketId.replace(" ","")==""){WriteToDebug("ERROR - Invalid BucketId, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid strBucketId passed to PutDataInBucket (must have a value), strBucketId="+ strBucketId);return false;}
if(blnAppendToEnd!=true){WriteToDebug("blnAppendToEnd was not explicitly true so setting it to false, blnAppendToEnd="+ blnAppendToEnd);blnAppendToEnd=false;}
return objLMS.PutDataInBucket(strBucketId,strData,blnAppendToEnd);}
function DetectSSPSupport(){return objLMS.DetectSSPSupport();}
function GetBucketInfo(strBucketId){WriteToDebug("In GetBucketInfo, strBucketId="+ strBucketId);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strBucketId=new String(strBucketId);if(strBucketId.replace(" ","")==""){WriteToDebug("ERROR - Invalid BucketId, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid strBucketId passed to GetBucketInfo (must have a value), strBucketId="+ strBucketId);return false;}
var bucketInfo=objLMS.GetBucketInfo(strBucketId);bucketInfo.TotalSpace=(bucketInfo.TotalSpace/2);bucketInfo.UsedSpace=(bucketInfo.UsedSpace/2);WriteToDebug("GetBucketInfo returning "+ bucketInfo);return bucketInfo;}
function SSPBucketSize(totalSpace,usedSpace){this.TotalSpace=totalSpace;this.UsedSpace=usedSpace;this.toString=function(){return"[SSPBucketSize "+ this.TotalSpace+", "+ this.UsedSpace+"]";};}</text>
				</content>
				<redirectionURL/>
				<headersSize>277</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/APIConstants.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>371</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="APIConstants.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var VERSION="3.8.2";var PREFERENCE_DEFAULT=0;var PREFERENCE_OFF=-1;var PREFERENCE_ON=1;var LESSON_STATUS_PASSED=1;var LESSON_STATUS_COMPLETED=2;var LESSON_STATUS_FAILED=3;var LESSON_STATUS_INCOMPLETE=4;var LESSON_STATUS_BROWSED=5;var LESSON_STATUS_NOT_ATTEMPTED=6;var ENTRY_REVIEW=1;var ENTRY_FIRST_TIME=2;var ENTRY_RESUME=3;var MODE_NORMAL=1;var MODE_BROWSE=2;var MODE_REVIEW=3;var MAX_CMI_TIME=36002439990;var NO_ERROR=0;var ERROR_LMS=1;var ERROR_INVALID_PREFERENCE=2;var ERROR_INVALID_NUMBER=3;var ERROR_INVALID_ID=4;var ERROR_INVALID_STATUS=5;var ERROR_INVALID_RESPONSE=6;var ERROR_NOT_LOADED=7;var ERROR_INVALID_INTERACTION_RESPONSE=8;var EXIT_TYPE_SUSPEND="SUSPEND";var EXIT_TYPE_FINISH="FINISH";var EXIT_TYPE_TIMEOUT="TIMEOUT";var EXIT_TYPE_UNLOAD="UNLOAD";var INTERACTION_RESULT_CORRECT="CORRECT";var INTERACTION_RESULT_WRONG="WRONG";var INTERACTION_RESULT_UNANTICIPATED="UNANTICIPATED";var INTERACTION_RESULT_NEUTRAL="NEUTRAL";var INTERACTION_TYPE_TRUE_FALSE="true-false";var INTERACTION_TYPE_CHOICE="choice";var INTERACTION_TYPE_FILL_IN="fill-in";var INTERACTION_TYPE_LONG_FILL_IN="long-fill-in";var INTERACTION_TYPE_MATCHING="matching";var INTERACTION_TYPE_PERFORMANCE="performance";var INTERACTION_TYPE_SEQUENCING="sequencing";var INTERACTION_TYPE_LIKERT="likert";var INTERACTION_TYPE_NUMERIC="numeric";var DATA_CHUNK_PAIR_SEPARATOR='###';var DATA_CHUNK_VALUE_SEPARATOR='$$';</text>
				</content>
				<redirectionURL/>
				<headersSize>286</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/Configuration.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>372</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="Configuration.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>MISS</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var blnDebug=true;var strLMSStandard="SCORM";var DEFAULT_EXIT_TYPE=EXIT_TYPE_SUSPEND;var AICC_LESSON_ID="1";var EXIT_BEHAVIOR="SCORM_RECOMMENDED";var EXIT_TARGET="lms/goodbye.html";var LMS_SPECIFIED_REDIRECT_EVAL_STATEMENT="";var AICC_COMM_DISABLE_XMLHTTP=false;var AICC_COMM_DISABLE_IFRAME=false;var AICC_COMM_PREPEND_HTTP_IF_MISSING=true;var AICC_REPORT_MIN_MAX_SCORE=false;var SHOW_DEBUG_ON_LAUNCH=false;var DO_NOT_REPORT_INTERACTIONS=false;var SCORE_CAN_ONLY_IMPROVE=false;var REVIEW_MODE_IS_READ_ONLY=true;var AICC_RE_CHECK_LOADED_INTERVAL=250;var AICC_RE_CHECK_ATTEMPTS_BEFORE_TIMEOUT=240;var USE_AICC_KILL_TIME=true;var AICC_ENTRY_FLAG_DEFAULT=ENTRY_REVIEW;var FORCED_COMMIT_TIME="60000";var ALLOW_NONE_STANDARD=true;var USE_2004_SUSPENDALL_NAVREQ=false;</text>
				</content>
				<redirectionURL/>
				<headersSize>288</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/UtilityFunctions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>375</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="UtilityFunctions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>function GetQueryStringValue(strElement,strQueryString){var aryPairs;var foundValue;strQueryString=strQueryString.substring(1);aryPairs=strQueryString.split("&amp;");foundValue=SearchQueryStringPairs(aryPairs,strElement);if(foundValue===null){aryPairs=strQueryString.split(/[\?\&amp;]/);foundValue=SearchQueryStringPairs(aryPairs,strElement);}
if(foundValue===null){WriteToDebug("GetQueryStringValue Element '"+ strElement+"' Not Found, Returning: empty string");return"";}
else{WriteToDebug("GetQueryStringValue for '"+ strElement+"' Returning: "+ foundValue);return foundValue;}}
function SearchQueryStringPairs(aryPairs,strElement){var i;var intEqualPos;var strArg="";var strValue="";strElement=strElement.toLowerCase();for(i=0;i&lt;aryPairs.length;i++){intEqualPos=aryPairs[i].indexOf('=');if(intEqualPos!=-1){strArg=aryPairs[i].substring(0,intEqualPos);if(EqualsIgnoreCase(strArg,strElement)){strValue=aryPairs[i].substring(intEqualPos+1);strValue=new String(strValue)
strValue=strValue.replace(/\+/g,"%20")
strValue=unescape(strValue);return new String(strValue);}}}
return null;}
function ConvertStringToBoolean(str){var intTemp;if(EqualsIgnoreCase(str,"true")||EqualsIgnoreCase(str,"t")||str.toLowerCase().indexOf("t")==0){return true;}
else{intTemp=parseInt(str,10);if(intTemp==1||intTemp==-1){return true;}
else{return false;}}}
function EqualsIgnoreCase(str1,str2){var blnReturn;str1=new String(str1);str2=new String(str2);blnReturn=(str1.toLowerCase()==str2.toLowerCase())
return blnReturn;}
function ValidInteger(intNum){WriteToDebug("In ValidInteger intNum="+ intNum);var str=new String(intNum);if(str.indexOf("-",0)==0){str=str.substring(1,str.length- 1);}
var regValidChars=new RegExp("[^0-9]");if(str.search(regValidChars)==-1){WriteToDebug("Returning true");return true;}
WriteToDebug("Returning false");return false;}
function ConvertDateToIso8601TimeStamp(dtm){var strTimeStamp;dtm=new Date(dtm);var Year=dtm.getFullYear();var Month=dtm.getMonth()+ 1;var Day=dtm.getDate();var Hour=dtm.getHours();var Minute=dtm.getMinutes();var Second=dtm.getSeconds();Month=ZeroPad(Month,2);Day=ZeroPad(Day,2);Hour=ZeroPad(Hour,2);Minute=ZeroPad(Minute,2);Second=ZeroPad(Second,2);strTimeStamp=Year+"-"+ Month+"-"+ Day+"T"+ Hour+":"+ Minute+":"+ Second;return strTimeStamp;}
function ConvertIso8601TimeStampToDate(strTimeStamp){strTimeStamp=new String(strTimeStamp);var ary=new Array();ary=strTimeStamp.split(/[\:T-]/);var Year=ary[0];var Month=ary[1]-1;var Day=ary[2];var Hour=ary[3];var Minute=ary[4];var Second=ary[5];return new Date(Year,Month,Day,Hour,Minute,Second,0);}
function ConvertDateToCMIDate(dtmDate){WriteToDebug("In ConvertDateToCMIDate");var strYear;var strMonth;var strDay;var strReturn;dtmDate=new Date(dtmDate);strYear=dtmDate.getFullYear()
strMonth=(dtmDate.getMonth()+ 1);strDay=dtmDate.getDate();strReturn=ZeroPad(strYear,4)+"/"+ ZeroPad(strMonth,2)+"/"+ ZeroPad(strDay,2);return strReturn;}
function ConvertDateToCMITime(dtmDate){var strHours;var strMinutes;var strSeconds;var strReturn;dtmDate=new Date(dtmDate);strHours=dtmDate.getHours();strMinutes=dtmDate.getMinutes();strSeconds=dtmDate.getSeconds();strReturn=ZeroPad(strHours,2)+":"+ ZeroPad(strMinutes,2)+":"+ ZeroPad(strSeconds,2);return strReturn;}
function ConvertCMITimeSpanToMS(strTime){WriteToDebug("In ConvertCMITimeSpanToMS, strTime="+ strTime);var aryParts;var intHours;var intMinutes;var intSeconds;var intTotalMilliSeconds;aryParts=strTime.split(":");if(!IsValidCMITimeSpan(strTime)){WriteToDebug("ERROR - Invalid TimeSpan");SetErrorInfo(SCORM_ERROR_GENERAL,"LMS ERROR - Invalid time span passed to ConvertCMITimeSpanToMS, please contact technical support");return 0;}
intHours=aryParts[0];intMinutes=aryParts[1];intSeconds=aryParts[2];WriteToDebug("intHours="+ intHours+" intMinutes="+ intMinutes+" intSeconds="+ intSeconds);intTotalMilliSeconds=(intHours*3600000)+(intMinutes*60000)+(intSeconds*1000);intTotalMilliSeconds=Math.round(intTotalMilliSeconds);WriteToDebug("Returning "+ intTotalMilliSeconds);return intTotalMilliSeconds;}
function ConvertScorm2004TimeToMS(strIso8601Time){WriteToDebug("In ConvertScorm2004TimeToMS, strIso8601Time="+ strIso8601Time);var intTotalMs=0;var strNumberBuilder;var strCurrentCharacter;var blnInTimeSection;var Seconds=0;var Minutes=0;var Hours=0;var Days=0;var Months=0;var Years=0;var MILLISECONDS_PER_SECOND=1000;var MILLISECONDS_PER_MINUTE=MILLISECONDS_PER_SECOND*60;var MILLISECONDS_PER_HOUR=MILLISECONDS_PER_MINUTE*60;var MILLISECONDS_PER_DAY=MILLISECONDS_PER_HOUR*24;var MILLISECONDS_PER_MONTH=MILLISECONDS_PER_DAY*(((365*4)+ 1)/48);var MILLISECONDS_PER_YEAR=MILLISECONDS_PER_MONTH*12;strIso8601Time=new String(strIso8601Time);strNumberBuilder="";strCurrentCharacter="";blnInTimeSection=false;for(var i=1;i&lt;strIso8601Time.length;i++){strCurrentCharacter=strIso8601Time.charAt(i);if(IsIso8601SectionDelimiter(strCurrentCharacter)){switch(strCurrentCharacter.toUpperCase()){case"Y":Years=parseInt(strNumberBuilder,10);break;case"M":if(blnInTimeSection){Minutes=parseInt(strNumberBuilder,10);}
else{Months=parseInt(strNumberBuilder,10);}
break;case"D":Days=parseInt(strNumberBuilder,10);break;case"H":Hours=parseInt(strNumberBuilder,10);break;case"S":Seconds=parseFloat(strNumberBuilder);break;case"T":blnInTimeSection=true;break;}
strNumberBuilder="";}
else{strNumberBuilder+=""+ strCurrentCharacter;}}
WriteToDebug("Years="+ Years+"\n"+"Months="+ Months+"\n"+"Days="+ Days+"\n"+"Hours="+ Hours+"\n"+"Minutes="+ Minutes+"\n"+"Seconds="+ Seconds+"\n");intTotalMs=(Years*MILLISECONDS_PER_YEAR)+
(Months*MILLISECONDS_PER_MONTH)+
(Days*MILLISECONDS_PER_DAY)+
(Hours*MILLISECONDS_PER_HOUR)+
(Minutes*MILLISECONDS_PER_MINUTE)+
(Seconds*MILLISECONDS_PER_SECOND);intTotalMs=Math.round(intTotalMs);WriteToDebug("returning-"+ intTotalMs);return intTotalMs;}
function IsIso8601SectionDelimiter(str){if(str.search(/[PYMDTHS]/)&gt;=0){return true;}
else{return false;}}
function IsValidCMITimeSpan(strValue){WriteToDebug("In IsValidCMITimeSpan strValue="+ strValue);var regValid=/^\d?\d?\d?\d:\d?\d:\d?\d(.\d\d?)?$/;if(strValue.search(regValid)&gt;-1){WriteToDebug("Returning True");return true;}
else{WriteToDebug("Returning False");return false;}}
function IsValidIso8601TimeSpan(strValue){WriteToDebug("In IsValidIso8601TimeSpan strValue="+ strValue);var regValid=/^P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+(.\d\d?)?S)?)?$/;if(strValue.search(regValid)&gt;-1){WriteToDebug("Returning True");return true;}
else{WriteToDebug("Returning False");return false;}}
function ConvertMilliSecondsToSCORMTime(intTotalMilliseconds,blnIncludeFraction){var intHours;var intintMinutes;var intSeconds;var intMilliseconds;var intHundredths;var strCMITimeSpan;WriteToDebug("In ConvertMilliSecondsIntoSCORMTime, intTotalMilliseconds = "+ intTotalMilliseconds+", blnIncludeFraction = "+ blnIncludeFraction);if(blnIncludeFraction==null||blnIncludeFraction==undefined){blnIncludeFraction=true;}
intMilliseconds=intTotalMilliseconds%1000;intSeconds=((intTotalMilliseconds- intMilliseconds)/1000)%60;intMinutes=((intTotalMilliseconds- intMilliseconds-(intSeconds*1000))/60000)%60;intHours=(intTotalMilliseconds- intMilliseconds-(intSeconds*1000)-(intMinutes*60000))/3600000;WriteToDebug("Separated Parts, intHours="+ intHours+", intMinutes="+ intMinutes+", intSeconds="+ intSeconds+", intMilliseconds="+ intMilliseconds);if(intHours==10000)
{WriteToDebug("Max intHours detected");intHours=9999;intMinutes=(intTotalMilliseconds-(intHours*3600000))/60000;if(intMinutes==100)
{intMinutes=99;}
intMinutes=Math.floor(intMinutes);intSeconds=(intTotalMilliseconds-(intHours*3600000)-(intMinutes*60000))/1000;if(intSeconds==100)
{intSeconds=99;}
intSeconds=Math.floor(intSeconds);intMilliseconds=(intTotalMilliseconds-(intHours*3600000)-(intMinutes*60000)-(intSeconds*1000));WriteToDebug("Separated Parts, intHours="+ intHours+", intMinutes="+ intMinutes+", intSeconds="+ intSeconds+", intMilliseconds="+ intMilliseconds);}
intHundredths=Math.floor(intMilliseconds/10);strCMITimeSpan=ZeroPad(intHours,4)+":"+ ZeroPad(intMinutes,2)+":"+ ZeroPad(intSeconds,2);if(blnIncludeFraction){strCMITimeSpan+="."+ intHundredths;}
WriteToDebug("strCMITimeSpan="+ strCMITimeSpan);if(intHours&gt;9999)
{strCMITimeSpan="9999:99:99";if(blnIncludeFraction){strCMITimeSpan+=".99";}}
WriteToDebug("returning "+ strCMITimeSpan);return strCMITimeSpan;}
function ConvertMilliSecondsIntoSCORM2004Time(intTotalMilliseconds){WriteToDebug("In ConvertMilliSecondsIntoSCORM2004Time intTotalMilliseconds="+ intTotalMilliseconds);var ScormTime="";var HundredthsOfASecond;var Seconds;var Minutes;var Hours;var Days;var Months;var Years;var HUNDREDTHS_PER_SECOND=100;var HUNDREDTHS_PER_MINUTE=HUNDREDTHS_PER_SECOND*60;var HUNDREDTHS_PER_HOUR=HUNDREDTHS_PER_MINUTE*60;var HUNDREDTHS_PER_DAY=HUNDREDTHS_PER_HOUR*24;var HUNDREDTHS_PER_MONTH=HUNDREDTHS_PER_DAY*(((365*4)+ 1)/48);var HUNDREDTHS_PER_YEAR=HUNDREDTHS_PER_MONTH*12;HundredthsOfASecond=Math.floor(intTotalMilliseconds/10);Years=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_YEAR);HundredthsOfASecond-=(Years*HUNDREDTHS_PER_YEAR);Months=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_MONTH);HundredthsOfASecond-=(Months*HUNDREDTHS_PER_MONTH);Days=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_DAY);HundredthsOfASecond-=(Days*HUNDREDTHS_PER_DAY);Hours=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_HOUR);HundredthsOfASecond-=(Hours*HUNDREDTHS_PER_HOUR);Minutes=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_MINUTE);HundredthsOfASecond-=(Minutes*HUNDREDTHS_PER_MINUTE);Seconds=Math.floor(HundredthsOfASecond/HUNDREDTHS_PER_SECOND);HundredthsOfASecond-=(Seconds*HUNDREDTHS_PER_SECOND);if(Years&gt;0){ScormTime+=Years+"Y";}
if(Months&gt;0){ScormTime+=Months+"M";}
if(Days&gt;0){ScormTime+=Days+"D";}
if((HundredthsOfASecond+ Seconds+ Minutes+ Hours)&gt;0){ScormTime+="T";if(Hours&gt;0){ScormTime+=Hours+"H";}
if(Minutes&gt;0){ScormTime+=Minutes+"M";}
if((HundredthsOfASecond+ Seconds)&gt;0){ScormTime+=Seconds;if(HundredthsOfASecond&gt;0){ScormTime+="."+ HundredthsOfASecond;}
ScormTime+="S";}}
if(ScormTime==""){ScormTime="0S";}
ScormTime="P"+ ScormTime;WriteToDebug("Returning-"+ ScormTime);return ScormTime;}
function ZeroPad(intNum,intNumDigits){WriteToDebug("In ZeroPad intNum="+ intNum+" intNumDigits="+ intNumDigits);var strTemp;var intLen;var i;strTemp=new String(intNum);intLen=strTemp.length;if(intLen&gt;intNumDigits){WriteToDebug("Length of string is greater than num digits, trimming string");strTemp=strTemp.substr(0,intNumDigits);}
else{for(i=intLen;i&lt;intNumDigits;i++){strTemp="0"+ strTemp;}}
WriteToDebug("Returning - "+ strTemp);return strTemp;}
function IsValidDecimal(strValue){WriteToDebug("In IsValidDecimal, strValue="+ strValue);strValue=new String(strValue);if(strValue.search(/[^.\d-]/)&gt;-1){WriteToDebug("Returning False - character other than a digit, dash or period found");return false;}
if(strValue.search("-")&gt;-1){if(strValue.indexOf("-",1)&gt;-1){WriteToDebug("Returning False - dash found in the middle of the string");return false;}}
if(strValue.indexOf(".")!=strValue.lastIndexOf(".")){WriteToDebug("Returning False - more than one decimal point found");return false;}
if(strValue.search(/\d/)&lt;0){WriteToDebug("Returning False - no digits found");return false;}
WriteToDebug("Returning True");return true;}
function IsAlphaNumeric(strValue){WriteToDebug("In IsAlphaNumeric");if(strValue.search(/\w/)&lt;0){WriteToDebug("Returning false");return false;}
else{WriteToDebug("Returning true");return true;}}
function ReverseNameSequence(strName)
{var strFirstName;var strLastName;var intCommaLoc;if(strName=="")strName="Not Found, Learner Name";intCommaLoc=strName.indexOf(",");strFirstName=strName.slice(intCommaLoc+1);strLastName=strName.slice(0,intCommaLoc);strFirstName=Trim(strFirstName);strLastName=Trim(strLastName);return strFirstName+' '+ strLastName;}
function LTrim(str){str=new String(str);return(str.replace(/^\s+/,''));}
function RTrim(str){str=new String(str);return(str.replace(/\s+$/,''));}
function Trim(strToTrim){var str=LTrim(RTrim(strToTrim));return(str.replace(/\s{2,}/g," "));}
function GetValueFromDataChunk(strID)
{var strChunk=new String(GetDataChunk());var aryPairs=new Array();var aryValues=new Array();var i;aryPairs=strChunk.split(parent.DATA_CHUNK_PAIR_SEPARATOR);for(i=0;i&lt;aryPairs.length;i++)
{aryValues=aryPairs[i].split(parent.DATA_CHUNK_VALUE_SEPARATOR);if(aryValues[0]==strID)return aryValues[1];}
return'';}
function SetDataChunkValue(strID,strValue)
{var strChunk=new String(GetDataChunk());var aryPairs=new Array();var aryValues=new Array();var i;var blnFound=new Boolean(false);aryPairs=strChunk.split(parent.DATA_CHUNK_PAIR_SEPARATOR);for(i=0;i&lt;aryPairs.length;i++)
{aryValues=aryPairs[i].split(parent.DATA_CHUNK_VALUE_SEPARATOR);if(aryValues[0]==strID)
{aryValues[1]=strValue;blnFound=true;aryPairs[i]=aryValues[0]+ parent.DATA_CHUNK_VALUE_SEPARATOR+ aryValues[1];}}
if(blnFound==true)
{strChunk=aryPairs.join(parent.DATA_CHUNK_PAIR_SEPARATOR);}
else
{if(strChunk=='')
{strChunk=strID+ parent.DATA_CHUNK_VALUE_SEPARATOR+ strValue;}
else
{strChunk+=parent.DATA_CHUNK_PAIR_SEPARATOR+ strID+ parent.DATA_CHUNK_VALUE_SEPARATOR+ strValue;}}
SetDataChunk(strChunk);return true;}
function GetLastDirAndPageName(str)
{var page=new String(str);var LastSlashLocation=page.lastIndexOf("/");var SecondLastSlashLocation=page.lastIndexOf("/",LastSlashLocation-1);return page.substr(SecondLastSlashLocation+1);}
function RoundToPrecision(number,significantDigits){number=parseFloat(number);return(Math.round(number*Math.pow(10,significantDigits))/Math.pow(10,significantDigits))}
function IsAbsoluteUrl(urlStr){return urlStr!=null&amp;&amp;(urlStr.indexOf("http://")==0||urlStr.indexOf("https://")==0)}</text>
				</content>
				<redirectionURL/>
				<headersSize>290</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/SCORM2004Functions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>377</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="SCORM2004Functions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var SCORM2004_LOGOUT="logout";var SCORM2004_SUSPEND="suspend";var SCORM2004_NORMAL_EXIT="normal";var SCORM2004_TIMEOUT="time-out";var SCORM2004_PASSED="passed";var SCORM2004_FAILED="failed";var SCORM2004_UNKNOWN="unknown";var SCORM2004_COMPLETED="completed";var SCORM2004_INCOMPLETE="incomplete";var SCORM2004_NOT_ATTEMPTED="not attempted";var SCORM2004_CREDIT="credit";var SCORM2004_NO_CREDIT="no-credit";var SCORM2004_BROWSE="browse";var SCORM2004_NORMAL="normal";var SCORM2004_REVIEW="review";var SCORM2004_ENTRY_ABINITIO="ab-initio";var SCORM2004_ENTRY_RESUME="resume";var SCORM2004_ENTRY_NORMAL="";var SCORM2004_TLA_EXIT_MESSAGE="exit,message";var SCORM2004_TLA_EXIT_NO_MESSAGE="exit,no message";var SCORM2004_TLA_CONTINUE_MESSAGE="continue,message";var SCORM2004_TLA_CONTINUE_NO_MESSAGE="continue,no message";var SCORM2004_RESULT_CORRECT="correct";var SCORM2004_RESULT_WRONG="incorrect";var SCORM2004_RESULT_UNANTICIPATED="unanticipated";var SCORM2004_RESULT_NEUTRAL="neutral";var SCORM2004_INTERACTION_TYPE_TRUE_FALSE="true-false";var SCORM2004_INTERACTION_TYPE_CHOICE="choice";var SCORM2004_INTERACTION_TYPE_FILL_IN="fill-in";var SCORM2004_INTERACTION_TYPE_LONG_FILL_IN="long-fill-in";var SCORM2004_INTERACTION_TYPE_MATCHING="matching";var SCORM2004_INTERACTION_TYPE_PERFORMANCE="performance";var SCORM2004_INTERACTION_TYPE_SEQUENCING="sequencing";var SCORM2004_INTERACTION_TYPE_LIKERT="likert";var SCORM2004_INTERACTION_TYPE_NUMERIC="numeric";var SCORM2004_NO_ERROR="0";var SCORM2004_ERROR_INVALID_PREFERENCE="-1";var SCORM2004_ERROR_INVALID_STATUS="-2";var SCORM2004_ERROR_INVALID_SPEED="-3";var SCORM2004_ERROR_INVALID_TIMESPAN="-4";var SCORM2004_ERROR_INVALID_TIME_LIMIT_ACTION="-5";var SCORM2004_ERROR_INVALID_DECIMAL="-6";var SCORM2004_ERROR_INVALID_CREDIT="-7";var SCORM2004_ERROR_INVALID_LESSON_MODE="-8";var SCORM2004_ERROR_INVALID_ENTRY="-9";var SCORM2004_TRUE="true";var SCORM2004_FALSE="false";var SCORM2004_EARLIEST_DATE=new Date("1/1/1900");var intSCORM2004Error=SCORM2004_NO_ERROR;var strSCORM2004ErrorString="";var strSCORM2004ErrorDiagnostic="";var SCORM2004_objAPI=null;var blnReviewModeSoReadOnly=false;var blnSCORM2004_SSP_Is_Supported=null;function SCORM2004_Initialize(){WriteToDebug("In SCORM2004_Initialize");var blnResult=true;SCORM2004_ClearErrorInfo();WriteToDebug("Grabbing API");try{SCORM2004_objAPI=SCORM2004_GrabAPI();}
catch(e){WriteToDebug("Error grabbing 1.2 API-"+ e.name+":"+ e.message);}
if(typeof(SCORM2004_objAPI)=="undefined"||SCORM2004_objAPI==null){WriteToDebug("Unable to acquire SCORM API:")
WriteToDebug("SCORM2004_objAPI="+ typeof(SCORM2004_objAPI));InitializeExecuted(false,"Error - unable to acquire LMS API, content may not play properly and results may not be recorded.  Please contact technical support.");return false;}
WriteToDebug("Calling LMSInit");blnResult=SCORM2004_CallInitialize();if(!blnResult){WriteToDebug("ERROR Initializing LMS");InitializeExecuted(false,"Error initializing communications with LMS");return false;}
if(SCORM2004_GetStatus()==LESSON_STATUS_NOT_ATTEMPTED){WriteToDebug("Setting Status to Incomplete");blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_INCOMPLETE);}
blnResult=SCORM2004_CallSetValue("cmi.exit",SCORM2004_TranslateExitTypeToSCORM(DEFAULT_EXIT_TYPE))&amp;&amp;blnResult;if(SCORM2004_GetLessonMode()==MODE_REVIEW){if(!(typeof(REVIEW_MODE_IS_READ_ONLY)=="undefined")&amp;&amp;REVIEW_MODE_IS_READ_ONLY===true){blnReviewModeSoReadOnly=true;}}
WriteToDebug("Calling InitializeExecuted with parameter-"+ blnResult);InitializeExecuted(blnResult,"");return;}
function SCORM2004_Finish(strExitType,blnStatusWasSet){WriteToDebug("In SCORM2004_Finish strExitType="+ strExitType+", blnStatusWasSet="+ blnStatusWasSet);var strStatusAfterCompletion;var blnResult=true;SCORM2004_ClearErrorInfo();if((strExitType==EXIT_TYPE_FINISH)&amp;&amp;!blnStatusWasSet){WriteToDebug("Getting completion status");strStatusAfterCompletion=SCORM2004_GetCompletionStatus();WriteToDebug("Setting completion status to "+ strStatusAfterCompletion);blnResult=SCORM2004_CallSetValue("cmi.completion_status",strStatusAfterCompletion)&amp;&amp;blnResult;}
if(strExitType==EXIT_TYPE_SUSPEND&amp;&amp;USE_2004_SUSPENDALL_NAVREQ){WriteToDebug("Setting adl.nav.request to suspendAll");blnResult=SCORM2004_CallSetValue("adl.nav.request","suspendAll");}
WriteToDebug("Setting Exit");blnResult=SCORM2004_CallSetValue("cmi.exit",SCORM2004_TranslateExitTypeToSCORM(strExitType))&amp;&amp;blnResult;WriteToDebug("Calling Commit");blnResult=SCORM2004_CallCommit()&amp;&amp;blnResult;WriteToDebug("Calling Finish");blnResult=SCORM2004_CallTerminate()&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_CommitData(){WriteToDebug("In SCORM2004_CommitData");SCORM2004_ClearErrorInfo();return SCORM2004_CallCommit();}
function SCORM2004_GetStudentID(){WriteToDebug("In SCORM2004_GetStudentID");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.learner_id");}
function SCORM2004_GetStudentName(){WriteToDebug("In SCORM2004_GetStudentName");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.learner_name");}
function SCORM2004_GetBookmark(){WriteToDebug("In SCORM2004_GetBookmark");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.location");}
function SCORM2004_SetBookmark(strBookmark){WriteToDebug("In SCORM2004_SetBookmark strBookmark="+ strBookmark);SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.location",strBookmark);}
function SCORM2004_GetDataChunk(){WriteToDebug("In SCORM2004_GetDataChunk");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.suspend_data");}
function SCORM2004_SetDataChunk(strData){WriteToDebug("In SCORM2004_SetDataChunk");SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.suspend_data",strData);}
function SCORM2004_GetLaunchData(){WriteToDebug("In SCORM2004_GetLaunchData");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.launch_data");}
function SCORM2004_GetComments(){WriteToDebug("In SCORM2004_GetComments");SCORM2004_ClearErrorInfo();var intCommentCount;var strComments="";intCommentCount=SCORM2004_CallGetValue("cmi.comments_from_learner._count");for(var i=0;i&lt;intCommentCount;i++){if(strComments.length&gt;0){strComments+=" | ";}
strComments+=SCORM2004_CallGetValue("cmi.comments_from_learner."+ i+".comment");}
return strComments;}
function SCORM2004_WriteComment(strComment){WriteToDebug("In SCORM2004_WriteComment strComment="+ strComment);var intCurrentIndex;var blnResult;SCORM2004_ClearErrorInfo();if(strComment.search(/ \| /)==0){strComment=strComment.substr(3);}
strComment.replace(/\|\|/g,"|")
intCurrentIndex=SCORM2004_CallGetValue("cmi.comments_from_learner._count");blnResult=SCORM2004_CallSetValue("cmi.comments_from_learner."+ intCurrentIndex+".comment",strComment);blnResult=SCORM2004_CallSetValue("cmi.comments_from_learner."+ intCurrentIndex+".timestamp",ConvertDateToIso8601TimeStamp(new Date()))&amp;&amp;blnResult;return blnResult;}
function SCORM2004_GetLMSComments(){WriteToDebug("In SCORM2004_GetLMSComments");SCORM2004_ClearErrorInfo();var intCommentCount;var strComments="";intCommentCount=SCORM2004_CallGetValue("cmi.comments_from_lms._count");for(var i=0;i&lt;intCommentCount;i++){if(strComments.length&gt;0){strComments+=" \r\n";}
strComments+=SCORM2004_CallGetValue("cmi.comments_from_lms."+ i+".comment");}
return strComments;}
function SCORM2004_GetAudioPlayPreference(){var intTempPreference;WriteToDebug("In SCORM2004_GetAudioPlayPreference");SCORM2004_ClearErrorInfo();intTempPreference=SCORM2004_CallGetValue("cmi.learner_preference.audio_level");if(intTempPreference==""){intTempPreference=0;}
intTempPreference=parseInt(intTempPreference,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0){WriteToDebug("Returning On");return PREFERENCE_ON;}
else if(intTempPreference&lt;=0){WriteToDebug("Returning Off");return PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS","intTempPreference="+ intTempPreference);return null;}}
function SCORM2004_GetAudioVolumePreference(){var intTempPreference;WriteToDebug("In SCORM2004_GetAudioVollumePreference");SCORM2004_ClearErrorInfo();intTempPreference=SCORM2004_CallGetValue("cmi.learner_preference.audio_level");WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference==""){intTempPreference=100;}
intTempPreference=parseInt(intTempPreference,10);if(intTempPreference&lt;=0){WriteToDebug("Setting to 100");intTempPreference=100;}
if(!(intTempPreference&gt;0&amp;&amp;intTempPreference&lt;=100)){WriteToDebug("ERROR: invalid preference");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS","intTempPreference="+ intTempPreference);return null;}
WriteToDebug("Returning "+ intTempPreference);return intTempPreference;}
function SCORM2004_SetAudioPreference(PlayPreference,intPercentOfMaxVolume){WriteToDebug("In SCORM2004_SetAudioPreference PlayPreference="+ PlayPreference+", intPercentOfMaxVolume="+ intPercentOfMaxVolume);SCORM2004_ClearErrorInfo();if(PlayPreference==PREFERENCE_OFF){WriteToDebug("Setting percent to 0");intPercentOfMaxVolume=0;}
return SCORM2004_CallSetValue("cmi.learner_preference.audio_level",intPercentOfMaxVolume);}
function SCORM2004_SetLanguagePreference(strLanguage){WriteToDebug("In SCORM2004_SetLanguagePreference strLanguage="+ strLanguage);SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.learner_preference.language",strLanguage);}
function SCORM2004_GetLanguagePreference(){WriteToDebug("In SCORM2004_GetLanguagePreference");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.learner_preference.language");}
function SCORM2004_SetSpeedPreference(intPercentOfMax){WriteToDebug("In SCORM2004_SetSpeedPreference intPercentOfMax="+ intPercentOfMax);SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.learner_preference.delivery_speed",intPercentOfMax);}
function SCORM2004_GetSpeedPreference(){var intSCORMSpeed;var intPercentOfMax;WriteToDebug("In SCORM2004_GetSpeedPreference");SCORM2004_ClearErrorInfo();intSCORMSpeed=SCORM2004_CallGetValue("cmi.learner_preference.delivery_speed");WriteToDebug("intSCORMSpeed="+ intSCORMSpeed);if(intSCORMSpeed==""){WriteToDebug("Detected empty string, defaulting to 100");intSCORMSpeed=100;}
intSCORMSpeed=parseInt(intSCORMSpeed,10);if(intSCORMSpeed&lt;0){WriteToDebug("ERROR - out of range");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - out of range","intSCORMSpeed="+ intSCORMSpeed);return null;}
WriteToDebug("intSCORMSpeed "+ intSCORMSpeed);return intSCORMSpeed;}
function SCORM2004_SetTextPreference(intPreference){WriteToDebug("In SCORM2004_SetTextPreference intPreference="+ intPreference);SCORM2004_ClearErrorInfo();return SCORM2004_CallSetValue("cmi.learner_preference.audio_captioning",intPreference);}
function SCORM2004_GetTextPreference(){var intTempPreference;WriteToDebug("In SCORM2004_GetTextPreference");SCORM2004_ClearErrorInfo();intTempPreference=SCORM2004_CallGetValue("cmi.learner_preference.audio_captioning");intTempPreference=parseInt(intTempPreference,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0){WriteToDebug("Returning On");return PREFERENCE_ON;}
else if(intTempPreference==0||intTempPreference==""){WriteToDebug("Returning Default");return PREFERENCE_DEFAULT;}
else if(intTempPreference&lt;0){WriteToDebug("Returning Off");return PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_PREFERENCE,"Invalid text preference received from LMS","intTempPreference="+ intTempPreference);return null;}}
function SCORM2004_GetPreviouslyAccumulatedTime(){var strIso8601Time;var intMilliseconds;WriteToDebug("In SCORM2004_GetPreviouslyAccumulatedTime");SCORM2004_ClearErrorInfo();strIso8601Time=SCORM2004_CallGetValue("cmi.total_time")
WriteToDebug("strIso8601Time="+ strIso8601Time);if(!IsValidIso8601TimeSpan(strIso8601Time)){WriteToDebug("ERROR - Invalid Iso8601Time");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_TIMESPAN,"Invalid timespan received from LMS","strTime="+ strIso8601Time);return null;}
intMilliseconds=ConvertScorm2004TimeToMS(strIso8601Time);WriteToDebug("Returning "+ intMilliseconds);return intMilliseconds;}
function SCORM2004_SaveTime(intMilliSeconds){var strISO8601Time;WriteToDebug("In SCORM2004_SaveTime intMilliSeconds="+ intMilliSeconds);SCORM2004_ClearErrorInfo();strISO8601Time=ConvertMilliSecondsIntoSCORM2004Time(intMilliSeconds);WriteToDebug("strISO8601Time="+ strISO8601Time);return SCORM2004_CallSetValue("cmi.session_time",strISO8601Time);}
function SCORM2004_GetMaxTimeAllowed(){var strIso8601Time;var intMilliseconds;WriteToDebug("In SCORM2004_GetMaxTimeAllowed");SCORM2004_ClearErrorInfo();strIso8601Time=SCORM2004_CallGetValue("cmi.max_time_allowed")
WriteToDebug("strIso8601Time="+ strIso8601Time);if(strIso8601Time==""){strIso8601Time="20Y";}
if(!IsValidIso8601TimeSpan(strIso8601Time)){WriteToDebug("ERROR - Invalid Iso8601Time");SCORM2004_SetErrorInfoManually(SCORM_ERROR_INVALID_TIMESPAN,"Invalid timespan received from LMS","strIso8601Time="+ strIso8601Time);return null;}
intMilliseconds=ConvertScorm2004TimeToMS(ConvertScorm2004TimeToMS);WriteToDebug("intMilliseconds="+ intMilliseconds);return intMilliseconds;}
function SCORM2004_DisplayMessageOnTimeout(){var strTLA;WriteToDebug("In SCORM2004_DisplayMessageOnTimeout");SCORM2004_ClearErrorInfo();strTLA=SCORM2004_CallGetValue("cmi.time_limit_action");WriteToDebug("strTLA="+ strTLA);if(strTLA==SCORM2004_TLA_EXIT_MESSAGE||strTLA==SCORM2004_TLA_CONTINUE_MESSAGE){WriteToDebug("returning true");return true;}
else if(strTLA==SCORM2004_TLA_EXIT_NO_MESSAGE||strTLA==SCORM2004_TLA_CONTINUE_NO_MESSAGE||strTLA==""){WriteToDebug("returning false");return false;}
else{WriteToDebug("Error invalid TLA");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS","strTLA="+ strTLA);return null;}}
function SCORM2004_ExitOnTimeout(){var strTLA;WriteToDebug("In SCORM2004_ExitOnTimeout");SCORM2004_ClearErrorInfo();strTLA=SCORM2004_CallGetValue("cmi.time_limit_action");WriteToDebug("strTLA="+ strTLA);if(strTLA==SCORM2004_TLA_EXIT_MESSAGE||strTLA==SCORM2004_TLA_EXIT_NO_MESSAGE){WriteToDebug("returning true");return true;}
else if(strTLA==SCORM2004_TLA_CONTINUE_MESSAGE||strTLA==SCORM2004_TLA_CONTINUE_NO_MESSAGE||strTLA==""){WriteToDebug("returning false");return false;}
else{WriteToDebug("ERROR invalid TLA");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS","strTLA="+ strTLA);return null;}}
function SCORM2004_GetPassingScore(){var fltScore;WriteToDebug("In SCORM2004_GetPassingScore");SCORM2004_ClearErrorInfo();fltScore=SCORM2004_CallGetValue("cmi.scaled_passing_score")
WriteToDebug("fltScore="+ fltScore);if(fltScore==""){fltScore=0;}
if(!IsValidDecimal(fltScore)){WriteToDebug("Error - score is not a valid decimal");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_DECIMAL,"Invalid mastery score received from LMS","fltScore="+ fltScore);return null;}
fltScore=parseFloat(fltScore);fltScore=fltScore*100;WriteToDebug("returning fltScore-"+ fltScore);return fltScore;}
function SCORM2004_SetScore(intScore,intMaxScore,intMinScore){var blnResult;var fltNormalizedScore;WriteToDebug("In SCORM2004_SetScore intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM2004_ClearErrorInfo();fltNormalizedScore=intScore/100;RoundToPrecision(fltNormalizedScore,7);blnResult=SCORM2004_CallSetValue("cmi.score.raw",intScore);blnResult=SCORM2004_CallSetValue("cmi.score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.score.min",intMinScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.score.scaled",fltNormalizedScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_GetScore(){WriteToDebug("In SCORM2004_GetScore");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.score.raw");}
function SCORM2004_GetScaledScore(){WriteToDebug("In SCORM2004_GetScaledScore");SCORM2004_ClearErrorInfo();return SCORM2004_CallGetValue("cmi.score.scaled");}
function SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004InteractionType){var blnResult;var intInteractionIndex;var strResult;blnCorrect=new String(blnCorrect);SCORM2004_ClearErrorInfo();intInteractionIndex=SCORM2004_CallGetValue("cmi.interactions._count");WriteToDebug("intInteractionIndex="+ intInteractionIndex);if(intInteractionIndex==""){WriteToDebug("Setting Interaction Index to 0");intInteractionIndex=0;}
if(blnCorrect==true||blnCorrect=="true"||blnCorrect==INTERACTION_RESULT_CORRECT){strResult=SCORM2004_RESULT_CORRECT;}
else if(String(blnCorrect)=="false"||blnCorrect==INTERACTION_RESULT_WRONG){strResult=SCORM2004_RESULT_WRONG;}
else if(blnCorrect==INTERACTION_RESULT_UNANTICIPATED){strResult=SCORM2004_RESULT_UNANTICIPATED;}
else if(blnCorrect==INTERACTION_RESULT_NEUTRAL){strResult=SCORM2004_RESULT_NEUTRAL;}
else{strResult="";}
WriteToDebug("strResult="+ strResult);strID=CreateValidIdentifier(strID);blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".id",strID);blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".type",SCORM2004InteractionType)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".learner_response",strResponse)&amp;&amp;blnResult;if(strResult!=undefined&amp;&amp;strResult!=null&amp;&amp;strResult!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".result",strResult)&amp;&amp;blnResult;}
if(strCorrectResponse!=undefined&amp;&amp;strCorrectResponse!=null&amp;&amp;strCorrectResponse!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".correct_responses.0.pattern",strCorrectResponse)&amp;&amp;blnResult;}
if(strDescription!=undefined&amp;&amp;strDescription!=null&amp;&amp;strDescription!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".description",strDescription)&amp;&amp;blnResult;}
if(intWeighting!=undefined&amp;&amp;intWeighting!=null&amp;&amp;intWeighting!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".weighting",intWeighting)&amp;&amp;blnResult;}
if(intLatency!=undefined&amp;&amp;intLatency!=null&amp;&amp;intLatency!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".latency",ConvertMilliSecondsIntoSCORM2004Time(intLatency))&amp;&amp;blnResult;}
if(strLearningObjectiveID!=undefined&amp;&amp;strLearningObjectiveID!=null&amp;&amp;strLearningObjectiveID!=""){blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".objectives.0.id",strLearningObjectiveID)&amp;&amp;blnResult;}
blnResult=SCORM2004_CallSetValue("cmi.interactions."+ intInteractionIndex+".timestamp",ConvertDateToIso8601TimeStamp(dtmTime))&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordTrueFalseInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse=null;if(blnResponse){strResponse="true";}
else{strResponse="false";}
if(blnCorrectResponse==true){strCorrectResponse="true";}
else if(blnCorrectResponse==false){strCorrectResponse="false";}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_TRUE_FALSE);}
function SCORM2004_RecordMultipleChoiceInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordMultipleChoiceInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+="[,]";}
strResponse+=aryResponse[i].Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+="[,]";}
strCorrectResponse+=aryCorrectResponse[i].Long;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_CHOICE);}
function SCORM2004_RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordFillInInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var interactionType;if(strCorrectResponse==null){strCorrectResponse="";}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;250||strResponse.length&gt;250){interactionType=SCORM2004_INTERACTION_TYPE_LONG_FILL_IN;}
else{interactionType=SCORM2004_INTERACTION_TYPE_FILL_IN;}
if(strCorrectResponse.length&gt;4000){strCorrectResponse=strCorrectResponse.substr(0,4000);}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,interactionType);}
function SCORM2004_RecordMatchingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordMatchingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+="[,]";}
strResponse+=aryResponse[i].Source.Long+"[.]"+ aryResponse[i].Target.Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+="[,]";}
strCorrectResponse+=aryCorrectResponse[i].Source.Long+"[.]"+ aryCorrectResponse[i].Target.Long;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_MATCHING);}
function SCORM2004_RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordPerformanceInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);strResponse=new String(strResponse);if(strResponse.length&gt;250){strResponse=strResponse.substr(0,250);}
if(strCorrectResponse==null){strCorrectResponse="";}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;250){strCorrectResponse=strCorrectResponse.substr(0,250);}
strResponse="[.]"+ strResponse;strCorrectResponse="[.]"+ strCorrectResponse;return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_PERFORMANCE);}
function SCORM2004_RecordSequencingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordSequencingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+="[,]";}
strResponse+=aryResponse[i].Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+="[,]";}
strCorrectResponse+=aryCorrectResponse[i].Long;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_SEQUENCING);}
function SCORM2004_RecordLikertInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In RecordLikertInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse=response.Long;var strCorrectResponse="";if(correctResponse!=null){strCorrectResponse=correctResponse.Long;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_LIKERT);}
function SCORM2004_RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM2004_RecordNumericInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);if(strCorrectResponse!=undefined&amp;&amp;strCorrectResponse!=null&amp;&amp;strCorrectResponse!=""){strCorrectResponse=strCorrectResponse+"[:]"+ strCorrectResponse;}
return SCORM2004_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM2004_INTERACTION_TYPE_NUMERIC);}
function SCORM2004_GetEntryMode(){var strEntry;WriteToDebug("In SCORM2004_GetEntryMode");SCORM2004_ClearErrorInfo();strEntry=SCORM2004_CallGetValue("cmi.entry");WriteToDebug("strEntry="+ strEntry);if(strEntry==SCORM2004_ENTRY_ABINITIO){WriteToDebug("Returning first time");return ENTRY_FIRST_TIME;}
else if(strEntry==SCORM2004_ENTRY_RESUME){WriteToDebug("Returning resume");return ENTRY_RESUME;}
else if(strEntry==SCORM2004_ENTRY_NORMAL){WriteToDebug("returning normal");return ENTRY_REVIEW;}
else{WriteToDebug("ERROR - invalid entry mode");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_ENTRY,"Invalid entry vocab received from LMS","strEntry="+ strEntry);return null;}}
function SCORM2004_GetLessonMode(){var strLessonMode;WriteToDebug("In SCORM2004_GetLessonMode");SCORM2004_ClearErrorInfo();strLessonMode=SCORM2004_CallGetValue("cmi.mode");WriteToDebug("strLessonMode="+ strLessonMode);if(strLessonMode==SCORM2004_BROWSE){WriteToDebug("Returning browse");return MODE_BROWSE;}
else if(strLessonMode==SCORM2004_NORMAL){WriteToDebug("returning normal");return MODE_NORMAL;}
else if(strLessonMode==SCORM2004_REVIEW){WriteToDebug("Returning Review");return MODE_REVIEW;}
else{WriteToDebug("ERROR - invalid lesson mode");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_LESSON_MODE,"Invalid lesson_mode vocab received from LMS","strLessonMode="+ strLessonMode);return null;}}
function SCORM2004_GetTakingForCredit(){var strCredit;WriteToDebug("In SCORM2004_GetTakingForCredit");SCORM2004_ClearErrorInfo();strCredit=SCORM2004_CallGetValue("cmi.credit");WriteToDebug("strCredit="+ strCredit);if(strCredit=="credit"){WriteToDebug("Returning true");return true;}
else if(strCredit=="no-credit"){WriteToDebug("Returning false");return false;}
else{WriteToDebug("ERROR - invalid credit");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_CREDIT,"Invalid credit vocab received from LMS","strCredit="+ strCredit);return null;}}
function SCORM2004_SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){var intObjectiveIndex;var blnResult;var fltNormalizedScore;WriteToDebug("In SCORM2004_SetObjectiveScore, strObejctiveID="+ strObjectiveID+", intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);fltNormalizedScore=intScore/100;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".score.raw",intScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".score.min",intMinScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".score.scaled",fltNormalizedScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_SetObjectiveStatus(strObjectiveID,Lesson_Status){var intObjectiveIndex;var blnResult;var strSCORMSuccessStatus="";var strSCORMCompletionStatus="";WriteToDebug("In SCORM2004_SetObjectiveStatus strObjectiveID="+ strObjectiveID+", Lesson_Status="+ Lesson_Status);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);if(Lesson_Status==LESSON_STATUS_PASSED){strSCORMSuccessStatus=SCORM2004_PASSED;strSCORMCompletionStatus=SCORM2004_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_FAILED){strSCORMSuccessStatus=SCORM2004_FAILED;strSCORMCompletionStatus=SCORM2004_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_COMPLETED){strSCORMSuccessStatus=SCORM2004_UNKNOWN;strSCORMCompletionStatus=SCORM2004_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_BROWSED){strSCORMSuccessStatus=SCORM2004_UNKNOWN;strSCORMCompletionStatus=SCORM2004_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_INCOMPLETE){strSCORMSuccessStatus=SCORM2004_UNKNOWN;strSCORMCompletionStatus=SCORM2004_INCOMPLETE;}
else if(Lesson_Status==LESSON_STATUS_NOT_ATTEMPTED){strSCORMSuccessStatus=SCORM2004_UNKNOWN;strSCORMCompletionStatus=SCORM2004_NOT_ATTEMPTED;}
WriteToDebug("strSCORMSuccessStatus="+ strSCORMSuccessStatus);WriteToDebug("strSCORMCompletionStatus="+ strSCORMCompletionStatus);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".success_status",strSCORMSuccessStatus)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".completion_status",strSCORMCompletionStatus)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_SetObjectiveDescription(strObjectiveID,strObjectiveDescription){var intObjectiveIndex;WriteToDebug("In SCORM2004_SetObjectiveDescription strObjectiveID="+ strObjectiveID+", strObjectiveDescription="+ strObjectiveDescription);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".description",strObjectiveDescription)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_GetObjectiveScore(strObjectiveID){var intObjectiveIndex;WriteToDebug("In SCORM2004_GetObjectiveScore, strObejctiveID="+ strObjectiveID);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);return SCORM2004_CallGetValue("cmi.objectives."+ intObjectiveIndex+".score.raw");}
function SCORM2004_GetObjectiveStatus(strObjectiveID){var intObjectiveIndex;var strSuccessStatus;var strCompletionStatus;WriteToDebug("In SCORM2004_GetObjectiveStatus, strObejctiveID="+ strObjectiveID);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);strSuccessStatus=SCORM2004_CallGetValue("cmi.objectives."+ intObjectiveIndex+".success_status");strCompletionStatus=SCORM2004_CallGetValue("cmi.objectives."+ intObjectiveIndex+".completion_status");if(strSuccessStatus==SCORM2004_PASSED){WriteToDebug("returning Passed");return LESSON_STATUS_PASSED;}
else if(strSuccessStatus==SCORM2004_FAILED){WriteToDebug("Returning Failed");return LESSON_STATUS_FAILED;}
else if(strCompletionStatus==SCORM2004_COMPLETED){WriteToDebug("Returning Completed");return LESSON_STATUS_COMPLETED;}
else if(strCompletionStatus==SCORM2004_INCOMPLETE){WriteToDebug("Returning Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strCompletionStatus==SCORM2004_NOT_ATTEMPTED||strCompletionStatus==SCORM2004_UNKNOWN||strCompletionStatus==""){WriteToDebug("Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_STATUS,"Invalid objective status received from LMS or initial status not yet recorded for objective","strCompletionStatus="+ strCompletionStatus);return null;}}
function SCORM2004_GetObjectiveProgressMeasure(strObjectiveID){var strProgressMeasure=SCORM2004_CallGetValue("cmi.objectives."+ strObjectiveID+".progress_measure");return strProgressMeasure;}
function SCORM2004_GetObjectiveDescription(strObjectiveID){var intObjectiveIndex;var strSuccessStatus;var strCompletionStatus;WriteToDebug("In SCORM2004_GetObjectiveDescription, strObejctiveID="+ strObjectiveID);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);strDescription=SCORM2004_CallGetValue("cmi.objectives."+ intObjectiveIndex+".description");return strDescription;}
function SCORM2004_FindObjectiveIndexFromID(strObjectiveID){var intCount;var i;var strTempID;WriteToDebug("In SCORM2004_FindObjectiveIndexFromID");intCount=SCORM2004_CallGetValue("cmi.objectives._count");if(intCount==""){WriteToDebug("Setting intCount=0");return 0;}
intCount=parseInt(intCount,10);WriteToDebug("intCount="+ intCount);for(i=0;i&lt;intCount;i++){WriteToDebug("Checking index "+ i);strTempID=SCORM2004_CallGetValue("cmi.objectives."+ i+".id");WriteToDebug("ID="+ strTempID);if(strTempID==strObjectiveID){WriteToDebug("Found Matching index");return i;}}
WriteToDebug("Did not find match, returning count");return intCount;}
function SCORM2004_SetFailed(){WriteToDebug("In SCORM2004_SetFailed");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.success_status",SCORM2004_FAILED);blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_COMPLETED)&amp;&amp;blnResult;return blnResult;}
function SCORM2004_SetPassed(){WriteToDebug("In SCORM2004_SetPassed");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.success_status",SCORM2004_PASSED);blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_COMPLETED)&amp;&amp;blnResult;return blnResult;}
function SCORM2004_SetCompleted(){WriteToDebug("In SCORM2004_SetCompleted");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_COMPLETED);return blnResult;}
function SCORM2004_ResetStatus(){WriteToDebug("In SCORM2004_ResetStatus");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.success_status",SCORM2004_UNKNOWN);blnResult=SCORM2004_CallSetValue("cmi.completion_status",SCORM2004_INCOMPLETE)&amp;&amp;blnResult;return blnResult;}
function SCORM2004_GetStatus(){var strSuccessStatus;var strCompletionStatus;WriteToDebug("In SCORM2004_GetStatus");SCORM2004_ClearErrorInfo();strSuccessStatus=SCORM2004_CallGetValue("cmi.success_status");strCompletionStatus=SCORM2004_CallGetValue("cmi.completion_status");WriteToDebug("strSuccessStatus="+ strSuccessStatus);WriteToDebug("strCompletionStatus="+ strCompletionStatus);if(strSuccessStatus==SCORM2004_PASSED){WriteToDebug("returning Passed");return LESSON_STATUS_PASSED;}
else if(strSuccessStatus==SCORM2004_FAILED){WriteToDebug("Returning Failed");return LESSON_STATUS_FAILED;}
else if(strCompletionStatus==SCORM2004_COMPLETED){WriteToDebug("Returning Completed");return LESSON_STATUS_COMPLETED;}
else if(strCompletionStatus==SCORM2004_INCOMPLETE){WriteToDebug("Returning Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strCompletionStatus==SCORM2004_NOT_ATTEMPTED||strCompletionStatus==SCORM2004_UNKNOWN){WriteToDebug("Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");SCORM2004_SetErrorInfoManually(SCORM2004_ERROR_INVALID_STATUS,"Invalid lesson status received from LMS","strCompletionStatus="+ strCompletionStatus);return null;}}
function SCORM2004_GetProgressMeasure(){WriteToDebug("In SCORM2004_GetProgressMeasure");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallGetValue("cmi.progress_measure");return blnResult;}
function SCORM2004_SetProgressMeasure(numMeasure){WriteToDebug("In SCORM2004_SetProgressMeasure");var blnResult;SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.progress_measure",numMeasure);return blnResult;}
function SCORM2004_SetObjectiveProgressMeasure(strObjectiveID,numMeasure){WriteToDebug("In SCORM2004_SetObjectiveProgressMeasure");var intObjectiveIndex;var blnResult;WriteToDebug("In SCORM2004_SetObjectiveProgressMeasure, strObejctiveID="+ strObjectiveID+", numMeasure="+ numMeasure);SCORM2004_ClearErrorInfo();intObjectiveIndex=SCORM2004_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);SCORM2004_ClearErrorInfo();blnResult=SCORM2004_CallSetValue("cmi.objectives."+ intObjectiveIndex+".progress_measure",numMeasure);return blnResult;}
function SCORM2004_IsContentInBrowseMode(){var strLessonMode
WriteToDebug("In SCORM2004_IsContentInBrowseMode");strLessonMode=SCORM2004_CallGetValue("cmi.mode");WriteToDebug("SCORM2004_IsContentInBrowseMode,  strLessonMode="+ strLessonMode);if(strLessonMode==SCORM2004_BROWSE){WriteToDebug("Returning true");return true;}
else{WriteToDebug("Returning false");return false;}}
function SCORM2004_TranslateExitTypeToSCORM(strExitType){WriteToDebug("In SCORM2004_TranslatgeExitTypeToSCORM strExitType-"+ strExitType);if(strExitType==EXIT_TYPE_SUSPEND){WriteToDebug("Returning suspend");return SCORM2004_SUSPEND;}
else if(strExitType==EXIT_TYPE_UNLOAD){WriteToDebug("Returning Exit");return SCORM2004_NORMAL_EXIT;}
else if(strExitType==EXIT_TYPE_FINISH){WriteToDebug("Returning Logout");return SCORM2004_NORMAL_EXIT;}
else if(strExitType==EXIT_TYPE_TIMEOUT){WriteToDebug("Returning Timout");return SCORM2004_TIMEOUT;}}
function SCORM2004_GetCompletionStatus(){WriteToDebug("In SCORM2004_GetCompletionStatus");return SCORM2004_COMPLETED;}
function SCORM2004_SetPointBasedScore(intScore,intMaxScore,intMinScore){var blnResult;var fltCalculatedScore;WriteToDebug("In SCORM2004_SetPointBasedScore intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM2004_ClearErrorInfo();if(intScore&gt;=intMinScore)
{fltCalculatedScore=intScore/intMaxScore;}else{WriteToDebug("intScore is lower than intMinScore. Overriding score with minscore for cmi.score.scaled");fltCalculatedScore=intMinScore/intMaxScore;}
fltCalculatedScore=RoundToPrecision(fltCalculatedScore,7);blnResult=SCORM2004_CallSetValue("cmi.score.raw",intScore);blnResult=SCORM2004_CallSetValue("cmi.score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.score.min",intMinScore)&amp;&amp;blnResult;blnResult=SCORM2004_CallSetValue("cmi.score.scaled",fltCalculatedScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM2004_FindInteractionIndexFromID(strInteractionID){var intCount;var i;var strTempID;var dtmTempDate=new Date();var index;var currentIndexTimestamp=new Date("1/1/1900");WriteToDebug("In SCORM2004_FindInteractionIndexFromID");intCount=SCORM2004_CallGetValue("cmi.interactions._count");if(intCount==""){WriteToDebug("Setting intCount=0");return null;}
intCount=parseInt(intCount,10);WriteToDebug("intCount="+ intCount);for(i=0;i&lt;intCount;i++){WriteToDebug("Checking index "+ i);strTempID=SCORM2004_CallGetValue("cmi.interactions."+ i+".id");WriteToDebug("ID="+ strTempID);if(strTempID==strInteractionID){WriteToDebug("Found Matching index: "+ i);dtmTempDate=ConvertIso8601TimeStampToDate(SCORM2004_CallGetValue("cmi.interactions."+ i+".timestamp"));WriteToDebug("timestamp for "+ i+": "+ dtmTempDate);if(dtmTempDate&gt;currentIndexTimestamp)
{index=i;currentIndexTimestamp=dtmTempDate;}}}
if(index&gt;=0)return index;WriteToDebug("Did not find match, returning null");return null;}
function SCORM2004_GetInteractionType(strInteractionID)
{var intInteractionIndex;WriteToDebug("In SCORM2004_GetInteractionType, strInteractionID="+ strInteractionID);SCORM2004_ClearErrorInfo();intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
WriteToDebug("intInteractionIndex="+ intInteractionIndex);var type=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".type");switch(type)
{case SCORM2004_INTERACTION_TYPE_FILL_IN:return INTERACTION_TYPE_FILL_IN;case SCORM2004_INTERACTION_TYPE_LONG_FILL_IN:return INTERACTION_TYPE_LONG_FILL_IN;case SCORM2004_INTERACTION_TYPE_CHOICE:return INTERACTION_TYPE_CHOICE;case SCORM2004_INTERACTION_TYPE_LIKERT:return INTERACTION_TYPE_LIKERT;case SCORM2004_INTERACTION_TYPE_MATCHING:return INTERACTION_TYPE_MATCHING;case SCORM2004_INTERACTION_TYPE_NUMERIC:return INTERACTION_TYPE_NUMERIC;case SCORM2004_INTERACTION_TYPE_PERFORMANCE:return INTERACTION_TYPE_PERFORMANCE;case SCORM2004_INTERACTION_TYPE_SEQUENCING:return INTERACTION_TYPE_SEQUENCING;case SCORM2004_INTERACTION_TYPE_TRUE_FALSE:return INTERACTION_TYPE_TRUE_FALSE;default:return"";}}
function SCORM2004_GetInteractionTimestamp(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionTimestamp, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
return SCORM2004_CallGetValue(ConvertIso8601TimeStampToDate("cmi.interactions."+ intInteractionIndex+".timestamp"));}
function SCORM2004_GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionCorrectResponses, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
var strType=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".type");var intCorrectResponseCount=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".correct_responses._count");if(intCorrectResponseCount==""){WriteToDebug("Setting intCorrectResponseCount=0");return 0;}
intCorrectResponseCount=parseInt(intCorrectResponseCount,10);WriteToDebug("intCorrectResponseCount="+ intCorrectResponseCount);if(intCorrectResponseCount==0)return new Array();if(intCorrectResponseCount&gt;1)WriteToDebug("SCORM Driver is not currently implemented to support multiple correct response combinations and will only return the first");var strResponse=new String(SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".correct_responses.0.pattern"));var aryResponse=strResponse.split("[,]");WriteToDebug("aryResponse.length = "+ aryResponse.length);aryResponse=SCORM2004_ProcessResponseArray(strType,aryResponse);WriteToDebug("aryResponse.length = "+ aryResponse.length);return aryResponse;}
function SCORM2004_GetInteractionWeighting(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionWeighting, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
return SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".weighting");}
function SCORM2004_GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionLearnerResponses, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
var strType=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".type");var strResponse=new String(SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".learner_response"));var aryResponses=strResponse.split("[,]");WriteToDebug("aryResponses.length = "+ aryResponses.length);aryResponses=SCORM2004_ProcessResponseArray(strType,aryResponses);return aryResponses;}
function SCORM2004_ProcessResponseArray(strInteractionType,aryResponses)
{WriteToDebug("Processing Response Array with "+ aryResponses.length+" pieces");for(var i=0;i&lt;aryResponses.length;i++)
{if(strInteractionType==SCORM2004_INTERACTION_TYPE_MATCHING)
{WriteToDebug("processing matching type, i="+ i);aryResponses[i]=CreateMatchingResponse(aryResponses[i]);}}
return aryResponses;}
function SCORM2004_GetInteractionResult(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionResult, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
return SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".result");}
function SCORM2004_GetInteractionLatency(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionLatency, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
var strLatency=SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".latency");WriteToDebug("latency returns: "+ strLatency);var intLatency=ConvertScorm2004TimeToMS(strLatency);WriteToDebug("latency in milliseconds: "+ intLatency);return intLatency;}
function SCORM2004_GetInteractionDescription(strInteractionID)
{WriteToDebug("In SCORM2004_GetInteractionDescription, strInteractionID="+ strInteractionID);var intInteractionIndex=SCORM2004_FindInteractionIndexFromID(strInteractionID);WriteToDebug("intInteractionIndex="+ intInteractionIndex);SCORM2004_ClearErrorInfo();if(intInteractionIndex==undefined||intInteractionIndex==null){return null;}
return SCORM2004_CallGetValue("cmi.interactions."+ intInteractionIndex+".description");}
function SCORM2004_CreateDataBucket(strBucketId,intMinSize,intMaxSize,strPersistenceType){WriteToDebug("In SCORM2004_CreateDataBucket, strBucketId="+ strBucketId+", intMinSize="+ intMinSize+", intMaxSize="+ intMaxSize+", course="+ strPersistenceType);if(SCORM2004_DetectSSPSupport()){if(SCORM2004_DoesBucketExist(strBucketId)==true){WriteToDebug("Bucket already exists and can't be re-allocated.");return false;}
else{return SCORM2004_CallSetValue("ssp.allocate","{bucketID="+ strBucketId+"}{requested="+ intMaxSize+"}{minimum="+ intMinSize+"}{reducible=true}{persistence="+ strPersistenceType+"}")}}
else{WriteToDebug("SSP is not supported in this LMS, returning false.");return false;}}
function SCORM2004_GetDataFromBucket(strBucketId){WriteToDebug("In SCORM2004_GetDataFromBucket, strBucketId="+ strBucketId);if(SCORM2004_DetectSSPSupport()){var data=SCORM2004_CallGetValue("ssp.data.{bucketID="+ strBucketId+"}");return data;}
else{WriteToDebug("SSP is not supported in this LMS, returning empty string.");return"";}}
function SCORM2004_PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("In SCORM2004_PutDataInBucket, strBucketId="+ strBucketId+", blnAppendToEnd="+ blnAppendToEnd+", strData="+ strData);if(SCORM2004_DetectSSPSupport()){if(blnAppendToEnd==true){return SCORM2004_CallSetValue("ssp.appendData","{bucketID="+ strBucketId+"}"+ strData);}
else{return SCORM2004_CallSetValue("ssp.data","{bucketID="+ strBucketId+"}"+ strData);}}
else{WriteToDebug("SSP is not supported in this LMS, returning false.");return false;}}
function SCORM2004_DetectSSPSupport(){WriteToDebug("In SCORM2004_DetectSSPSupport");if(blnSCORM2004_SSP_Is_Supported==true){WriteToDebug("Support already detected, returning true");return true;}
else if(blnSCORM2004_SSP_Is_Supported==false){WriteToDebug("Support already determined to me missing, returning false");return false;}
else{var intBucketCount=SCORM2004_CallGetValue("ssp._count");if(SCORM2004_GetLastError()==NO_ERROR){WriteToDebug("SSP data model call succeeded, SSP is supported");blnSCORM2004_SSP_Is_Supported=true;return true;}
else{WriteToDebug("SSP data model call failed, SSP is NOT supported");blnSCORM2004_SSP_Is_Supported=false;return false;}}}
function SCORM2004_GetBucketInfo(strBucketId){WriteToDebug("In SCORM2004_GetBucketInfo, strBucketId="+ strBucketId);var intTotalSpace=0;var intUsedSpace=0;var strBucketState=new String(SCORM2004_CallGetValue("ssp.bucket_state.{bucketID="+ strBucketId+"}"));if(strBucketState==""||strBucketState==null||strBucketState==undefined){WriteToDebug("Could not retrieve bucket state, returning 0 total size and 0 used size");return new SSPBucketSize(0,0);}
var sectionArray=strBucketState.split("{");for(var section in sectionArray){section=new String(sectionArray[section]);section=section.replace("}","");if(section.indexOf("totalSpace",0)==0){WriteToDebug("Found total space");intTotalSpace=parseInt(section.substr(11),10);WriteToDebug("total space="+ intTotalSpace);}
else if(section.indexOf("used",0)==0){WriteToDebug("Found used space");intUsedSpace=parseInt(section.substr(5),10);WriteToDebug("used="+ intUsedSpace);}}
var returnValue=new SSPBucketSize(intTotalSpace,intUsedSpace);return returnValue;}
function SCORM2004_DoesBucketExist(strBucketId){WriteToDebug("In SCORM2004_DoesBucketExist, strBucketId="+ strBucketId);var intBucketCount=SCORM2004_CallGetValue("ssp._count");intBucketCount=parseInt(intBucketCount,10);for(var i=0;i&lt;intBucketCount;i++){if(strBucketId==SCORM2004_CallGetValue("ssp."+ i+".id")){WriteToDebug("Bucket '"+ strBucketId+"' Exists");return true;}}
WriteToDebug("Bucket '"+ strBucketId+"' DOES NOT Exist");return false;}
function SCORM2004_CallInitialize(){var strResult;WriteToDebug("In SCORM2004_CallInitialize");SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Calling Initialize");strResult=SCORM2004_objAPI.Initialize("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM2004_FALSE){WriteToDebug("Detected failed call to initialize");SCORM2004_SetErrorInfo();WriteToDebug("Error calling Initialize:");WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM2004_CallSetValue(strElement,strValue){var strResult;WriteToDebug("SCORM2004_CallSetValue strElement="+ strElement+", strValue="+ strValue);if(blnReviewModeSoReadOnly===true){WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");return true;}
SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Calling SetValue");strElement=strElement+"";strValue=strValue+"";strResult=SCORM2004_objAPI.SetValue(strElement,strValue)
strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM2004_FALSE){WriteToDebug("Detected Failed call to SetValue");SCORM2004_SetErrorInfo();WriteToDebug("Error calling SetValue:");WriteToDebug("              strElement="+ strElement);WriteToDebug("              strValue="+ strValue);WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM2004_CallGetValue(strElement){var strResult
WriteToDebug("In SCORM2004_CallGetValue strElement="+ strElement);SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Call GetValue");strElement=strElement+"";strResult=SCORM2004_objAPI.GetValue(strElement)+""
WriteToDebug("strResult="+ strResult);intSCORM2004Error=SCORM2004_objAPI.GetLastError()
intSCORM2004Error=intSCORM2004Error+"";WriteToDebug("intSCORM2004Error="+ intSCORM2004Error);if(intSCORM2004Error!=SCORM2004_NO_ERROR){WriteToDebug("Detected failed called to GetValue");SCORM2004_SetErrorInfo();WriteToDebug("Error calling LMSGetValue:");WriteToDebug("              strElement="+ strElement);WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);}
WriteToDebug("Returning "+ strResult);return strResult;}
function SCORM2004_CallCommit(){var strResult;WriteToDebug("In SCORM2004_CallCommit");SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Calling Commit");strResult=SCORM2004_objAPI.Commit("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM2004_FALSE){WriteToDebug("Detected failed call to Commit");SCORM2004_SetErrorInfo();WriteToDebug("Error calling Commit:");WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM2004_CallTerminate(){var strResult;WriteToDebug("In SCORM2004_CallTerminate");SCORM2004_objAPI=SCORM2004_GrabAPI();WriteToDebug("Calling Terminate");strResult=SCORM2004_objAPI.Terminate("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM2004_FALSE){WriteToDebug("Detected failed call to Terminate");SCORM2004_SetErrorInfo();WriteToDebug("Error calling Terminate:");WriteToDebug("              Error Number="+ intSCORM2004Error);WriteToDebug("              Error String="+ strSCORM2004ErrorString);WriteToDebug("              Diagnostic="+ strSCORM2004ErrorDiagnostic);return false;}
WriteToDebug("Returning True");return true;}
function SCORM2004_ClearErrorInfo(){WriteToDebug("In SCORM2004_ClearErrorInfo");intSCORM2004Error=SCORM2004_NO_ERROR;strSCORM2004ErrorString="";strSCORM2004ErrorDiagnostic="";}
function SCORM2004_SetErrorInfo(){WriteToDebug("In SCORM2004_SetErrorInfo");intSCORM2004Error=SCORM2004_objAPI.GetLastError();strSCORM2004ErrorString=SCORM2004_objAPI.GetErrorString(intSCORM2004Error);strSCORM2004ErrorDiagnostic=SCORM2004_objAPI.GetDiagnostic("");intSCORM2004Error=intSCORM2004Error+"";strSCORM2004ErrorString=strSCORM2004ErrorString+"";strSCORM2004ErrorDiagnostic=strSCORM2004ErrorDiagnostic+"";WriteToDebug("intSCORM2004Error="+ intSCORM2004Error);WriteToDebug("strSCORM2004ErrorString="+ strSCORM2004ErrorString);WriteToDebug("strSCORM2004ErrorDiagnostic="+ strSCORM2004ErrorDiagnostic);}
function SCORM2004_SetErrorInfoManually(intNum,strString,strDiagnostic){WriteToDebug("In SCORM2004_SetErrorInfoManually");WriteToDebug("ERROR-Num="+ intNum);WriteToDebug("      String="+ strString);WriteToDebug("      Diag="+ strDiagnostic);intSCORM2004Error=intNum;strSCORM2004ErrorString=strString;strSCORM2004ErrorDiagnostic=strDiagnostic;}
function SCORM2004_GetLastError(){WriteToDebug("In SCORM2004_GetLastError");if(intSCORM2004Error==SCORM2004_NO_ERROR){WriteToDebug("Returning No Error");return NO_ERROR;}
else{WriteToDebug("Returning "+ intSCORMError);return intSCORM2004Error;}}
function SCORM2004_GetLastErrorDesc(){WriteToDebug("In SCORM2004_GetLastErrorDesc, "+ strSCORM2004ErrorString+"\n"+ strSCORM2004ErrorDiagnostic);return strSCORM2004ErrorString+"\n"+ strSCORM2004ErrorDiagnostic;}
function SCORM2004_GrabAPI(){WriteToDebug("In SCORM2004_GrabAPI");if(typeof(SCORM2004_objAPI)=="undefined"||SCORM2004_objAPI==null){WriteToDebug("Searching with Rustici Software algorithm");SCORM2004_objAPI=SCORM2004_GetAPI();}
if(typeof(SCORM2004_objAPI)=="undefined"||SCORM2004_objAPI==null||SCORM2004_objAPI==false){WriteToDebug("Searching with SearchForAPI");SCORM2004_objAPI=SCORM2004_SearchForAPI(window);}
WriteToDebug("Grab API, returning, found API = "+(SCORM2004_objAPI!=null));return SCORM2004_objAPI;}
function SCORM2004_ScanParentsForApi(win)
{var MAX_PARENTS_TO_SEARCH=500;var nParentsSearched=0;while((win.API_1484_11==null||win.API_1484_11==undefined)&amp;&amp;(win.parent!=null)&amp;&amp;(win.parent!=win)&amp;&amp;(nParentsSearched&lt;=MAX_PARENTS_TO_SEARCH))
{nParentsSearched++;win=win.parent;}
return win.API_1484_11;}
function SCORM2004_GetAPI()
{var API=null;if((window.parent!=null)&amp;&amp;(window.parent!=window))
{API=SCORM2004_ScanParentsForApi(window.parent);}
if((API==null)&amp;&amp;(window.top.opener!=null))
{API=SCORM2004_ScanParentsForApi(window.top.opener);}
return API;}
function SCORM2004_SearchForAPI(wndLookIn){WriteToDebug("SCORM2004_SearchForAPI");var objAPITemp=null;var strDebugID="";strDebugID="Name="+ wndLookIn.name+", href="+ wndLookIn.location.href
objAPITemp=wndLookIn.API_1484_11;if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in this window - "+ strDebugID);return objAPITemp;}
if(SCORM2004_WindowHasParent(wndLookIn)){WriteToDebug("Searching Parent - "+ strDebugID);objAPITemp=SCORM2004_SearchForAPI(wndLookIn.parent);}
if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in a parent - "+ strDebugID);return objAPITemp;}
if(SCORM2004_WindowHasOpener(wndLookIn)){WriteToDebug("Searching Opener - "+ strDebugID);objAPITemp=SCORM2004_SearchForAPI(wndLookIn.opener);}
if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in an opener - "+ strDebugID);return objAPITemp;}
WriteToDebug("Looking in children - "+ strDebugID);objAPITemp=SCORM2004_LookInChildren(wndLookIn);if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in Children - "+ strDebugID);return objAPITemp;}
WriteToDebug("Didn't find API in this window - "+ strDebugID);return null;}
function SCORM2004_LookInChildren(wnd){WriteToDebug("SCORM2004_LookInChildren");var objAPITemp=null;var strDebugID="";strDebugID="Name="+ wnd.name+", href="+ wnd.location.href
for(var i=0;i&lt;wnd.frames.length;i++){WriteToDebug("Looking in child frame "+ i);objAPITemp=wnd.frames[i].API_1484_11;if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("Found API in child frame of "+ strDebugID);return objAPITemp;}
WriteToDebug("Looking in this child's children "+ strDebugID);objAPITemp=SCORM2004_LookInChildren(wnd.frames[i]);if(SCORM2004_APIFound(objAPITemp)){WriteToDebug("API found in this child's children "+ strDebugID);return objAPITemp;}}
return null;}
function SCORM2004_WindowHasOpener(wnd){WriteToDebug("In SCORM2004_WindowHasOpener");if((wnd.opener!=null)&amp;&amp;(wnd.opener!=wnd)&amp;&amp;(typeof(wnd.opener)!="undefined")){WriteToDebug("Window Does Have Opener");return true;}
else{WriteToDebug("Window Does Not Have Opener");return false;}}
function SCORM2004_WindowHasParent(wnd){WriteToDebug("In SCORM2004_WindowHasParent");if((wnd.parent!=null)&amp;&amp;(wnd.parent!=wnd)&amp;&amp;(typeof(wnd.parent)!="undefined")){WriteToDebug("Window Does Have Parent");return true;}
else{WriteToDebug("Window Does Not Have Parent");return false;}}
function SCORM2004_APIFound(obj){WriteToDebug("In SCORM2004_APIFound");if(obj==null||typeof(obj)=="undefined"){WriteToDebug("API NOT Found");return false;}
else{WriteToDebug("API Found");return true;}}</text>
				</content>
				<redirectionURL/>
				<headersSize>292</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/SCORMFunctions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>373</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="SCORMFunctions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var SCORM_LOGOUT="logout";var SCORM_SUSPEND="suspend";var SCORM_NORMAL_EXIT="";var SCORM_TIMEOUT="time-out";var SCORM_PASSED="passed";var SCORM_FAILED="failed";var SCORM_COMPLETED="completed";var SCORM_BROWSED="browsed";var SCORM_INCOMPLETE="incomplete";var SCORM_NOT_ATTEMPTED="not attempted";var SCORM_CREDIT="credit";var SCORM_NO_CREDIT="no-credit";var SCORM_BROWSE="browse";var SCORM_NORMAL="normal";var SCORM_REVIEW="review";var SCORM_ENTRY_ABINITIO="ab-initio";var SCORM_ENTRY_RESUME="resume";var SCORM_ENTRY_NORMAL="";var SCORM_TLA_EXIT_MESSAGE="exit,message";var SCORM_TLA_EXIT_NO_MESSAGE="exit,no message";var SCORM_TLA_CONTINUE_MESSAGE="continue,message";var SCORM_TLA_CONTINUE_NO_MESSAGE="continue,no message";var SCORM_RESULT_CORRECT="correct";var SCORM_RESULT_WRONG="wrong";var SCORM_RESULT_UNANTICIPATED="unanticipated";var SCORM_RESULT_NEUTRAL="neutral";var SCORM_INTERACTION_TYPE_TRUE_FALSE="true-false";var SCORM_INTERACTION_TYPE_CHOICE="choice";var SCORM_INTERACTION_FILL_IN="fill-in";var SCORM_INTERACTION_TYPE_MATCHING="matching";var SCORM_INTERACTION_TYPE_PERFORMANCE="performance";var SCORM_INTERACTION_TYPE_SEQUENCING="sequencing";var SCORM_INTERACTION_TYPE_LIKERT="likert";var SCORM_INTERACTION_TYPE_NUMERIC="numeric";var SCORM_NO_ERROR="0";var SCORM_ERROR_INVALID_PREFERENCE="-1";var SCORM_ERROR_INVALID_STATUS="-2";var SCORM_ERROR_INVALID_SPEED="-3";var SCORM_ERROR_INVALID_TIMESPAN="-4";var SCORM_ERROR_INVALID_TIME_LIMIT_ACTION="-5";var SCORM_ERROR_INVALID_DECIMAL="-6";var SCORM_ERROR_INVALID_CREDIT="-7";var SCORM_ERROR_INVALID_LESSON_MODE="-8";var SCORM_ERROR_INVALID_ENTRY="-9";var SCORM_TRUE="true";var SCORM_FALSE="false";var SCORM_findAPITries=0;var SCORM_objAPI=null;var intSCORMError=SCORM_NO_ERROR;var strSCORMErrorString="";var strSCORMErrorDiagnostic="";var blnReviewModeSoReadOnly=false;function SCORM_Initialize(){var blnResult=true;WriteToDebug("In SCORM_Initialize");SCORM_ClearErrorInfo();WriteToDebug("Grabbing API");try{SCORM_objAPI=SCORM_GrabAPI();}
catch(e){WriteToDebug("Error grabbing 1.2 API-"+ e.name+":"+ e.message);}
if(typeof(SCORM_objAPI)=="undefined"||SCORM_objAPI==null){WriteToDebug("Unable to acquire SCORM API:")
WriteToDebug("SCORM_objAPI="+ typeof(SCORM_objAPI));InitializeExecuted(false,"Error - unable to acquire LMS API, content may not play properly and results may not be recorded.  Please contact technical support.");return false;}
WriteToDebug("Calling LMSInit");blnResult=SCORM_CallLMSInitialize();if(!blnResult){WriteToDebug("ERROR Initializing LMS");InitializeExecuted(false,"Error initializing communications with LMS");return false;}
if(SCORM_GetLessonMode()!=MODE_REVIEW){if(SCORM_IsContentInBrowseMode()){WriteToDebug("Setting Status to Browsed");blnResult=SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_BROWSED);}
else{if(SCORM_GetStatus()==LESSON_STATUS_NOT_ATTEMPTED){WriteToDebug("Setting Status to Incomplete");blnResult=SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_INCOMPLETE);}}
blnResult=SCORM_CallLMSSetValue("cmi.core.exit",SCORM_TranslateExitTypeToSCORM(DEFAULT_EXIT_TYPE))&amp;&amp;blnResult;}
else{if(!(typeof(REVIEW_MODE_IS_READ_ONLY)=="undefined")&amp;&amp;REVIEW_MODE_IS_READ_ONLY===true){blnReviewModeSoReadOnly=true;}}
WriteToDebug("Calling InitializeExecuted with parameter-"+ blnResult);InitializeExecuted(blnResult,"");return;}
function SCORM_Finish(strExitType,blnStatusWasSet){var strStatusAfterCompletion;var blnResult=true;WriteToDebug("In SCORM_Finish strExitType="+ strExitType+", blnStatusWasSet="+ blnStatusWasSet);SCORM_ClearErrorInfo();if((strExitType==EXIT_TYPE_FINISH)&amp;&amp;!blnStatusWasSet){WriteToDebug("Getting completion status");strStatusAfterCompletion=SCORM_GetCompletionStatus();WriteToDebug("Setting completion status to "+ strStatusAfterCompletion);blnResult=SCORM_CallLMSSetValue("cmi.core.lesson_status",strStatusAfterCompletion)&amp;&amp;blnResult;}
WriteToDebug("Setting Exit");blnResult=SCORM_CallLMSSetValue("cmi.core.exit",SCORM_TranslateExitTypeToSCORM(strExitType))&amp;&amp;blnResult;WriteToDebug("Calling Commit");blnResult=SCORM_CallLMSCommit()&amp;&amp;blnResult;WriteToDebug("Calling Finish");blnResult=SCORM_CallLMSFinish()&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_CommitData(){WriteToDebug("In SCORM_CommitData");SCORM_ClearErrorInfo();return SCORM_CallLMSCommit();}
function SCORM_GetStudentID(){WriteToDebug("In SCORM_GetStudentID");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.core.student_id");}
function SCORM_GetStudentName(){WriteToDebug("In SCORM_GetStudentName");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.core.student_name");}
function SCORM_GetBookmark(){WriteToDebug("In SCORM_GetBookmark");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.core.lesson_location");}
function SCORM_SetBookmark(strBookmark){WriteToDebug("In SCORM_SetBookmark strBookmark="+ strBookmark);SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_location",strBookmark);}
function SCORM_GetDataChunk(){WriteToDebug("In SCORM_GetDataChunk");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.suspend_data");}
function SCORM_SetDataChunk(strData){WriteToDebug("In SCORM_SetDataDChunk");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.suspend_data",strData);}
function SCORM_GetLaunchData(){WriteToDebug("In SCORM_GetLaunchData");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.launch_data");}
function SCORM_GetComments(){WriteToDebug("In SCORM_GetComments");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.comments");}
function SCORM_WriteComment(strComment){WriteToDebug("In SCORM_WriteComment strComment="+ strComment);SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.comments",strComment);}
function SCORM_GetLMSComments(){WriteToDebug("In SCORM_GetLMSComments");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.comments_from_lms");}
function SCORM_GetAudioPlayPreference(){var intTempPreference;WriteToDebug("In SCORM_GetAudioPlayPreference");SCORM_ClearErrorInfo();intTempPreference=SCORM_CallLMSGetValue("cmi.student_preference.audio");if(intTempPreference==""){intTempPreference=0;}
intTempPreference=parseInt(intTempPreference,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0){WriteToDebug("Returning On");return PREFERENCE_ON;}
else if(intTempPreference==0){WriteToDebug("Returning Default");return PREFERENCE_DEFAULT;}
else if(intTempPreference&lt;0){WriteToDebug("returning Off");return PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS","intTempPreference="+ intTempPreference);return null;}}
function SCORM_GetAudioVolumePreference(){var intTempPreference;WriteToDebug("In SCORM_GetAudioVollumePreference");SCORM_ClearErrorInfo();intTempPreference=SCORM_CallLMSGetValue("cmi.student_preference.audio");WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference==""){intTempPreference=100;}
intTempPreference=parseInt(intTempPreference,10);if(intTempPreference&lt;=0){WriteToDebug("Setting to 100");intTempPreference=100;}
if(!(intTempPreference&gt;0&amp;&amp;intTempPreference&lt;=100)){WriteToDebug("ERROR: invalid preference");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS","intTempPreference="+ intTempPreference);return null;}
WriteToDebug("Returning "+ intTempPreference);return intTempPreference;}
function SCORM_SetAudioPreference(PlayPreference,intPercentOfMaxVolume){WriteToDebug("In SCORM_SetAudioPreference PlayPreference="+ PlayPreference+", intPercentOfMaxVolume="+ intPercentOfMaxVolume);SCORM_ClearErrorInfo();if(PlayPreference==PREFERENCE_OFF){WriteToDebug("Setting percent to -1");intPercentOfMaxVolume=-1;}
return SCORM_CallLMSSetValue("cmi.student_preference.audio",intPercentOfMaxVolume);}
function SCORM_SetLanguagePreference(strLanguage){WriteToDebug("In SCORM_SetLanguagePreference strLanguage="+ strLanguage);SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.student_preference.language",strLanguage);}
function SCORM_GetLanguagePreference(){WriteToDebug("In SCORM_GetLanguagePreference");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.student_preference.language");}
function SCORM_SetSpeedPreference(intPercentOfMax){var intSCORMSpeed;WriteToDebug("In SCORM_SetSpeedPreference intPercentOfMax="+ intPercentOfMax);SCORM_ClearErrorInfo();intSCORMSpeed=(intPercentOfMax*2)- 100;WriteToDebug("intSCORMSpeed="+ intSCORMSpeed);return SCORM_CallLMSSetValue("cmi.student_preference.speed",intSCORMSpeed);}
function SCORM_GetSpeedPreference(){var intSCORMSpeed;var intPercentOfMax;WriteToDebug("In SCORM_GetSpeedPreference");SCORM_ClearErrorInfo();intSCORMSpeed=SCORM_CallLMSGetValue("cmi.student_preference.speed");WriteToDebug("intSCORMSpeed="+ intSCORMSpeed);if(intSCORMSpeed==""){WriteToDebug("Detected empty string, defaulting to 100");intSCORMSpeed=100;}
if(!ValidInteger(intSCORMSpeed)){WriteToDebug("ERROR - invalid integer");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - not an integer","intSCORMSpeed="+ intSCORMSpeed);return null;}
intSCORMSpeed=parseInt(intSCORMSpeed,10);if(intSCORMSpeed&lt;-100||intSCORMSpeed&gt;100){WriteToDebug("ERROR - out of range");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - out of range","intSCORMSpeed="+ intSCORMSpeed);return null;}
intPercentOfMax=(intSCORMSpeed+ 100)/2;intPercentOfMax=parseInt(intPercentOfMax,10);WriteToDebug("Returning "+ intPercentOfMax);return intPercentOfMax;}
function SCORM_SetTextPreference(intPreference){WriteToDebug("In SCORM_SetTextPreference intPreference="+ intPreference);SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.student_preference.text",intPreference);}
function SCORM_GetTextPreference(){var intTempPreference;WriteToDebug("In SCORM_GetTextPreference");SCORM_ClearErrorInfo();intTempPreference=SCORM_CallLMSGetValue("cmi.student_preference.text");intTempPreference=parseInt(intTempPreference,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0){WriteToDebug("Returning On");return PREFERENCE_ON;}
else if(intTempPreference==0||intTempPreference==""){WriteToDebug("Returning Default");return PREFERENCE_DEFAULT;}
else if(intTempPreference&lt;0){WriteToDebug("returning Off");return PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_PREFERENCE,"Invalid text preference received from LMS","intTempPreference="+ intTempPreference);return null;}}
function SCORM_GetPreviouslyAccumulatedTime(){var strCMITime;var intMilliseconds;WriteToDebug("In SCORM_GetPreviouslyAccumulatedTime");SCORM_ClearErrorInfo();strCMITime=SCORM_CallLMSGetValue("cmi.core.total_time")
WriteToDebug("strCMITime="+ strCMITime);if(!IsValidCMITimeSpan(strCMITime)){WriteToDebug("ERROR - Invalid CMITimeSpan");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_TIMESPAN,"Invalid timespan received from LMS","strTime="+ strCMITime);return null;}
intMilliseconds=ConvertCMITimeSpanToMS(strCMITime);WriteToDebug("Returning "+ intMilliseconds);return intMilliseconds;}
function SCORM_SaveTime(intMilliSeconds){var strCMITime;WriteToDebug("In SCORM_SaveTime intMilliSeconds="+ intMilliSeconds);SCORM_ClearErrorInfo();strCMITime=ConvertMilliSecondsToSCORMTime(intMilliSeconds,true);WriteToDebug("strCMITime="+ strCMITime);return SCORM_CallLMSSetValue("cmi.core.session_time",strCMITime);}
function SCORM_GetMaxTimeAllowed(){var strCMITime;var intMilliseconds;WriteToDebug("In SCORM_GetMaxTimeAllowed");SCORM_ClearErrorInfo();strCMITime=SCORM_CallLMSGetValue("cmi.student_data.max_time_allowed")
WriteToDebug("strCMITime="+ strCMITime);if(strCMITime==""){strCMITime="9999:99:99.99";}
if(!IsValidCMITimeSpan(strCMITime)){WriteToDebug("ERROR - Invalid CMITimeSpan");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_TIMESPAN,"Invalid timespan received from LMS","strTime="+ strCMITime);return null;}
intMilliseconds=ConvertCMITimeSpanToMS(strCMITime);WriteToDebug("intMilliseconds="+ intMilliseconds);return intMilliseconds;}
function SCORM_DisplayMessageOnTimeout(){var strTLA;SCORM_ClearErrorInfo();WriteToDebug("In SCORM_DisplayMessageOnTimeout");strTLA=SCORM_CallLMSGetValue("cmi.student_data.time_limit_action");WriteToDebug("strTLA="+ strTLA);if(strTLA==SCORM_TLA_EXIT_MESSAGE||strTLA==SCORM_TLA_CONTINUE_MESSAGE){WriteToDebug("returning true");return true;}
else if(strTLA==SCORM_TLA_EXIT_NO_MESSAGE||strTLA==SCORM_TLA_CONTINUE_NO_MESSAGE||strTLA==""){WriteToDebug("returning false");return false;}
else{WriteToDebug("Error invalid TLA");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS","strTLA="+ strTLA);return null;}}
function SCORM_ExitOnTimeout(){var strTLA;WriteToDebug("In SCORM_ExitOnTimeout");SCORM_ClearErrorInfo();strTLA=SCORM_CallLMSGetValue("cmi.student_data.time_limit_action");WriteToDebug("strTLA="+ strTLA);if(strTLA==SCORM_TLA_EXIT_MESSAGE||strTLA==SCORM_TLA_EXIT_NO_MESSAGE){WriteToDebug("returning true");return true;}
else if(strTLA==SCORM_TLA_CONTINUE_MESSAGE||strTLA==SCORM_TLA_CONTINUE_NO_MESSAGE||strTLA==""){WriteToDebug("returning false");return false;}
else{WriteToDebug("ERROR invalid TLA");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS","strTLA="+ strTLA);return null;}}
function SCORM_GetPassingScore(){var fltScore;WriteToDebug("In SCORM_GetPassingScore");SCORM_ClearErrorInfo();fltScore=SCORM_CallLMSGetValue("cmi.student_data.mastery_score")
WriteToDebug("fltScore="+ fltScore);if(fltScore==""){fltScore=0;}
if(!IsValidDecimal(fltScore)){WriteToDebug("Error - score is not a valid decimal");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_DECIMAL,"Invalid mastery score received from LMS","fltScore="+ fltScore);return null;}
fltScore=parseFloat(fltScore);WriteToDebug("returning fltScore");return fltScore;}
function SCORM_SetScore(intScore,intMaxScore,intMinScore){var blnResult;WriteToDebug("In SCORM_SetScore intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM_ClearErrorInfo();blnResult=SCORM_CallLMSSetValue("cmi.core.score.raw",intScore);blnResult=SCORM_CallLMSSetValue("cmi.core.score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM_CallLMSSetValue("cmi.core.score.min",intMinScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_GetScore(){WriteToDebug("In SCORM_GetScore");SCORM_ClearErrorInfo();return SCORM_CallLMSGetValue("cmi.core.score.raw");}
function SCORM_SetPointBasedScore(intScore,intMaxScore,intMinScore){WriteToDebug("SCORM_SetPointBasedScore - SCORM 1.1 and 1.2 do not support SetPointBasedScore, returning false");return false;}
function SCORM_GetScaledScore(intScore,intMaxScore,intMinScore){WriteToDebug("SCORM_GetScaledScore - SCORM 1.1 and 1.2 do not support GetScaledScore, returning false");return false;}
function SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,scormInteractionType,strAlternateResponse,strAlternateCorrectResponse){var blnResult;var blnTempResult;var intInteractionIndex;var strResult;SCORM_ClearErrorInfo();intInteractionIndex=SCORM_CallLMSGetValue("cmi.interactions._count");WriteToDebug("intInteractionIndex="+ intInteractionIndex);if(intInteractionIndex==""){WriteToDebug("Setting Interaction Index to 0");intInteractionIndex=0;}
if(blnCorrect==true||blnCorrect==INTERACTION_RESULT_CORRECT){strResult=SCORM_RESULT_CORRECT;}
else if(blnCorrect==""||blnCorrect=="false"||blnCorrect==INTERACTION_RESULT_WRONG){strResult=SCORM_RESULT_WRONG;}
else if(blnCorrect==INTERACTION_RESULT_UNANTICIPATED){strResult=SCORM_RESULT_UNANTICIPATED;}
else if(blnCorrect==INTERACTION_RESULT_NEUTRAL){strResult=SCORM_RESULT_NEUTRAL;}
WriteToDebug("strResult="+ strResult);blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".id",strID);blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".type",scormInteractionType)&amp;&amp;blnResult;blnTempResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".student_response",strResponse);if(blnTempResult==false){blnTempResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".student_response",strAlternateResponse);}
blnResult=blnResult&amp;&amp;blnTempResult;if(strCorrectResponse!=undefined&amp;&amp;strCorrectResponse!=null&amp;&amp;strCorrectResponse!=""){blnTempResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".correct_responses.0.pattern",strCorrectResponse);if(blnTempResult==false){blnTempResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".correct_responses.0.pattern",strAlternateCorrectResponse);}
blnResult=blnResult&amp;&amp;blnTempResult;}
if(strResult!=undefined&amp;&amp;strResult!=null&amp;&amp;strResult!=""){blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".result",strResult)&amp;&amp;blnResult;}
if(intWeighting!=undefined&amp;&amp;intWeighting!=null&amp;&amp;intWeighting!=""){blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".weighting",intWeighting)&amp;&amp;blnResult;}
if(intLatency!=undefined&amp;&amp;intLatency!=null&amp;&amp;intLatency!=""){blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".latency",ConvertMilliSecondsToSCORMTime(intLatency,true))&amp;&amp;blnResult;}
if(strLearningObjectiveID!=undefined&amp;&amp;strLearningObjectiveID!=null&amp;&amp;strLearningObjectiveID!=""){blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".objectives.0.id",strLearningObjectiveID)&amp;&amp;blnResult;}
blnResult=SCORM_CallLMSSetValue("cmi.interactions."+ intInteractionIndex+".time",ConvertDateToCMITime(dtmTime))&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordTrueFalseInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strCorrectResponse=null;if(blnResponse==true){strResponse="t";}
else{strResponse="f";}
if(blnCorrectResponse==true){strCorrectResponse="t";}
else if(blnCorrectResponse==false){strCorrectResponse="f";}
return SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_TRUE_FALSE,strResponse,strCorrectResponse);}
function SCORM_RecordMultipleChoiceInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordMultipleChoiceInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Short;strResponseLong+=aryResponse[i].Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Short;strCorrectResponseLong+=aryCorrectResponse[i].Long;}
var blnSuccessfullySaved;blnSuccessfullySaved=SCORM_RecordInteraction(strID,strResponseLong,blnCorrect,strCorrectResponseLong,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_CHOICE,strResponse,strCorrectResponse);return blnSuccessfullySaved;}
function SCORM_RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordFillInInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);strResponse=new String(strResponse);if(strResponse.length&gt;255){strResponse=strResponse.substr(0,255);}
if(strCorrectResponse==null){strCorrectResponse="";}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;255){strCorrectResponse=strCorrectResponse.substr(0,255);}
return SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_FILL_IN,strResponse,strCorrectResponse);}
function SCORM_RecordMatchingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordMatchingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Source.Short+"."+ aryResponse[i].Target.Short;strResponseLong+=aryResponse[i].Source.Long+"."+ aryResponse[i].Target.Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Source.Short+"."+ aryCorrectResponse[i].Target.Short;strCorrectResponseLong+=aryCorrectResponse[i].Source.Long+"."+ aryCorrectResponse[i].Target.Long;}
var blnSuccessfullySaved;blnSuccessfullySaved=SCORM_RecordInteraction(strID,strResponseLong,blnCorrect,strCorrectResponseLong,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_MATCHING,strResponse,strCorrectResponse);return blnSuccessfullySaved;}
function SCORM_RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordPerformanceInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);strResponse=new String(strResponse);if(strResponse.length&gt;255){strResponse=strResponse.substr(0,255);}
if(strCorrectResponse==null){strCorrectResponse="";}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;255){strCorrectResponse=strCorrectResponse.substr(0,255);}
return SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_PERFORMANCE,strResponse,strCorrectResponse);}
function SCORM_RecordSequencingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordSequencingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Short;strResponseLong+=aryResponse[i].Long;}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Short;strCorrectResponseLong+=aryCorrectResponse[i].Long;}
var blnSuccessfullySaved;blnSuccessfullySaved=SCORM_RecordInteraction(strID,strResponseLong,blnCorrect,strCorrectResponseLong,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_SEQUENCING,strResponse,strCorrectResponse);return blnSuccessfullySaved;}
function SCORM_RecordLikertInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordLikertInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var strResponse;var strResponseLong;var strCorrectResponse="";var strCorrectResponseLong="";strResponse=response.Short;strResponseLong=response.Long;if(correctResponse!=null){strCorrectResponse=correctResponse.Short;strCorrectResponseLong=correctResponse.Long;}
var blnSuccessfullySaved;blnSuccessfullySaved=SCORM_RecordInteraction(strID,strResponseLong,blnCorrect,strCorrectResponseLong,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_LIKERT,strResponse,strCorrectResponse);return blnSuccessfullySaved;}
function SCORM_RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In SCORM_RecordNumericInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);return SCORM_RecordInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime,SCORM_INTERACTION_TYPE_NUMERIC,strResponse,strCorrectResponse);}
function SCORM_GetEntryMode(){var strEntry;WriteToDebug("In SCORM_GetEntryMode");SCORM_ClearErrorInfo();strEntry=SCORM_CallLMSGetValue("cmi.core.entry");WriteToDebug("strEntry="+ strEntry);if(strEntry==SCORM_ENTRY_ABINITIO){WriteToDebug("Returning first time");return ENTRY_FIRST_TIME;}
else if(strEntry==SCORM_ENTRY_RESUME){WriteToDebug("Returning resume");return ENTRY_RESUME;}
else if(strEntry==SCORM_ENTRY_NORMAL){WriteToDebug("returning normal");return ENTRY_REVIEW;}
else{WriteToDebug("ERROR - invalide entry mode");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_ENTRY,"Invalid entry vocab received from LMS","strEntry="+ strEntry);return null;}}
function SCORM_GetLessonMode(){var strLessonMode;WriteToDebug("In SCORM_GetLessonMode");SCORM_ClearErrorInfo();strLessonMode=SCORM_CallLMSGetValue("cmi.core.lesson_mode");WriteToDebug("strLessonMode="+ strLessonMode);if(strLessonMode==SCORM_BROWSE){WriteToDebug("Returning browse");return MODE_BROWSE;}
else if(strLessonMode==SCORM_NORMAL){WriteToDebug("returning normal");return MODE_NORMAL;}
else if(strLessonMode==SCORM_REVIEW){WriteToDebug("Returning Review");return MODE_REVIEW;}
else{WriteToDebug("ERROR - invalid lesson mode");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_LESSON_MODE,"Invalid lesson_mode vocab received from LMS","strLessonMode="+ strLessonMode);return null;}}
function SCORM_GetTakingForCredit(){var strCredit;WriteToDebug("In SCORM_GetTakingForCredit");SCORM_ClearErrorInfo();strCredit=SCORM_CallLMSGetValue("cmi.core.credit");WriteToDebug("strCredit="+ strCredit);if(strCredit=="credit"){WriteToDebug("Returning true");return true;}
else if(strCredit=="no-credit"){WriteToDebug("Returning false");return false;}
else{WriteToDebug("ERROR - invalid credit");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_CREDIT,"Invalid credit vocab received from LMS","strCredit="+ strCredit);return null;}}
function SCORM_SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){var intObjectiveIndex;var blnResult;WriteToDebug("In SCORM_SetObjectiveScore, strObejctiveID="+ strObjectiveID+", intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);SCORM_ClearErrorInfo();intObjectiveIndex=SCORM_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".score.raw",intScore)&amp;&amp;blnResult;blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".score.max",intMaxScore)&amp;&amp;blnResult;blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".score.min",intMinScore)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_SetObjectiveDescription(strObjectiveID,strObjectiveDescription){var intObjectiveIndex;var blnResult;WriteToDebug("In SCORM_SetObjectiveDescription, strObjectiveDescription="+ strObjectiveDescription);WriteToDebug("Objective Descriptions are not supported prior to SCORM 2004");SCORM_ClearErrorInfo();blnResult=SCORM_TRUE;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_SetObjectiveStatus(strObjectiveID,Lesson_Status){var intObjectiveIndex;var blnResult;var strSCORMStatus="";WriteToDebug("In SCORM_SetObjectiveStatus strObjectiveID="+ strObjectiveID+", Lesson_Status="+ Lesson_Status);SCORM_ClearErrorInfo();intObjectiveIndex=SCORM_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);if(Lesson_Status==LESSON_STATUS_PASSED){strSCORMStatus=SCORM_PASSED;}
else if(Lesson_Status==LESSON_STATUS_FAILED){strSCORMStatus=SCORM_FAILED;}
else if(Lesson_Status==LESSON_STATUS_COMPLETED){strSCORMStatus=SCORM_COMPLETED;}
else if(Lesson_Status==LESSON_STATUS_BROWSED){strSCORMStatus=SCORM_BROWSED;}
else if(Lesson_Status==LESSON_STATUS_INCOMPLETE){strSCORMStatus=SCORM_INCOMPLETE;}
else if(Lesson_Status==LESSON_STATUS_NOT_ATTEMPTED){strSCORMStatus=SCORM_NOT_ATTEMPTED;}
WriteToDebug("strSCORMStatus="+ strSCORMStatus);blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".id",strObjectiveID);blnResult=SCORM_CallLMSSetValue("cmi.objectives."+ intObjectiveIndex+".status",strSCORMStatus)&amp;&amp;blnResult;WriteToDebug("Returning "+ blnResult);return blnResult;}
function SCORM_GetObjectiveScore(strObjectiveID){var intObjectiveIndex;WriteToDebug("In SCORM_GetObjectiveScore, strObejctiveID="+ strObjectiveID);SCORM_ClearErrorInfo();intObjectiveIndex=SCORM_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);return SCORM_CallLMSGetValue("cmi.objectives."+ intObjectiveIndex+".score.raw");}
function SCORM_GetObjectiveDescription(strObjectiveID){WriteToDebug("In SCORM_GetObjectiveDescription, strObejctiveID="+ strObjectiveID);WriteToDebug("ObjectiveDescription is not supported prior to SCORM 2004");return"";}
function SCORM_GetObjectiveStatus(strObjectiveID){var intObjectiveIndex;var strStatus;WriteToDebug("In SCORM_GetObjectiveStatus, strObejctiveID="+ strObjectiveID);SCORM_ClearErrorInfo();intObjectiveIndex=SCORM_FindObjectiveIndexFromID(strObjectiveID);WriteToDebug("intObjectiveIndex="+ intObjectiveIndex);strStatus=SCORM_CallLMSGetValue("cmi.objectives."+ intObjectiveIndex+".status");if(strStatus==SCORM_PASSED){WriteToDebug("returning Passed");return LESSON_STATUS_PASSED;}
else if(strStatus==SCORM_FAILED){WriteToDebug("Returning Failed");return LESSON_STATUS_FAILED;}
else if(strStatus==SCORM_COMPLETED){WriteToDebug("Returning Completed");return LESSON_STATUS_COMPLETED;}
else if(strStatus==SCORM_BROWSED){WriteToDebug("Returning Browsed");return LESSON_STATUS_BROWSED;}
else if(strStatus==SCORM_INCOMPLETE){WriteToDebug("Returning Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strStatus==SCORM_NOT_ATTEMPTED||strStatus==""){WriteToDebug("Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_STATUS,"Invalid objective status received from LMS or initial status not yet recorded for objective","strStatus="+ strStatus);return null;}}
function SCORM_FindObjectiveIndexFromID(strObjectiveID){var intCount;var i;var strTempID;WriteToDebug("In SCORM_FindObjectiveIndexFromID");intCount=SCORM_CallLMSGetValue("cmi.objectives._count");if(intCount==""){WriteToDebug("Setting intCount=0");return 0;}
intCount=parseInt(intCount,10);WriteToDebug("intCount="+ intCount);for(i=0;i&lt;intCount;i++){WriteToDebug("Checking index "+ i);strTempID=SCORM_CallLMSGetValue("cmi.objectives."+ i+".id");WriteToDebug("ID="+ strTempID);if(strTempID==strObjectiveID){WriteToDebug("Found Matching index");return i;}}
WriteToDebug("Did not find match, returning count");return intCount;}
function SCORM_FindInteractionIndexFromID(strInteractionID){WriteToDebug("SCORM_FindInteractionIndexFromID - SCORM does not support interaction retrieval, returning null");return null;}
function SCORM_GetInteractionType(strInteractionID)
{WriteToDebug("SCORM_GetInteractionType - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionTimestamp(strInteractionID)
{WriteToDebug("SCORM_GetInteractionTimestamp - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("SCORM_GetInteractionCorrectResponses - SCORM does not support interaction retrieval, returning empty array");return new Array();}
function SCORM_GetInteractionWeighting(strInteractionID)
{WriteToDebug("SCORM_GetInteractionWeighting - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("SCORM_GetInteractionLearnerResponses - SCORM does not support interaction retrieval, returning empty array");return new Array();}
function SCORM_GetInteractionResult(strInteractionID)
{WriteToDebug("SCORM_GetInteractionResult - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionLatency(strInteractionID)
{WriteToDebug("SCORM_GetInteractionDescription - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_GetInteractionDescription(strInteractionID)
{WriteToDebug("SCORM_GetInteractionDescription - SCORM does not support interaction retrieval, returning empty string");return'';}
function SCORM_CreateDataBucket(strBucketId,intMinSize,intMaxSize){WriteToDebug("SCORM_CreateDataBucket - SCORM 1.1 and 1.2 do not support SSP, returning false");return false;}
function SCORM_GetDataFromBucket(strBucketId){WriteToDebug("SCORM_GetDataFromBucket - SCORM 1.1 and 1.2 do not support SSP, returning empty string");return"";}
function SCORM_PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("SCORM_PutDataInBucket - SCORM 1.1 and 1.2 do not support SSP, returning false");return false;}
function SCORM_DetectSSPSupport(){WriteToDebug("SCORM_DetectSSPSupport - SCORM 1.1 and 1.2 do not support SSP, returning false");return false;}
function SCORM_GetBucketInfo(strBucketId){WriteToDebug("AICC_DetectSSPSupport - SCORM 1.1 and 1.2 do not support SSP, returning empty SSPBucketSize");return new SSPBucketSize(0,0);}
function SCORM_SetFailed(){WriteToDebug("In SCORM_SetFailed");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_FAILED);}
function SCORM_SetPassed(){WriteToDebug("In SCORM_SetPassed");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_PASSED);}
function SCORM_SetCompleted(){WriteToDebug("In SCORM_SetPassed");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_COMPLETED);}
function SCORM_ResetStatus(){WriteToDebug("In SCORM_ResetStatus");SCORM_ClearErrorInfo();return SCORM_CallLMSSetValue("cmi.core.lesson_status",SCORM_INCOMPLETE);}
function SCORM_GetStatus(){var strStatus;WriteToDebug("In SCORM_GetStatus");SCORM_ClearErrorInfo();strStatus=SCORM_CallLMSGetValue("cmi.core.lesson_status");WriteToDebug("strStatus="+ strStatus);if(strStatus==SCORM_PASSED){WriteToDebug("returning Passed");return LESSON_STATUS_PASSED;}
else if(strStatus==SCORM_FAILED){WriteToDebug("Returning Failed");return LESSON_STATUS_FAILED;}
else if(strStatus==SCORM_COMPLETED){WriteToDebug("Returning Completed");return LESSON_STATUS_COMPLETED;}
else if(strStatus==SCORM_BROWSED){WriteToDebug("Returning Browsed");return LESSON_STATUS_BROWSED;}
else if(strStatus==SCORM_INCOMPLETE){WriteToDebug("Returning Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strStatus==SCORM_NOT_ATTEMPTED){WriteToDebug("Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");SCORM_SetErrorInfoManually(SCORM_ERROR_INVALID_STATUS,"Invalid lesson status received from LMS","strStatus="+ strStatus);return null;}}
function SCORM_GetProgressMeasure(){WriteToDebug("SCORM_GetProgressMeasure - SCORM 1.1 and 1.2 do not support progress_measure, returning false");return false;}
function SCORM_SetProgressMeasure(){WriteToDebug("SCORM_SetProgressMeasure - SCORM 1.1 and 1.2 do not support progress_measure, returning false");return false;}
function SCORM_GetObjectiveProgressMeasure(){WriteToDebug("SCORM_GetObjectiveProgressMeasure - SCORM 1.1 and 1.2 do not support progress_measure, returning false");return false;}
function SCORM_SetObjectiveProgressMeasure(){WriteToDebug("SCORM_SetObjectiveProgressMeasure - SCORM 1.1 and 1.2 do not support progress_measure, returning false");return false;}
function SCORM_IsContentInBrowseMode(){var strLessonMode
WriteToDebug("In SCORM_IsContentInBrowseMode");strLessonMode=SCORM_CallLMSGetValue("cmi.core.lesson_mode");WriteToDebug("SCORM_IsContentInBrowseMode,  strLessonMode="+ strLessonMode);if(strLessonMode==SCORM_BROWSE){WriteToDebug("Returning true");return true;}
else{WriteToDebug("Returning false");return false;}}
function SCORM_TranslateExitTypeToSCORM(strExitType){WriteToDebug("In SCORM_TranslatgeExitTypeToSCORM strExitType-"+ strExitType);if(strExitType==EXIT_TYPE_SUSPEND){WriteToDebug("Returning suspend");return SCORM_SUSPEND;}
else if(strExitType==EXIT_TYPE_UNLOAD){WriteToDebug("Returning Exit");return SCORM_NORMAL_EXIT;}
else if(strExitType==EXIT_TYPE_FINISH){WriteToDebug("Returning Logout");return SCORM_NORMAL_EXIT;}
else if(strExitType==EXIT_TYPE_TIMEOUT){WriteToDebug("Returning Timout");return SCORM_TIMEOUT;}}
function SCORM_GetCompletionStatus(){WriteToDebug("In SCORM_GetCompletionStatus");if(SCORM_IsContentInBrowseMode()){WriteToDebug("Returning browsed");return SCORM_BROWSED;}
else{WriteToDebug("Returning Completed");return SCORM_COMPLETED;}}
function SCORM_CallLMSInitialize(){var strResult;WriteToDebug("In SCORM_CallLMSInitialize");SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Calling LMSInitialize");strResult=SCORM_objAPI.LMSInitialize("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM_FALSE){WriteToDebug("Detected failed call to initialize");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSInitialize:");WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM_CallLMSSetValue(strElement,strValue){var strResult;WriteToDebug("SCORM_CallLMSSetValue strElement="+ strElement+", strValue="+ strValue);if(blnReviewModeSoReadOnly===true){WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");return true;}
SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Calling LMSSetValue");strElement=strElement+"";strValue=strValue+"";strResult=SCORM_objAPI.LMSSetValue(strElement,strValue)
strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM_FALSE){WriteToDebug("Detected Failed call to LMSSetvalue");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSSetValue:");WriteToDebug("              strElement="+ strElement);WriteToDebug("              strValue="+ strValue);WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM_CallLMSGetValue(strElement){var strResult
WriteToDebug("In SCORM_CallLMSGetValue strElement="+ strElement);SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Call LMSGetValue");strElement=strElement+"";strResult=SCORM_objAPI.LMSGetValue(strElement)+""
WriteToDebug("strResult="+ strResult);intSCORMError=SCORM_objAPI.LMSGetLastError()
intSCORMError=intSCORMError+"";WriteToDebug("intSCORMError="+ intSCORMError);if(intSCORMError!=SCORM_NO_ERROR){WriteToDebug("Detected failed called to LMSGetValue");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSGetValue:");WriteToDebug("              strElement="+ strElement);WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);}
WriteToDebug("Returning "+ strResult);return strResult;}
function SCORM_CallLMSCommit(){var strResult;WriteToDebug("In SCORM_CallLMSCommit");SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Calling LMSCommit");strResult=SCORM_objAPI.LMSCommit("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM_FALSE){WriteToDebug("Detected failed call to LMSCommit");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSCommit:");WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);return false;}
WriteToDebug("Returning true");return true;}
function SCORM_CallLMSFinish(){var strResult;WriteToDebug("In SCORM_CallLMSFinish");SCORM_objAPI=SCORM_GrabAPI();WriteToDebug("Calling LMS Finish");strResult=SCORM_objAPI.LMSFinish("");strResult=strResult+"";WriteToDebug("strResult="+ strResult);if(strResult==SCORM_FALSE){WriteToDebug("Detected failed call to LMSFinish");SCORM_SetErrorInfo();WriteToDebug("Error calling LMSFinish:");WriteToDebug("              intSCORMError="+ intSCORMError);WriteToDebug("              SCORMErrorString="+ strSCORMErrorString);WriteToDebug("              Diagnostic="+ strSCORMErrorDiagnostic);return false;}
WriteToDebug("Returning True");return true;}
function SCORM_ClearErrorInfo(){WriteToDebug("In SCORM_ClearErrorInfo");intSCORMError=SCORM_NO_ERROR;strSCORMErrorString="";strSCORMErrorDiagnostic="";}
function SCORM_SetErrorInfo(){WriteToDebug("In SCORM_SetErrorInfo");intSCORMError=SCORM_objAPI.LMSGetLastError();strSCORMErrorString=SCORM_objAPI.LMSGetErrorString(intSCORMError);strSCORMErrorDiagnostic=SCORM_objAPI.LMSGetDiagnostic("");intSCORMError=intSCORMError+"";strSCORMErrorString=strSCORMErrorString+"";strSCORMErrorDiagnostic=strSCORMErrorDiagnostic+"";WriteToDebug("intSCORMError="+ intSCORMError);WriteToDebug("strSCORMErrorString="+ strSCORMErrorString);WriteToDebug("strSCORMErrorDiagnostic="+ strSCORMErrorDiagnostic);}
function SCORM_SetErrorInfoManually(intNum,strString,strDiagnostic){WriteToDebug("In SCORM_SetErrorInfoManually");WriteToDebug("ERROR-Num="+ intNum);WriteToDebug("      String="+ strString);WriteToDebug("      Diag="+ strDiagnostic);intSCORMError=intNum;strSCORMErrorString=strString;strSCORMErrorDiagnostic=strDiagnostic;}
function SCORM_GetLastError(){WriteToDebug("In SCORM_GetLastError");if(intSCORMError==SCORM_NO_ERROR){WriteToDebug("Returning No Error");return NO_ERROR;}
else{WriteToDebug("Returning "+ intSCORMError);return intSCORMError;}}
function SCORM_GetLastErrorDesc(){WriteToDebug("In SCORM_GetLastErrorDesc, "+ strSCORMErrorString+"\n"+ strSCORMErrorDiagnostic);return strSCORMErrorString+"\n"+ strSCORMErrorDiagnostic;}
function SCORM_GrabAPI(){WriteToDebug("In SCORM_GrabAPI");if(typeof(SCORM_objAPI)=="undefined"||SCORM_objAPI==null){WriteToDebug("Searching with improved ADL algorithm");SCORM_objAPI=SCORM_GetAPI();}
if(typeof(SCORM_objAPI)=="undefined"||SCORM_objAPI==null){SCORM_objAPI=SCORM_SearchForAPI(window);}
WriteToDebug("SCORM_GrabAPI, returning");return SCORM_objAPI;}
function SCORM_SearchForAPI(wndLookIn){WriteToDebug("SCORM_SearchForAPI");var objAPITemp=null;var strDebugID="";strDebugID="Name="+ wndLookIn.name+", href="+ wndLookIn.location.href
objAPITemp=wndLookIn.API;if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in this window - "+ strDebugID);return objAPITemp;}
if(SCORM_WindowHasParent(wndLookIn)){WriteToDebug("Searching Parent - "+ strDebugID);objAPITemp=SCORM_SearchForAPI(wndLookIn.parent);}
if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in a parent - "+ strDebugID);return objAPITemp;}
if(SCORM_WindowHasOpener(wndLookIn)){WriteToDebug("Searching Opener - "+ strDebugID);objAPITemp=SCORM_SearchForAPI(wndLookIn.opener);}
if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in an opener - "+ strDebugID);return objAPITemp;}
WriteToDebug("Looking in children - "+ strDebugID);objAPITemp=SCORM_LookInChildren(wndLookIn);if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in Children - "+ strDebugID);return objAPITemp;}
WriteToDebug("Didn't find API in this window - "+ strDebugID);return null;}
function SCORM_LookInChildren(wnd){WriteToDebug("SCORM_LookInChildren");var objAPITemp=null;var strDebugID="";strDebugID="Name="+ wnd.name+", href="+ wnd.location.href
for(var i=0;i&lt;wnd.frames.length;i++){WriteToDebug("Looking in child frame "+ i);objAPITemp=wnd.frames[i].API;if(SCORM_APIFound(objAPITemp)){WriteToDebug("Found API in child frame of "+ strDebugID);return objAPITemp;}
WriteToDebug("Looking in this child's children "+ strDebugID);objAPITemp=SCORM_LookInChildren(wnd.frames[i]);if(SCORM_APIFound(objAPITemp)){WriteToDebug("API found in this child's children "+ strDebugID);return objAPITemp;}}
return null;}
function SCORM_WindowHasOpener(wnd){WriteToDebug("In SCORM_WindowHasOpener");if((wnd.opener!=null)&amp;&amp;(wnd.opener!=wnd)&amp;&amp;(typeof(wnd.opener)!="undefined")){WriteToDebug("Window Does Have Opener");return true;}
else{WriteToDebug("Window Does Not Have Opener");return false;}}
function SCORM_WindowHasParent(wnd){WriteToDebug("In SCORM_WindowHasParent");if((wnd.parent!=null)&amp;&amp;(wnd.parent!=wnd)&amp;&amp;(typeof(wnd.parent)!="undefined")){WriteToDebug("Window Does Have Parent");return true;}
else{WriteToDebug("Window Does Not Have Parent");return false;}}
function SCORM_APIFound(obj){WriteToDebug("In SCORM_APIFound");if(obj==null||typeof(obj)=="undefined"){WriteToDebug("API NOT Found");return false;}
else{WriteToDebug("API Found");return true;}}
function SCORM_ScanParentsForApi(win)
{WriteToDebug("In SCORM_ScanParentsForApi, win="+ win.location);var MAX_PARENTS_TO_SEARCH=500;var nParentsSearched=0;while((win.API==null||win.API===undefined)&amp;&amp;(win.parent!=null)&amp;&amp;(win.parent!=win)&amp;&amp;(nParentsSearched&lt;=MAX_PARENTS_TO_SEARCH))
{nParentsSearched++;win=win.parent;}
return win.API;}
function SCORM_GetAPI()
{WriteToDebug("In SCORM_GetAPI");var API=null;if((window.parent!=null)&amp;&amp;(window.parent!=window))
{WriteToDebug("SCORM_GetAPI, searching parent");API=SCORM_ScanParentsForApi(window.parent);}
if((API==null)&amp;&amp;(window.top.opener!=null))
{WriteToDebug("SCORM_GetAPI, searching opener");API=SCORM_ScanParentsForApi(window.top.opener);}
return API;}</text>
				</content>
				<redirectionURL/>
				<headersSize>288</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/AICCFunctions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>372</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="AICCFunctions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var blnDirtyAICCData=false;var blnCommitSavedData=false;var intAICCErrorNum=NO_ERROR;var strAICCErrorDesc="";var aryAICCFoundItems=new Array();var blnUseLongInteractionResultValues=true;var blnReviewModeSoReadOnly=false;var AICC_LMS_Version="";var AICC_Student_ID="";var AICC_Student_Name="";var AICC_Lesson_Location="";var AICC_Score="";var AICC_Credit="";var AICC_Lesson_Status="";var AICC_Time="";var AICC_Mastery_Score="";var AICC_Lesson_Mode="";var AICC_Max_Time_Allowed="";var AICC_Time_Limit_Action="";var AICC_Audio="";var AICC_Speed="";var AICC_Language="";var AICC_Text="";var AICC_Launch_Data="";var AICC_Data_Chunk="";var AICC_Comments="";var AICC_Objectives=null;var AICC_CourseID="";var AICC_fltScoreRaw="";var AICC_fltScoreMax="";var AICC_fltScoreMin="";var AICC_blnCredit=true;var AICC_strLessonMode=MODE_NORMAL;var AICC_intPreviouslyAccumulatedMilliseconds=0;var AICC_intMaxTimeAllowedMilliseconds=MAX_CMI_TIME;var AICC_blnExitOnTimeout=false;var AICC_blnShowMessageOnTimeout=true;var AICC_TextPreference=PREFERENCE_DEFAULT;var AICC_Status=LESSON_STATUS_NOT_ATTEMPTED;var AICC_Entry=AICC_ENTRY_FLAG_DEFAULT;var AICC_AudioPlayPreference=PREFERENCE_DEFAULT;var AICC_intAudioVolume=100;var AICC_intPercentOfMaxSpeed=100;var AICC_intSessionTimeMilliseconds=0;var AICC_aryObjectivesRead=new Array();var AICC_aryObjectivesWrite=new Array();var AICC_aryCommentsFromLearner=new Array();var AICC_aryInteractions=new Array();var AICC_OBJ_ARRAY_ID=0;var AICC_OBJ_ARRAY_SCORE=1;var AICC_OBJ_ARRAY_STATUS=2;var AICC_INTERACTIONS_ID=0;var AICC_INTERACTIONS_RESPONSE=1;var AICC_INTERACTIONS_CORRECT=2;var AICC_INTERACTIONS_CORRECT_RESPONSE=3;var AICC_INTERACTIONS_TIME_STAMP=4;var AICC_INTERACTIONS_TYPE=5;var AICC_INTERACTIONS_WEIGHTING=6;var AICC_INTERACTIONS_LATENCY=7;var AICC_INTERACTIONS_RESPONSE_LONG=8;var AICC_INTERACTIONS_CORRECT_RESPONSE_LONG=9;var AICC_INTERACTION_TYPE_TRUE_FALSE="T";var AICC_INTERACTION_TYPE_CHOICE="C";var AICC_INTERACTION_TYPE_FILL_IN="F";var AICC_INTERACTION_TYPE_MATCHING="M";var AICC_INTERACTION_TYPE_PERFORMANCE="P";var AICC_INTERACTION_TYPE_SEQUENCING="S";var AICC_INTERACTION_TYPE_LIKERT="L";var AICC_INTERACTION_TYPE_NUMERIC="N";var AICC_RESULT_CORRECT="C";var AICC_RESULT_WRONG="W";var AICC_RESULT_UNANTICIPATED="U";var AICC_RESULT_NEUTRAL="N";var AICC_NO_ERROR="0";var AICC_ERROR_INVALID_PREFERENCE="-1";var AICC_ERROR_INVALID_STATUS="-2";var AICC_ERROR_INVALID_SPEED="-3";var AICC_ERROR_INVALID_TIMESPAN="-4";var AICC_ERROR_INVALID_TIME_LIMIT_ACTION="-5";var AICC_ERROR_INVALID_DECIMAL="-6";var AICC_ERROR_INVALID_CREDIT="-7";var AICC_ERROR_INVALID_LESSON_MODE="-8";var AICC_ERROR_INVALID_ENTRY="-9";var blnReviewModeSoReadOnly=false;function AICC_Initialize(){WriteToDebug("In AICC_Initialize");window.AICCComm.MakeGetParamRequest();return;}
function AICC_Finish(strExitType,blnStatusWasSet){WriteToDebug("In AICC_Finish, strExitType="+ strExitType+", blnStatusWasSet="+ blnStatusWasSet);if(!blnStatusWasSet){if((strExitType==EXIT_TYPE_FINISH)){WriteToDebug("Setting status to complete");AICC_Status=LESSON_STATUS_COMPLETED;}
else{WriteToDebug("Setting status to incomplete");AICC_Status=LESSON_STATUS_INCOMPLETE;}}
AICC_CommitData();if(blnCommitSavedData==true){KillTime();}
window.AICCComm.MakeExitAURequest();return true;}
function AICC_CommitData(){var strAICCData;WriteToDebug("In AICC_CommitData");if(blnReviewModeSoReadOnly===true){WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");return true;}
blnCommitSavedData=false;if(IsThereDirtyAICCData()){blnCommitSavedData=true;WriteToDebug("Found Dirty Data");strAICCData=FormAICCPostData();window.AICCComm.MakePutParamRequest(strAICCData);if(AICC_aryInteractions.length&gt;0){WriteToDebug("Saving Interactions");KillTime();AICC_SendInteractions();}
ClearDirtyAICCData();}
return true;}
function KillTime(){WriteToDebug("In KillTime");if(USE_AICC_KILL_TIME===false){WriteToDebug("Configuration disallows use of KillTime, exiting");return;}
var start=new Date();if(window.AICCComm.blnCanUseXMLHTTP==false){if(window.AICCComm.blnXMLHTTPIsAvailable==true){var numBlankRequests=3;for(var i=0;i&lt;numBlankRequests;i++){window.AICCComm.GetBlankHtmlPage(i);}}
else{window.NothingFrame.document.open();var numLoops=1000;for(var i=0;i&lt;numLoops;i++){window.NothingFrame.document.write("waiting");}
window.NothingFrame.document.close();}}
var end=new Date();WriteToDebug("Killed "+(end- start)+"milliseconds.");}
function AICC_SendInteractions(){WriteToDebug("In AICC_SendInteractions.");if(blnReviewModeSoReadOnly===true){WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");return true;}
var strAICCData=FormAICCInteractionsData();window.AICCComm.MakePutInteractionsRequest(strAICCData);}
function AICC_GetStudentID(){WriteToDebug("In AICC_GetStudentID, Returning "+ AICC_Student_ID);return AICC_Student_ID;}
function AICC_GetStudentName(){WriteToDebug("In AICC_GetStudentName, Returning "+ AICC_Student_Name);return AICC_Student_Name;}
function AICC_GetBookmark(){WriteToDebug("In AICC_GetBookmark, Returning "+ AICC_Lesson_Location);return AICC_Lesson_Location;}
function AICC_SetBookmark(strBookmark){WriteToDebug("In AICC_SetBookmark, strBookmark="+ strBookmark);SetDirtyAICCData();AICC_Lesson_Location=strBookmark;return true;}
function AICC_GetDataChunk(){WriteToDebug("In AICC_GetDataChunk, Returning "+ AICC_Data_Chunk);return AICC_Data_Chunk;}
function AICC_SetDataChunk(strData){WriteToDebug("In AICC_SetDataChunk, strData="+ strData);SetDirtyAICCData();AICC_Data_Chunk=strData;return true;}
function AICC_GetLaunchData(){WriteToDebug("In AICC_GetLaunchData, Returning "+ AICC_Launch_Data);return AICC_Launch_Data;}
function AICC_GetComments(){WriteToDebug("In AICC_GetComments, Returning "+ AICC_aryCommentsFromLearner.join(" | "));return AICC_aryCommentsFromLearner.join(" | ");}
function AICC_WriteComment(strComment){WriteToDebug("In AICC_WriteComment, strComment="+ strComment);var intNextIndex;if(strComment.search(/ \| /)==0){strComment=strComment.substr(3);}
strComment.replace(/\|\|/g,"|")
intNextIndex=AICC_aryCommentsFromLearner.length;WriteToDebug("Adding comment to array");AICC_aryCommentsFromLearner[intNextIndex]=strComment;SetDirtyAICCData();return true;}
function AICC_GetLMSComments(){WriteToDebug("In AICC_GetLMSComments, Returning "+ AICC_Comments);return AICC_Comments;}
function AICC_GetAudioPlayPreference(){WriteToDebug("In AICC_GetAudioPlayPreference, Returning "+ AICC_AudioPlayPreference);return AICC_AudioPlayPreference;}
function AICC_GetAudioVolumePreference(){WriteToDebug("In AICC_GetAudioVolumePreference, Returning "+ AICC_intAudioVolume);return AICC_intAudioVolume;}
function AICC_SetAudioPreference(PlayPreference,intPercentOfMaxVolume){WriteToDebug("In AICC_SetAudioPreference, Returning true");AICC_AudioPlayPreference=PlayPreference;AICC_intAudioVolume=intPercentOfMaxVolume;SetDirtyAICCData();return true;}
function AICC_SetLanguagePreference(strLanguage){WriteToDebug("In AICC_SetLanguagePreference, Returning true");SetDirtyAICCData();AICC_Language=strLanguage;return true;}
function AICC_GetLanguagePreference(){WriteToDebug("In AICC_GetLanguagePreference, Returning "+ AICC_Language);return AICC_Language;}
function AICC_SetSpeedPreference(intPercentOfMax){WriteToDebug("In AICC_SetSpeedPreference, Returning true");AICC_intPercentOfMaxSpeed=intPercentOfMax;SetDirtyAICCData();return true;}
function AICC_GetSpeedPreference(){WriteToDebug("In AICC_GetSpeedPreference, Returning "+ AICC_intPercentOfMaxSpeed);return AICC_intPercentOfMaxSpeed;}
function AICC_SetTextPreference(intPreference){WriteToDebug("In AICC_SetTextPreference, Returning true");AICC_TextPreference=intPreference;SetDirtyAICCData();return true;}
function AICC_GetTextPreference(){WriteToDebug("In AICC_GetTextPreference, Returning "+ AICC_TextPreference);return AICC_TextPreference;}
function AICC_GetPreviouslyAccumulatedTime(){WriteToDebug("In AICC_GetPreviouslyAccumulatedTime, Returning "+ AICC_intPreviouslyAccumulatedMilliseconds);return AICC_intPreviouslyAccumulatedMilliseconds;}
function AICC_SaveTime(intMilliSeconds){WriteToDebug("In intMilliSeconds, Returning true");AICC_intSessionTimeMilliseconds=intMilliSeconds;SetDirtyAICCData();return true;}
function AICC_GetMaxTimeAllowed(){WriteToDebug("In AICC_GetMaxTimeAllowed, Returning "+ AICC_intMaxTimeAllowedMilliseconds);return AICC_intMaxTimeAllowedMilliseconds;}
function AICC_DisplayMessageOnTimeout(){WriteToDebug("In AICC_DisplayMessageOnTimeout, Returning "+ AICC_blnShowMessageOnTimeout);return AICC_blnShowMessageOnTimeout;}
function AICC_ExitOnTimeout(){WriteToDebug("In AICC_ExitOnTimeout, Returning "+ AICC_blnExitOnTimeout);return AICC_blnExitOnTimeout;}
function AICC_GetPassingScore(){WriteToDebug("In AICC_GetPassingScore, Returning "+ AICC_Mastery_Score);return AICC_Mastery_Score;}
function AICC_GetScore(){WriteToDebug("In AICC_GetScore, Returning "+ AICC_fltScoreRaw);return AICC_fltScoreRaw;}
function AICC_SetScore(fltScore,fltMaxScore,fltMinScore){WriteToDebug("In AICC_SetScore, fltScore="+ fltScore+", fltMaxScore="+ fltMaxScore+", fltMinScore="+ fltMinScore);AICC_fltScoreRaw=fltScore;AICC_fltScoreMax=fltMaxScore;AICC_fltScoreMin=fltMinScore;SetDirtyAICCData();return true;}
function AICC_RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordTrueFalseInteraction strID="+ strID+", blnResponse="+ blnResponse+", blnCorrect="+ blnCorrect+", blnCorrectResponse="+ blnCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse="";var strCorrectResponse="";if(blnResponse){strResponse="t";}
else{strResponse="f";}
if(blnCorrectResponse==true){strCorrectResponse="t";}
else if(blnCorrectResponse==false){strCorrectResponse="f";}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_TRUE_FALSE;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponse;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponse;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordMultipleChoiceInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordMultipleChoiceInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Short.replace(",","");strResponseLong+=aryResponse[i].Long.replace(",","");}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Short.replace(",","");strCorrectResponseLong+=aryCorrectResponse[i].Long.replace(",","");}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_CHOICE;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponseLong;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponseLong;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordFillInInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
if(strCorrectResponse==null||strCorrectResponse==undefined){strCorrectResponse="";}
strResponse=new String(strResponse);if(strResponse.length&gt;255){strResponse=strResponse.substr(0,255);}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;255){strCorrectResponse=strCorrectResponse.substr(0,255);}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_FILL_IN;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponse;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponse;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordMatchingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordMatchingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Source.Short.replace(",","").replace(".","")+"."+ aryResponse[i].Target.Short.replace(",","").replace(".","");strResponseLong+=aryResponse[i].Source.Long.replace(",","").replace(".","")+"."+ aryResponse[i].Target.Long.replace(",","").replace(".","");}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
if(aryCorrectResponse[i].Source.Short!=""&amp;&amp;aryCorrectResponse[i].Source.Long!=""){strCorrectResponse+=aryCorrectResponse[i].Source.Short.replace(",","").replace(".","")+"."+ aryCorrectResponse[i].Target.Short.replace(",","").replace(".","");strCorrectResponseLong+=aryCorrectResponse[i].Source.Long.replace(",","").replace(".","")+"."+ aryCorrectResponse[i].Target.Long.replace(",","").replace(".","");}}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_MATCHING;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponseLong;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponseLong;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordPerformanceInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
if(strCorrectResponse==null||strCorrectResponse==undefined){strCorrectResponse="";}
strResponse=new String(strResponse);if(strResponse.length&gt;255){strResponse=strResponse.substr(0,255);}
strCorrectResponse=new String(strCorrectResponse);if(strCorrectResponse.length&gt;255){strCorrectResponse=strCorrectResponse.substr(0,255);}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_PERFORMANCE;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponse;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponse;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordSequencingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordSequencingInteraction strID="+ strID+", aryResponse="+ aryResponse+", blnCorrect="+ blnCorrect+", aryCorrectResponse="+ aryCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse="";var strResponseLong="";var strCorrectResponse="";var strCorrectResponseLong="";for(var i=0;i&lt;aryResponse.length;i++){if(strResponse.length&gt;0){strResponse+=",";}
if(strResponseLong.length&gt;0){strResponseLong+=",";}
strResponse+=aryResponse[i].Short.replace(",","");strResponseLong+=aryResponse[i].Long.replace(",","");}
for(var i=0;i&lt;aryCorrectResponse.length;i++){if(strCorrectResponse.length&gt;0){strCorrectResponse+=",";}
if(strCorrectResponseLong.length&gt;0){strCorrectResponseLong+=",";}
strCorrectResponse+=aryCorrectResponse[i].Short.replace(",","");strCorrectResponseLong+=aryCorrectResponse[i].Long.replace(",","");}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_SEQUENCING;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponseLong;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponseLong;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordLikertInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In RecordLikertInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
var strResponse=response.Short;var strResponseLong=response.Long;var strCorrectResponse="";var strCorrectResponseLong="";if(correctResponse!=null){strCorrectResponse=correctResponse.Short;strCorrectResponseLong=correctResponse.Long;}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_LIKERT;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponseLong;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponseLong;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime){WriteToDebug("In AICC_RecordNumericInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID+", dtmTime="+ dtmTime);var intTotalInteractions;var aryData=new Array(10);intTotalInteractions=AICC_aryInteractions.length;if(intWeighting==null||intWeighting==undefined){intWeighting="";}
if(intLatency==null||intLatency==undefined){intLatency="";}
if(blnCorrect==null||blnCorrect==undefined){blnCorrect="";}
if(strCorrectResponse==null||strCorrectResponse==undefined){strCorrectResponse="";}
aryData[AICC_INTERACTIONS_ID]=strID;aryData[AICC_INTERACTIONS_RESPONSE]=strResponse;aryData[AICC_INTERACTIONS_CORRECT]=blnCorrect;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE]=strCorrectResponse;aryData[AICC_INTERACTIONS_TIME_STAMP]=dtmTime;aryData[AICC_INTERACTIONS_TYPE]=AICC_INTERACTION_TYPE_NUMERIC;aryData[AICC_INTERACTIONS_WEIGHTING]=intWeighting;aryData[AICC_INTERACTIONS_LATENCY]=intLatency;aryData[AICC_INTERACTIONS_RESPONSE_LONG]=strResponse;aryData[AICC_INTERACTIONS_CORRECT_RESPONSE_LONG]=strCorrectResponse;AICC_aryInteractions[intTotalInteractions]=aryData;WriteToDebug("Added to interactions array, index="+ intTotalInteractions);SetDirtyAICCData();return true;}
function AICC_GetEntryMode(){WriteToDebug("In AICC_GetEntryMode, Returning "+ AICC_Entry);return AICC_Entry;}
function AICC_GetLessonMode(){WriteToDebug("In AICC_GetLessonMode, Returning "+ AICC_strLessonMode);return AICC_strLessonMode;}
function AICC_GetTakingForCredit(){WriteToDebug("In AICC_GetTakingForCredit, Returning "+ AICC_blnCredit);return AICC_blnCredit;}
function AICC_SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){WriteToDebug("In AICC_SetObjectiveScore, strObjectiveID="+ strObjectiveID+", intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);var intNextID;var intObjIndex;var strAICCScore="";intObjIndex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesRead);if(intObjIndex!=null){WriteToDebug("Found read objective");AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_SCORE]=intScore;}
else{WriteToDebug("Adding new read objective");intNextID=AICC_aryObjectivesRead.length;AICC_aryObjectivesRead[parseInt(intNextID,10)]=new Array(3);AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_ID]=strObjectiveID;AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_SCORE]=intScore;AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_STATUS]="";}
intObjIndex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesWrite);if(intObjIndex!=null){WriteToDebug("Found write objective");AICC_aryObjectivesWrite[intObjIndex][AICC_OBJ_ARRAY_SCORE]=intScore;}
else{WriteToDebug("Adding new write objective");intNextID=AICC_aryObjectivesWrite.length;AICC_aryObjectivesWrite[parseInt(intNextID,10)]=new Array(3);strAICCScore=intScore;if(AICC_LMS_Version&lt;3&amp;&amp;strAICCScore!=""){strAICCScore=parseInt(strAICCScore,10);}
if((AICC_REPORT_MIN_MAX_SCORE===undefined||AICC_REPORT_MIN_MAX_SCORE===null||AICC_REPORT_MIN_MAX_SCORE===true)&amp;&amp;(AICC_LMS_Version&gt;=3)){if((intMaxScore!="")||(intMinScore!="")){WriteToDebug("Appending Max and Min scores");strAICCScore+=","+ intMaxScore+","+ intMinScore;}}
AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_ID]=strObjectiveID;AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_SCORE]=strAICCScore;AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_STATUS]="";}
SetDirtyAICCData();return true;}
function AICC_SetObjectiveStatus(strObjectiveID,Lesson_Status){WriteToDebug("In AICC_SetObjectiveStatus, strObjectiveID="+ strObjectiveID+", Lesson_Status="+ Lesson_Status);var intNextID;var intObjIdex;intObjIdex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesRead);if(intObjIdex!=null){WriteToDebug("Found read objective");AICC_aryObjectivesRead[intObjIdex][AICC_OBJ_ARRAY_STATUS]=Lesson_Status;}
else{WriteToDebug("Adding new read objective");intNextID=AICC_aryObjectivesRead.length;AICC_aryObjectivesRead[parseInt(intNextID,10)]=new Array(3);AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_ID]=strObjectiveID;AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_STATUS]=Lesson_Status;AICC_aryObjectivesRead[parseInt(intNextID,10)][AICC_OBJ_ARRAY_SCORE]="";}
intObjIdex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesWrite);if(intObjIdex!=null){WriteToDebug("Found write objective");AICC_aryObjectivesWrite[intObjIdex][AICC_OBJ_ARRAY_STATUS]=Lesson_Status;}
else{WriteToDebug("Adding new write objective");intNextID=AICC_aryObjectivesWrite.length;AICC_aryObjectivesWrite[parseInt(intNextID,10)]=new Array(3);AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_ID]=strObjectiveID;AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_STATUS]=Lesson_Status;AICC_aryObjectivesWrite[parseInt(intNextID,10)][AICC_OBJ_ARRAY_SCORE]="";}
SetDirtyAICCData();return true;}
function AICC_SetObjectiveDescription(strObjectiveID,strObjectiveDescription){WriteToDebug("In AICC_SetObjectiveDescription, strObjectiveID="+ strObjectiveID+", strObjectiveDescription="+ strObjectiveDescription);WriteToDebug("Objective descriptions are not supported prior to SCORM 2004");return true;}
function AICC_GetObjectiveScore(strObjectiveID){WriteToDebug("In AICC_SetObjectiveScore, strObjectiveID="+ strObjectiveID);var intObjIndex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesRead)
if(intObjIndex!=null){WriteToDebug("Found objective, returning "+ AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_SCORE]);return AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_SCORE];}
else{WriteToDebug("Did not find objective, returning ''");return"";}}
function AICC_GetObjectiveDescription(strObjectiveID){WriteToDebug("In AICC_GetObjectiveDescription, strObjectiveID="+ strObjectiveID);WriteToDebug("Objective descriptions are not supported prior to SCORM 2004");return"";}
function AICC_GetObjectiveStatus(strObjectiveID){WriteToDebug("In AICC_SetObjectiveStatus, strObjectiveID="+ strObjectiveID);var intObjIndex=FindObjectiveById(strObjectiveID,AICC_aryObjectivesRead)
if(intObjIndex!=null){WriteToDebug("Found objective, returning "+ AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_STATUS]);return AICC_aryObjectivesRead[intObjIndex][AICC_OBJ_ARRAY_STATUS];}
else{WriteToDebug("Did not find objective, returning "+ LESSON_STATUS_NOT_ATTEMPTED);return LESSON_STATUS_NOT_ATTEMPTED;}}
function AICC_SetFailed(){WriteToDebug("In AICC_SetFailed, Returning true");AICC_Status=LESSON_STATUS_FAILED;SetDirtyAICCData();return true;}
function AICC_SetPassed(){WriteToDebug("In AICC_SetPassed, Returning true");AICC_Status=LESSON_STATUS_PASSED;SetDirtyAICCData();return true;}
function AICC_SetCompleted(){WriteToDebug("In AICC_SetCompleted, Returning true");AICC_Status=LESSON_STATUS_COMPLETED;SetDirtyAICCData();return true;}
function AICC_ResetStatus(){WriteToDebug("In AICC_ResetStatus, Returning true");AICC_Status=LESSON_STATUS_INCOMPLETE;SetDirtyAICCData();return true;}
function AICC_GetStatus(){WriteToDebug("In AICC_GetStatus, Returning "+ AICC_Status);return AICC_Status;}
function AICC_GetProgressMeasure(){WriteToDebug("AICC_GetProgressMeasure - AICC does not support progress_measure, returning false");return false;}
function AICC_SetProgressMeasure(){WriteToDebug("AICC_SetProgressMeasure - AICC does not support progress_measure, returning false");return false;}
function AICC_GetObjectiveProgressMeasure(){WriteToDebug("AICC_GetObjectiveProgressMeasure - AICC does not support progress_measure, returning false");return false;}
function AICC_SetObjectiveProgressMeasure(){WriteToDebug("AICC_SetObjectiveProgressMeasure - AICC does not support progress_measure, returning false");return false;}
function AICC_SetPointBasedScore(intScore,intMaxScore,intMinScore){WriteToDebug("AICC_SetPointBasedScore - AICC does not support SetPointBasedScore, returning false");return false;}
function AICC_GetScaledScore(intScore,intMaxScore,intMinScore){WriteToDebug("AICC_GetScaledScore - AICC does not support GetScaledScore, returning false");return false;}
function AICC_GetLastError(){WriteToDebug("In AICC_GetLastError, Returning "+ intAICCErrorNum);return intAICCErrorNum;}
function AICC_GetLastErrorDesc(){WriteToDebug("In AICC_GetLastErrorDesc, Returning '"+ strAICCErrorDesc+"'");return strAICCErrorDesc;}
function AICC_PutParamFailed(){WriteToDebug("ERROR: In AICC_PutParamFailed");SetDirtyAICCData();return;}
function AICC_PutInteractionsFailed(){WriteToDebug("ERROR: In AICC_PutInteractionsFailed");SetDirtyAICCData();if(parent.blnUseLongInteractionResultValues==true){parent.blnUseLongInteractionResultValues=false;parent.AICC_CommitData();}
return;}
function AICC_SetErrorInfo(strErrorNumLine,strErrorDescLine){WriteToDebug("ERROR: In AICC_SetErrorInfo, strErrorNumLine="+ strErrorNumLine+", strErrorDescLine="+ strErrorDescLine);if(strErrorNumLine.toLowerCase().search(/error\s*=\s*0/)==-1){WriteToDebug("Detected No Error");intAICCErrorNum=NO_ERROR;strAICCErrorDesc="";}
else{WriteToDebug("Setting Error Info");AICC_SetError(GetValueFromAICCLine(strAICCErrorLine),GetValueFromAICCLine(strAICCErrorDesc))}}
function AICC_SetError(intErrorNum,strErrorDesc){WriteToDebug("ERROR: In AICC_SetError, intErrorNum="+ intErrorNum+", strErrorDesc="+ strErrorDesc);intAICCErrorNum=intErrorNum;strAICCErrorDesc=strAICCErrorDesc;}
function SetDirtyAICCData(){WriteToDebug("In SetDirtyAICCData");blnDirtyAICCData=true;}
function ClearDirtyAICCData(){WriteToDebug("In ClearDirtyAICCData");blnDirtyAICCData=false;}
function IsThereDirtyAICCData(){WriteToDebug("In IsThereDirtyAICCData, returning "+ blnDirtyAICCData);return blnDirtyAICCData;}
function GetValueFromAICCLine(strLine){WriteToDebug("In GetValueFromAICCLine, strLine="+ strLine);var intPos;var strValue="";var strTemp;strLine=new String(strLine);intPos=strLine.indexOf("=");WriteToDebug("intPos="+ intPos);if(intPos&gt;-1&amp;&amp;((intPos+ 1)&lt;strLine.length)){WriteToDebug("Grabbing value");strTemp=strLine.substring(intPos+1);WriteToDebug("strTemp="+ strTemp);strTemp=strTemp.replace(/^\s*/,"");strTemp=strTemp.replace(/\s*$/,"");strValue=strTemp;}
WriteToDebug("returning "+ strValue);return strValue;}
function GetNameFromAICCLine(strLine){WriteToDebug("In GetNameFromAICCLine, strLine="+ strLine);var intPos;var strTemp;var strName="";strLine=new String(strLine);intPos=strLine.indexOf("=");WriteToDebug("intPos="+ intPos);if(intPos&gt;-1&amp;&amp;intPos&lt;strLine.length){WriteToDebug("Grabbing name from name/value pair");strTemp=strLine.substring(0,intPos);WriteToDebug("strTemp="+ strTemp);strTemp=strTemp.replace(/^\s*/,"");strTemp=strTemp.replace(/\s*$/,"");strName=strTemp;}
else{WriteToDebug("Grabbing name from group / section heading");intPos=strLine.indexOf("[");WriteToDebug("intPos="+ intPos);if(intPos&gt;-1){WriteToDebug("Replacing []");strTemp=strLine.replace(/[\[|\]]/g,"");WriteToDebug("strTemp="+ strTemp);strTemp=strTemp.replace(/^\s*/,"");strTemp=strTemp.replace(/\s*$/,"");strName=strTemp;}}
WriteToDebug("returning "+ strName);return strName;}
function GetIndexFromAICCName(strLineName){WriteToDebug("In GetIndexFromAICCName, strLineName="+ strLineName);var intPos;var strIndex="";var strTemp="";strLine=new String(strLineName);intPos=strLine.indexOf(".");WriteToDebug("intPos="+ intPos);if(intPos&gt;-1&amp;&amp;(intPos+1)&lt;strLine.length){WriteToDebug("Grabbing index");strTemp=strLine.substring(intPos+ 1);WriteToDebug("strTemp="+ strTemp);WriteToDebug("Checking for equal sign");intPos=strTemp.indexOf("=");if(intPos&gt;-1&amp;&amp;intPos&lt;strTemp.length){WriteToDebug("Found and removing equal sign");strTemp=strLine.substring(0,intPos);}
WriteToDebug("Removing white space");strTemp=strTemp.replace(/^\s*/,"");strTemp=strTemp.replace(/\s*$/,"");strIndex=strTemp;}
WriteToDebug("returning "+ strIndex);return strIndex;}
function ParseGetParamData(strLMSResult){WriteToDebug("In ParseGetParamData");var aryAICCResponseLines;var strLine;var strLineName;var strLineValue;var i,j;strLMSResult=new String(strLMSResult);aryAICCResponseLines=strLMSResult.split("\n");WriteToDebug("Split String");for(i=0;i&lt;aryAICCResponseLines.length;i++){WriteToDebug("Processing Line #"+ i+": "+ aryAICCResponseLines[i]);strLine=aryAICCResponseLines[i];strLineName="";strLineValue="";if(strLine.length&gt;0){WriteToDebug("Found non-zero length string");if(strLine.charAt(0)=="\r"){WriteToDebug("Detected leading \\r");strLine=strLine.substr(1);}
if(strLine.charAt(strLine.length- 1)=="\r"){WriteToDebug("Detected trailing \\r");strLine=strLine.substr(0,strLine.length- 1);}
if(strLine.charAt(0)!=";"){WriteToDebug("Found non-comment line");strLineName=GetNameFromAICCLine(strLine);strLineValue=GetValueFromAICCLine(strLine);WriteToDebug("strLineName="+ strLineName+", strLineValue="+ strLineValue);}}
strLineName=strLineName.toLowerCase();if(!AICC_HasItemBeenFound(strLineName)){WriteToDebug("Detected an un-found item");AICC_FoundItem(strLineName);switch(strLineName){case"version":WriteToDebug("Item is version");var tempVersion=parseFloat(strLineValue);if(isNaN(tempVersion)){tempVersion=0;}
AICC_LMS_Version=tempVersion;break;case"student_id":WriteToDebug("Item is student_id");AICC_Student_ID=strLineValue;break;case"student_name":WriteToDebug("Item is student_name");AICC_Student_Name=strLineValue;break;case"lesson_location":WriteToDebug("Item is lesson_location");AICC_Lesson_Location=strLineValue;break;case"score":WriteToDebug("Item is score");AICC_Score=strLineValue;AICC_SeperateScoreValues(AICC_Score);break;case"credit":WriteToDebug("Item is credit");AICC_Credit=strLineValue;AICC_TranslateCredit(AICC_Credit);break;case"lesson_status":WriteToDebug("Item is lesson_status");AICC_Lesson_Status=strLineValue;AICC_TranslateLessonStatus(AICC_Lesson_Status);break;case"time":WriteToDebug("Item is time");AICC_Time=strLineValue;AICC_TranslateTimeToMilliseconds(AICC_Time);break;case"mastery_score":WriteToDebug("Item is mastery_score");AICC_Mastery_Score=strLineValue;AICC_ValidateMasteryScore(AICC_Mastery_Score);break;case"lesson_mode":WriteToDebug("Item is lesson_mode");AICC_Lesson_Mode=strLineValue;AICC_TranslateLessonMode(AICC_Lesson_Mode);break;case"max_time_allowed":WriteToDebug("Item is max_time_allowed");AICC_Max_Time_Allowed=strLineValue;AICC_TranslateMaxTimeToMilliseconds(AICC_Max_Time_Allowed);break;case"time_limit_action":WriteToDebug("Item is time_limit_action");AICC_Time_Limit_Action=strLineValue;AICC_TranslateTimeLimitAction(AICC_Time_Limit_Action);break;case"audio":WriteToDebug("Item is audio");AICC_Audio=strLineValue;AICC_TranslateAudio(AICC_Audio);break;case"speed":WriteToDebug("Item is speed");AICC_Speed=strLineValue;AICC_TranslateSpeed(AICC_Speed);break;case"language":WriteToDebug("Item is language");AICC_Language=strLineValue;break;case"text":WriteToDebug("Item is text");AICC_Text=strLineValue;AICC_TranslateTextPreference(AICC_Text);break;case"course_id":WriteToDebug("Item is course id");AICC_CourseID=strLineValue;break;case"core_vendor":WriteToDebug("Item is core_vendor");AICC_Launch_Data="";strLine="";j=1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}
while(((i+j)&lt;aryAICCResponseLines.length)&amp;&amp;(!IsGroupIdentifier(strLine))){if(strLine.charAt(0)!=";"){AICC_Launch_Data+=strLine+"\n";}
j=j+ 1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}}
i=i+ j- 1
AICC_Launch_Data=AICC_Launch_Data.replace(/\s*$/,"");break;case"core_lesson":WriteToDebug("Item is core_lesson");AICC_Data_Chunk="";strLine="";j=1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}
while(((i+j)&lt;aryAICCResponseLines.length)&amp;&amp;(!IsGroupIdentifier(strLine))){if(strLine.charAt(0)!=";"){AICC_Data_Chunk+=strLine+"\n";}
j=j+ 1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}}
i=i+ j- 1
AICC_Data_Chunk=AICC_Data_Chunk.replace(/\s*$/,"");break;case"comments":WriteToDebug("Item is comments");AICC_Comments="";strLine="";j=1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}
while(((i+j)&lt;aryAICCResponseLines.length)&amp;&amp;(!IsGroupIdentifier(strLine))){if(strLine.charAt(0)!=";"){AICC_Comments+=strLine+"\n";}
j=j+ 1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}}
i=i+ j- 1
AICC_Comments=AICC_Comments.replace(/\s*$/,"");break;case"objectives_status":WriteToDebug("Item is objectives_status");AICC_Objectives="";strLine="";j=1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}
while(((i+j)&lt;aryAICCResponseLines.length)&amp;&amp;(!IsGroupIdentifier(strLine))){if(strLine.charAt(0)!=";"){AICC_Objectives+=strLine+"\n";}
j=j+ 1;if((i+j)&lt;aryAICCResponseLines.length){strLine=aryAICCResponseLines[i+j];}}
i=i+ j- 1
AICC_Objectives=AICC_Objectives.replace(/\s*$/,"");AICC_FormatObjectives(AICC_Objectives);break;default:WriteToDebug("Unknown Item Found");break;}}}
return true;}
function IsGroupIdentifier(strLine){WriteToDebug("In IsGroupIdentifier, strLine="+ strLine);var intPos;strLine=strLine.replace(/^\s*/,"");intPos=strLine.search(/\[[\w]+\]/);WriteToDebug("intPos="+ intPos);if(intPos==0){WriteToDebug("Returning True");return true;}
else{WriteToDebug("Returning False");return false;}}
function AICC_FoundItem(strItem){WriteToDebug("In AICC_FoundItem, strItem="+ strItem);aryAICCFoundItems[strItem]=true;}
function AICC_HasItemBeenFound(strItem){WriteToDebug("In AICC_HasItemBeenFound, strItem="+ strItem);if(aryAICCFoundItems[strItem]==true){WriteToDebug("Returning True");return true;}
else{WriteToDebug("Returning False");return false;}}
function AICC_SeperateScoreValues(AICC_Score){WriteToDebug("In AICC_SeperateScoreValues, AICC_Score="+ AICC_Score);var aryScores;aryScore=AICC_Score.split(",");AICC_fltScoreRaw=aryScore[0];if(IsValidDecimal(AICC_fltScoreRaw)){WriteToDebug("Found a valid decimal");AICC_fltScoreRaw=parseFloat(AICC_fltScoreRaw);}
else{WriteToDebug("ERROR - score from LMS is not a valid decimal");AICC_SetError(AICC_ERROR_INVALID_DECIMAL,"score is not a valid decimal")}
if(aryScore.length&gt;1){WriteToDebug("Max score found");AICC_fltScoreMax=aryScore[1];if(IsValidDecimal(AICC_fltScoreMax)){WriteToDebug("Found a valid decimal");AICC_fltScoreMax=parseFloat(AICC_fltScoreMax);}
else{WriteToDebug("ERROR - max score from LMS is not a valid decimal");AICC_SetError(AICC_ERROR_INVALID_DECIMAL,"max score is not a valid decimal")}}
if(aryScore.length&gt;2){WriteToDebug("Max score found");AICC_fltScoreMin=aryScore[2];if(IsValidDecimal(AICC_fltScoreMin)){WriteToDebug("Found a valid decimal");AICC_fltScoreMin=parseFloat(AICC_fltScoreMin);}
else{WriteToDebug("ERROR - min score from LMS is not a valid decimal");AICC_SetError(AICC_ERROR_INVALID_DECIMAL,"min score is not a valid decimal")}}}
function AICC_ValidateMasteryScore(strScore){WriteToDebug("In AICC_ValidateMasteryScore, strScore="+ strScore);if(IsValidDecimal(strScore)){AICC_Mastery_Score=parseFloat(strScore);}
else{WriteToDebug("ERROR - mastery score from LMS is not a valid decimal");AICC_SetError(AICC_ERROR_INVALID_DECIMAL,"mastery score is not a valid decimal")}}
function AICC_TranslateCredit(strCredit){WriteToDebug("In AICC_TranslateCredit, strCredit="+ strCredit);var strFirstChar;strFirstChar=strCredit.toLowerCase().charAt(0);if(strFirstChar=="c"){WriteToDebug("Credit = true");AICC_blnCredit=true;}
else if(strFirstChar=="n"){WriteToDebug("Credit = false");AICC_blnCredit=false}
else{WriteToDebug("ERROR - credit value from LMS is not a valid");AICC_SetError(AICC_ERROR_INVALID_CREDIT,"credit value from LMS is not a valid")}}
function AICC_TranslateLessonMode(strMode){WriteToDebug("In AICC_TranslateLessonMode, strMode="+ strMode);var strFirstChar;strFirstChar=strMode.toLowerCase().charAt(0);if(strFirstChar=="b"){WriteToDebug("Lesson Mode = Browse");AICC_strLessonMode=MODE_BROWSE;}
else if(strFirstChar=="n"){WriteToDebug("Lesson Mode = normal");AICC_strLessonMode=MODE_NORMAL;}
else if(strFirstChar=="r"){WriteToDebug("Lesson Mode = review");AICC_strLessonMode=MODE_REVIEW;if(!(typeof(REVIEW_MODE_IS_READ_ONLY)=="undefined")&amp;&amp;REVIEW_MODE_IS_READ_ONLY===true){blnReviewModeSoReadOnly=true;}}
else{WriteToDebug("ERROR - lesson_mode value from LMS is not a valid");AICC_SetError(AICC_ERROR_INVALID_LESSON_MODE,"lesson_mode value from LMS is not a valid")}}
function AICC_TranslateTimeToMilliseconds(strCMITime){WriteToDebug("In AICC_TranslateTimeToMilliseconds, strCMITime="+ strCMITime);if(IsValidCMITimeSpan(strCMITime)){AICC_intPreviouslyAccumulatedMilliseconds=ConvertCMITimeSpanToMS(strCMITime);}
else{WriteToDebug("ERROR - Invalid CMITimeSpan");AICC_SetError(AICC_ERROR_INVALID_TIMESPAN,"Invalid timespan (previously accumulated time) received from LMS");}}
function AICC_TranslateMaxTimeToMilliseconds(strCMITime){WriteToDebug("In AICC_TranslateMaxTimeToMilliseconds, strCMITime="+ strCMITime);if(IsValidCMITimeSpan(strCMITime)){AICC_intMaxTimeAllowedMilliseconds=ConvertCMITimeSpanToMS(strCMITime);}
else{WriteToDebug("ERROR - Invalid CMITimeSpan");AICC_SetError(AICC_ERROR_INVALID_TIMESPAN,"Invalid timespan (max time allowed) received from LMS");}}
function AICC_TranslateTimeLimitAction(strTimeLimitAction){WriteToDebug("In AICC_TranslateTimeLimitAction, strTimeLimitAction="+ strTimeLimitAction);var arySplit;var blnError=false;var strChar1="";var strChar2="";arySplit=strTimeLimitAction.split(",");if(arySplit.length==2){WriteToDebug("Found 2 elements");strChar1=arySplit[0].charAt(0).toLowerCase();strChar2=arySplit[1].charAt(0).toLowerCase();WriteToDebug("Got characters, strChar1="+ strChar1+", strChar2="+ strChar2);if((strChar1!="e"&amp;&amp;strChar1!="c"&amp;&amp;strChar1!="m"&amp;&amp;strChar1!="n")||(strChar2!="e"&amp;&amp;strChar2!="c"&amp;&amp;strChar2!="m"&amp;&amp;strChar2!="n")||(strChar1==strChar2)){blnError=true
WriteToDebug("Found an invalid character, or 2 identical characters");}
if(strChar1=="e"||strChar2=="e"){AICC_blnExitOnTimeout=true;}
if(strChar1=="c"||strChar2=="c"){AICC_blnExitOnTimeout=false;}
if(strChar1=="n"||strChar2=="n"){AICC_blnShowMessageOnTimeout=false;}
if(strChar1=="m"||strChar2=="m"){AICC_blnShowMessageOnTimeout=true;}
WriteToDebug("AICC_blnExitOnTimeout="+ AICC_blnExitOnTimeout+", AICC_blnShowMessageOnTimeout"+ AICC_blnShowMessageOnTimeout);}
else{WriteToDebug("Line does not contain two comma-delimited elements");blnError=true;}
if(blnError){WriteToDebug("ERROR - Invalid Time Limit Action");AICC_SetError(AICC_ERROR_INVALID_TIME_LIMIT_ACTION,"Invalid time limit action received from LMS");}}
function AICC_TranslateTextPreference(strPreference){WriteToDebug("In AICC_TranslateTextPreference, strPreference="+ strPreference);if(strPreference==-1){WriteToDebug("Text Preference = off");AICC_TextPreference=PREFERENCE_OFF;}
else if(strPreference==0){WriteToDebug("Text Preference = default");AICC_TextPreference=PREFERENCE_DEFAULT;}
else if(strPreference==1){WriteToDebug("Text Preference = on");AICC_TextPreference=PREFERENCE_ON;}
else{WriteToDebug("ERROR - Invalid Text Preference");AICC_SetError(AICC_ERROR_INVALID_PREFERENCE,"Invalid Text Preference received from LMS");}}
function AICC_TranslateLessonStatus(strStatus){WriteToDebug("In AICC_TranslateLessonStatus, strStatus="+ strStatus);var strFirstChar;var intPos;var strEntry;strFirstChar=strStatus.charAt(0).toLowerCase();AICC_Status=AICC_ConvertAICCStatusIntoLocalStatus(strFirstChar);WriteToDebug("AICC_Status="+ AICC_Status);intPos=strStatus.indexOf(",");if(intPos&gt;0){strEntry=strStatus.substr(intPos);strEntry=strEntry.replace(/,/,"");strFirstChar=strEntry.charAt(0).toLowerCase();if(strFirstChar=="a"){WriteToDebug("Entry is Ab initio");AICC_Entry=ENTRY_FIRST_TIME;}
else if(strFirstChar=="r"){WriteToDebug("Entry is Resume");AICC_Entry=ENTRY_RESUME;}
else{WriteToDebug("ERROR - entry not found");AICC_SetError(AICC_ERROR_INVALID_ENTRY,"Invalid lesson status received from LMS");}}}
function AICC_ConvertAICCStatusIntoLocalStatus(strFirstCharOfAICCStatus){WriteToDebug("In AICC_ConvertAICCStatusIntoLocalStatus, strFirstCharOfAICCStatus="+ strFirstCharOfAICCStatus);if(strFirstCharOfAICCStatus=="p"){WriteToDebug("Status is Passed");return LESSON_STATUS_PASSED;}
else if(strFirstCharOfAICCStatus=="f"){WriteToDebug("Status is Failed");return LESSON_STATUS_FAILED;}
else if(strFirstCharOfAICCStatus=="c"){WriteToDebug("Status is Completed");return LESSON_STATUS_COMPLETED;}
else if(strFirstCharOfAICCStatus=="b"){WriteToDebug("Status is Browsed");return LESSON_STATUS_BROWSED;}
else if(strFirstCharOfAICCStatus=="i"){WriteToDebug("Status is Incomplete");return LESSON_STATUS_INCOMPLETE;}
else if(strFirstCharOfAICCStatus=="n"){WriteToDebug("Status is Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
else{WriteToDebug("ERROR - status not found");AICC_SetError(SCORM_ERROR_INVALID_STATUS,"Invalid status");return LESSON_STATUS_NOT_ATTEMPTED;}}
function AICC_TranslateAudio(strAudio){WriteToDebug("In AICC_TranslateAudio, strAudio="+ strAudio);var intTempPreference=parseInt(strAudio,10);WriteToDebug("intTempPreference="+ intTempPreference);if(intTempPreference&gt;0&amp;&amp;intTempPreference&lt;=100){WriteToDebug("Returning On");AICC_AudioPlayPreference=PREFERENCE_ON;AICC_intAudioVolume=intTempPreference;}
else if(intTempPreference==0){WriteToDebug("Returning Default");AICC_AudioPlayPreference=PREFERENCE_DEFAULT;}
else if(intTempPreference&lt;0){WriteToDebug("returning Off");AICC_AudioPlayPreference=PREFERENCE_OFF;}
else{WriteToDebug("Error: Invalid preference");AICC_SetError(AICC_ERROR_INVALID_PREFERENCE,"Invalid audio preference received from LMS");}}
function AICC_TranslateSpeed(intAICCSpeed){WriteToDebug("In AICC_TranslateSpeed, intAICCSpeed="+ intAICCSpeed);var intPercentOfMax;if(!ValidInteger(intAICCSpeed)){WriteToDebug("ERROR - invalid integer");AICC_SetError(AICC_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - not an integer");return;}
intAICCSpeed=parseInt(intAICCSpeed,10)
if(intAICCSpeed&lt;-100||intAICCSpeed&gt;100){WriteToDebug("ERROR - out of range");AICC_SetError(AICC_ERROR_INVALID_SPEED,"Invalid speed preference received from LMS - out of range");return;}
AICC_Speed=intAICCSpeed;intPercentOfMax=(intAICCSpeed+ 100)/2;intPercentOfMax=parseInt(intPercentOfMax,10);WriteToDebug("Returning "+ intPercentOfMax);AICC_intPercentOfMaxSpeed=intPercentOfMax;}
function AICC_FormatObjectives(strObjectivesFromLMS){WriteToDebug("In AICC_FormatObjectives, strObjectivesFromLMS="+ strObjectivesFromLMS);var aryLines;var i;var strLineName;var strLineValue;var strLineType;var strIndex;aryLines=strObjectivesFromLMS.split("\n");for(i=0;i&lt;aryLines.length;i++){WriteToDebug("Extracting Index From Line: "+ aryLines[i]);strLineName=GetNameFromAICCLine(aryLines[i]);strIndex=GetIndexFromAICCName(strLineName);strIndex=parseInt(strIndex,10);WriteToDebug("strIndex: "+ strIndex);AICC_aryObjectivesRead[parseInt(strIndex,10)]=new Array(3);}
for(i=0;i&lt;aryLines.length;i++){WriteToDebug("Populating Line "+ aryLines[i]);strLineName=GetNameFromAICCLine(aryLines[i]);strLineValue=GetValueFromAICCLine(aryLines[i]);strIndex=GetIndexFromAICCName(strLineName);strIndex=strIndex;WriteToDebug("strLineName: "+ strLineName);WriteToDebug("strLineValue: "+ strLineValue);WriteToDebug("strIndex: "+ strIndex);strLineType=strLineName.substr(0,4).toLowerCase();if(strLineType=="j_id"){WriteToDebug("Found ID");AICC_aryObjectivesRead[parseInt(strIndex,10)][AICC_OBJ_ARRAY_ID]=strLineValue;}
else if(strLineType=="j_st"){WriteToDebug("Found Status");AICC_aryObjectivesRead[parseInt(strIndex,10)][AICC_OBJ_ARRAY_STATUS]=AICC_ConvertAICCStatusIntoLocalStatus(strLineValue.charAt(0).toLowerCase());}
else if(strLineType=="j_sc"){WriteToDebug("Found Score");AICC_aryObjectivesRead[parseInt(strIndex,10)][AICC_OBJ_ARRAY_SCORE]=AICC_ExtractSingleScoreFromObjective(strLineValue);}
else{WriteToDebug("WARNING - unidentified objective data found - "+ aryLines[i]);}}}
function AICC_ExtractSingleScoreFromObjective(strLineValue){WriteToDebug("In AICC_ExtractSingleScoreFromObjective, strLineValue="+ strLineValue);var aryParts;aryParts=strLineValue.split(";");aryParts=aryParts[0].split(",");WriteToDebug("returning "+ aryParts[0]);return aryParts[0];}
function FindObjectiveById(strID,aryObjectives){WriteToDebug("In FindObjectiveById, strID="+ strID);for(var i=0;i&lt;=aryObjectives.length;i++){WriteToDebug("Searching element "+ i);if(aryObjectives[i]){WriteToDebug("Element Exists");if(aryObjectives[i][AICC_OBJ_ARRAY_ID].toString()==strID.toString()){WriteToDebug("Element matches");return i;}}}
return null;}
function AICC_FindInteractionIndexFromID(strInteractionID){WriteToDebug("AICC_FindInteractionIndexFromID - AICC does not support interaction retrieval, returning null");return null;}
function AICC_GetInteractionType(strInteractionID)
{WriteToDebug("AICC_GetInteractionType - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionTimestamp(strInteractionID)
{WriteToDebug("AICC_GetInteractionTimestamp - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("AICC_GetInteractionCorrectResponses - AICC does not support interaction retrieval, returning empty array");return new Array();}
function AICC_GetInteractionWeighting(strInteractionID)
{WriteToDebug("AICC_GetInteractionWeighting - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("AICC_GetInteractionLearnerResponses - AICC does not support interaction retrieval, returning empty array");return new Array();}
function AICC_GetInteractionResult(strInteractionID)
{WriteToDebug("AICC_GetInteractionResult - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionLatency(strInteractionID)
{WriteToDebug("AICC_GetInteractionDescription - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_GetInteractionDescription(strInteractionID)
{WriteToDebug("AICC_GetInteractionDescription - AICC does not support interaction retrieval, returning empty string");return'';}
function AICC_CreateDataBucket(strBucketId,intMinSize,intMaxSize){WriteToDebug("AICC_CreateDataBucket - AICC does not support SSP, returning false");return false;}
function AICC_GetDataFromBucket(strBucketId){WriteToDebug("AICC_GetDataFromBucket - AICC does not support SSP, returning empty string");return"";}
function AICC_PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("AICC_PutDataInBucket - AICC does not support SSP, returning false");return false;}
function AICC_DetectSSPSupport(){WriteToDebug("AICC_DetectSSPSupport - AICC does not support SSP, returning false");return false;}
function AICC_GetBucketInfo(strBucketId){WriteToDebug("AICC_DetectSSPSupport - AICC does not support SSP, returning empty SSPBucketSize");return new SSPBucketSize(0,0);}
function FormAICCPostData(){WriteToDebug("In FormAICCPostData");var strAICCData="";strAICCData+="[Core]\r\n";strAICCData+="Lesson_Location="+ AICC_Lesson_Location+"\r\n";strAICCData+="Lesson_Status="+ AICC_TranslateLessonStatusToAICC(AICC_Status)+"\r\n";strAICCData+="Score="+ AICC_TranslateScoreToAICC()+"\r\n";strAICCData+="Time="+ AICC_TranslateTimeToAICC()+"\r\n";strAICCData+="[Comments]\r\n"+ AICC_TranslateCommentsToAICC()+"\r\n";strAICCData+="[Objectives_Status]\r\n"+ AICC_TranslateObjectivesToAICC()+"\r\n";strAICCData+="[Student_Preferences]\r\n";strAICCData+="Audio="+ AICC_TranslateAudioToAICC()+"\r\n";strAICCData+="Language="+ AICC_Language+"\r\n";strAICCData+="Speed="+ AICC_TranslateSpeedToAICC()+"\r\n";strAICCData+="Text="+ AICC_TranslateTextToAICC()+"\r\n";strAICCData+="[Core_Lesson]\r\n";strAICCData+=AICC_Data_Chunk;WriteToDebug("FormAICCPostData returning: "+ strAICCData);return strAICCData;}
function AICC_TranslateLessonStatusToAICC(intStatus){WriteToDebug("In AICC_TranslateLessonStatusToAICC");switch(intStatus){case LESSON_STATUS_PASSED:WriteToDebug("Status is passed");AICC_Lesson_Status="P";break;case LESSON_STATUS_COMPLETED:WriteToDebug("Status is completed");AICC_Lesson_Status="C";break;case LESSON_STATUS_FAILED:WriteToDebug("Status is failed");AICC_Lesson_Status="F";break;case LESSON_STATUS_INCOMPLETE:WriteToDebug("Status is incomplete");AICC_Lesson_Status="I";break;case LESSON_STATUS_BROWSED:WriteToDebug("Status is browsed");AICC_Lesson_Status="B";break;case LESSON_STATUS_NOT_ATTEMPTED:WriteToDebug("Status is not attempted");AICC_Lesson_Status="N";break;}
return AICC_Lesson_Status;}
function AICC_TranslateScoreToAICC(){WriteToDebug("In AICC_TranslateScoreToAICC");AICC_Score=AICC_fltScoreRaw;if(AICC_LMS_Version&lt;3&amp;&amp;AICC_fltScoreRaw!=""){AICC_Score=parseInt(AICC_Score,10);}
if((AICC_REPORT_MIN_MAX_SCORE===undefined||AICC_REPORT_MIN_MAX_SCORE===null||AICC_REPORT_MIN_MAX_SCORE===true)&amp;&amp;(AICC_LMS_Version&gt;=3)){WriteToDebug("Using max and min values if available.");if((AICC_fltScoreMax!="")||(AICC_fltScoreMin!="")){WriteToDebug("Appending Max and Min scores");AICC_Score+=","+ AICC_fltScoreMax+","+ AICC_fltScoreMin;}}
WriteToDebug("AICC_Score="+ AICC_Score);return AICC_Score;}
function AICC_TranslateTimeToAICC(){WriteToDebug("In AICC_TranslateTimeToAICC");var strTime;strTime=ConvertMilliSecondsToSCORMTime(AICC_intSessionTimeMilliseconds,false);return strTime;}
function AICC_TranslateCommentsToAICC(){WriteToDebug("In AICC_TranslateCommentsToAICC");var strComments="";for(var i=0;i&lt;AICC_aryCommentsFromLearner.length;i++){strComments+="&lt;"+(i+1)+"&gt;"+ AICC_aryCommentsFromLearner[i]+"&lt;e."+(i+1)+"&gt;";}
return strComments;}
function AICC_TranslateObjectivesToAICC(){WriteToDebug("In AICC_TranslateObjectivesToAICC");var strObjectives="";for(var i=0;i&lt;AICC_aryObjectivesWrite.length;i++){WriteToDebug("Looking at index: "+ i);if(AICC_aryObjectivesWrite[i]){WriteToDebug("Element "+ i+" exists, id="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_ID]+", score="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_SCORE]+", status="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_STATUS]);strObjectives+="J_ID."+(i+1)+"="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_ID]+"\r\n";if(AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_SCORE]!=""){strObjectives+="J_Score."+(i+1)+"="+ AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_SCORE]+"\r\n";}
if(AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_STATUS]!=""){strObjectives+="J_Status."+(i+1)+"="+ AICC_TranslateLessonStatusToAICC(AICC_aryObjectivesWrite[i][AICC_OBJ_ARRAY_STATUS])+"\r\n";}}}
return strObjectives;}
function AICC_TranslateAudioToAICC(){WriteToDebug("In AICC_TranslateAudioToAICC");var strReturn;switch(AICC_AudioPlayPreference){case PREFERENCE_ON:WriteToDebug("Preference is ON");strReturn=AICC_intAudioVolume;break;case PREFERENCE_DEFAULT:WriteToDebug("Preference is DEFAULT");strReturn=0;break;case PREFERENCE_OFF:WriteToDebug("Preference is OFF");strReturn=-1;break;}
return strReturn;}
function AICC_TranslateSpeedToAICC(){WriteToDebug("In AICC_TranslateSpeedToAICC");var intAICCSpeed;intAICCSpeed=(AICC_intPercentOfMaxSpeed*2)- 100;return intAICCSpeed;}
function AICC_TranslateTextToAICC(){WriteToDebug("In AICC_TranslateTextToAICC");var strPreference=0;if(AICC_TextPreference==PREFERENCE_OFF){strPreference=-1;}
else if(AICC_TextPreference==PREFERENCE_DEFAULT){strPreference=0;}
else if(AICC_TextPreference==PREFERENCE_ON){strPreference=1;}
return strPreference;}
function FormAICCInteractionsData(){WriteToDebug("In FormAICCInteractionsData");var strInteractions;var strDate;var strTime;var strResult="";strInteractions='"course_id","student_id","lesson_id","date","time","interaction_id",'+'"objective_id","type_interaction","correct_response","student_response",'+'"result","weighting","latency"\r\n';var blnCorrect="";var strResponse="";var strCorrectResponse="";var strLatency="";for(var i=0;i&lt;AICC_aryInteractions.length;i++){blnCorrect=AICC_aryInteractions[i][AICC_INTERACTIONS_CORRECT];strResult="";if(blnCorrect==true||blnCorrect==INTERACTION_RESULT_CORRECT){strResult=AICC_RESULT_CORRECT;}
else if(blnCorrect=="false"||blnCorrect==INTERACTION_RESULT_WRONG){strResult=AICC_RESULT_WRONG;}
else if(blnCorrect==INTERACTION_RESULT_UNANTICIPATED){strResult=AICC_RESULT_UNANTICIPATED;}
else if(blnCorrect==INTERACTION_RESULT_NEUTRAL){strResult=AICC_RESULT_NEUTRAL;}
strDate=ConvertDateToCMIDate(AICC_aryInteractions[i][AICC_INTERACTIONS_TIME_STAMP]);strTime=ConvertDateToCMITime(AICC_aryInteractions[i][AICC_INTERACTIONS_TIME_STAMP]);if(blnUseLongInteractionResultValues==true){strResponse=AICC_aryInteractions[i][AICC_INTERACTIONS_RESPONSE_LONG];strCorrectResponse=AICC_aryInteractions[i][AICC_INTERACTIONS_CORRECT_RESPONSE_LONG];}
else{strResponse=AICC_aryInteractions[i][AICC_INTERACTIONS_RESPONSE];strCorrectResponse=AICC_aryInteractions[i][AICC_INTERACTIONS_CORRECT_RESPONSE];}
strResponse=new String(strResponse);strCorrectResponse=new String(strCorrectResponse);var tempLatency=AICC_aryInteractions[i][AICC_INTERACTIONS_LATENCY];if(tempLatency!==null&amp;&amp;tempLatency!==undefined&amp;&amp;tempLatency!=""){strLatency=ConvertMilliSecondsToSCORMTime(tempLatency,false);}
strInteractions+='"'+ AICC_CourseID.replace("\"","")+'","'+ AICC_Student_ID.replace("\"","")+'","'+ AICC_LESSON_ID.replace("\"","")+'","'+
strDate+'","'+ strTime+'","'+ AICC_aryInteractions[i][AICC_INTERACTIONS_ID].replace("\"","")+'",'+'""'+',"'+ AICC_aryInteractions[i][AICC_INTERACTIONS_TYPE]+'","'+ strCorrectResponse.replace("\"","")+'","'+
strResponse.replace("\"","")+'","'+ strResult+'","'+
AICC_aryInteractions[i][AICC_INTERACTIONS_WEIGHTING]+'","'+ strLatency+'"\r\n';}
return strInteractions;}
function DisplayAICCVariables(){var strAlert="";strAlert+="AICC_Student_ID = "+ AICC_Student_ID+"\n";strAlert+="AICC_Student_Name = "+ AICC_Student_Name+"\n";strAlert+="AICC_Lesson_Location = "+ AICC_Lesson_Location+"\n";strAlert+="AICC_Score = "+ AICC_Score+"\n";strAlert+="AICC_Credit = "+ AICC_Credit+"\n";strAlert+="AICC_Lesson_Status = "+ AICC_Lesson_Status+"\n";strAlert+="AICC_Time = "+ AICC_Time+"\n";strAlert+="AICC_Mastery_Score = "+ AICC_Mastery_Score+"\n";strAlert+="AICC_Lesson_Mode = "+ AICC_Lesson_Mode+"\n";strAlert+="AICC_Max_Time_Allowed = "+ AICC_Max_Time_Allowed+"\n";strAlert+="AICC_Time_Limit_Action = "+ AICC_Time_Limit_Action+"\n";strAlert+="AICC_Audio = "+ AICC_Audio+"\n";strAlert+="AICC_Speed = "+ AICC_Speed+"\n";strAlert+="AICC_Language = "+ AICC_Language+"\n";strAlert+="AICC_Text = "+ AICC_Text+"\n";strAlert+="AICC_Launch_Data = "+ AICC_Launch_Data+"\n";strAlert+="AICC_Data_Chunk = "+ AICC_Data_Chunk+"\n";strAlert+="AICC_Comments = "+ AICC_Comments+"\n";strAlert+="AICC_Objectives = "+ AICC_Objectives+"\n";alert(strAlert)}</text>
				</content>
				<redirectionURL/>
				<headersSize>287</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/NONEFunctions.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>372</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="NONEFunctions.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>function NONE_Initialize(){WriteToDebug("In NONE_Initialize, Returning true");InitializeExecuted(true,"");return true;}
function NONE_Finish(strExitType,blnStatusWasSet){WriteToDebug("In NONE_Finish, Returning true");return true;}
function NONE_CommitData(){WriteToDebug("In NONE_CommitData, Returning true");return true;}
function NONE_GetStudentID(){WriteToDebug("In NONE_GetStudentID, Returning ''");return"";}
function NONE_GetStudentName(){WriteToDebug("In NONE_GetStudentName, Returning ''");return"";}
function NONE_GetBookmark(){WriteToDebug("In NONE_GetBookmark, Returning ''");return"";}
function NONE_SetBookmark(strBookmark){WriteToDebug("In NONE_SetBookmark, Returning true");return true;}
function NONE_GetDataChunk(){WriteToDebug("In NONE_GetDataChunk, Returning ''");return"";}
function NONE_SetDataChunk(strData){WriteToDebug("In NONE_SetDataChunk, Returning true");return true;}
function NONE_GetLaunchData(){WriteToDebug("In NONE_GetLaunchData, Returning ''");return"";}
function NONE_GetComments(){WriteToDebug("In NONE_GetComments, Returning ''");return"";}
function NONE_WriteComment(strComment){WriteToDebug("In NONE_WriteComment, Returning true");return true;}
function NONE_GetLMSComments(){WriteToDebug("In NONE_GetLMSComments, Returning ''");return"";}
function NONE_GetAudioPlayPreference(){WriteToDebug("In NONE_GetAudioPlayPreference, Returning "+ PREFERENCE_DEFAULT);return PREFERENCE_DEFAULT;}
function NONE_GetAudioVolumePreference(){WriteToDebug("In NONE_GetAudioVolumePreference, Returning 100");return 100;}
function NONE_SetAudioPreference(PlayPreference,intPercentOfMaxSpeed){WriteToDebug("In NONE_SetAudioPreference, Returning true");return true;}
function NONE_SetLanguagePreference(strLanguage){WriteToDebug("In NONE_SetLanguagePreference, Returning true");return true;}
function NONE_GetLanguagePreference(){WriteToDebug("In NONE_GetLanguagePreference, Returning ''");return"";}
function NONE_SetSpeedPreference(intPercentOfMax){WriteToDebug("In NONE_SetSpeedPreference, Returning true");return true;}
function NONE_GetSpeedPreference(){WriteToDebug("In NONE_GetSpeedPreference, Returning 100");return 100;}
function NONE_SetTextPreference(intPreference){WriteToDebug("In NONE_SetTextPreference, Returning true");return true;}
function NONE_GetTextPreference(){WriteToDebug("In NONE_GetTextPreference, Returning "+ PREFERENCE_DEFAULT);return PREFERENCE_DEFAULT;}
function NONE_GetPreviouslyAccumulatedTime(){WriteToDebug("In NONE_GetPreviouslyAccumulatedTime, Returning 0");return 0;}
function NONE_SaveTime(intMilliSeconds){WriteToDebug("In intMilliSeconds, Returning true");return true;}
function NONE_GetMaxTimeAllowed(){WriteToDebug("In NONE_GetMaxTimeAllowed, Returning 36002439999");return MAX_CMI_TIME;}
function NONE_DisplayMessageOnTimeout(){WriteToDebug("In NONE_DisplayMessageOnTimeout, Returning false");return false;}
function NONE_ExitOnTimeout(){WriteToDebug("In NONE_ExitOnTimeout, Returning false");return false;}
function NONE_GetPassingScore(){WriteToDebug("In NONE_GetPassingScore, Returning ''");return'';}
function NONE_GetScore(){WriteToDebug("In NONE_GetScore, Returning 0");return 0;}
function NONE_SetScore(intScore,intMaxScore,intMinScore){WriteToDebug("In NONE_SetScore, Returning true");return true;}
function NONE_RecordTrueFalseInteraction(){WriteToDebug("In NONE_RecordTrueFalseInteraction, Returning true");return true;}
function NONE_RecordMultipleChoiceInteraction(strID,strResponse,blnCorrect,strCorrectResponse){WriteToDebug("In NONE_RecordMultipleChoiceInteraction, Returning true");return true;}
function NONE_RecordFillInInteraction(){WriteToDebug("In NONE_RecordFillInInteraction, Returning true");return true;}
function NONE_RecordMatchingInteraction(){WriteToDebug("In NONE_RecordMatchingInteraction, Returning true");return true;}
function NONE_RecordPerformanceInteraction(){WriteToDebug("In NONE_RecordPerformanceInteraction, Returning true");return true;}
function NONE_RecordSequencingInteraction(){WriteToDebug("In NONE_RecordSequencingInteraction, Returning true");return true;}
function NONE_RecordLikertInteraction(){WriteToDebug("In RecordLikertInteraction, Returning true");return true;}
function NONE_RecordNumericInteraction(){WriteToDebug("In NONE_RecordNumericInteraction, Returning true");return true;}
function NONE_GetEntryMode(){WriteToDebug("In NONE_GetEntryMode, Returning "+ ENTRY_FIRST_TIME);return ENTRY_FIRST_TIME;}
function NONE_GetLessonMode(){WriteToDebug("In NONE_GetLessonMode, Returning "+ MODE_NORMAL);return MODE_NORMAL;}
function NONE_GetTakingForCredit(){WriteToDebug("In NONE_GetTakingForCredit, Returning true");return true;}
function NONE_SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){WriteToDebug("In NONE_SetObjectiveScore, Returning true");return true;}
function NONE_SetObjectiveStatus(strObjectiveID,Lesson_Status){WriteToDebug("In NONE_SetObjectiveStatus, Returning true");return true;}
function NONE_SetObjectiveDescription(strObjectiveID,strObjectiveDescription){WriteToDebug("In NONE_SetObjectiveDescription, Returning true");return true;}
function NONE_GetObjectiveScore(strObjectiveID){WriteToDebug("In NONE_SetObjectiveScore, Returning ''");return'';}
function NONE_GetObjectiveStatus(strObjectiveID){WriteToDebug("In NONE_SetObjectiveStatus, Returning Not Attempted");return LESSON_STATUS_NOT_ATTEMPTED;}
function NONE_GetObjectiveDescription(strObjectiveID){WriteToDebug("In NONE_GetObjectiveDescription, ''");return"";}
function NONE_FindInteractionIndexFromID(strInteractionID){WriteToDebug("NONE_FindInteractionIndexFromID - NONE does not support interaction retrieval, returning null");return null;}
function NONE_GetInteractionType(strInteractionID)
{WriteToDebug("NONE_GetInteractionType - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionTimestamp(strInteractionID)
{WriteToDebug("NONE_GetInteractionTimestamp - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("NONE_GetInteractionCorrectResponses - NONE does not support interaction retrieval, returning empty array");return new Array();}
function NONE_GetInteractionWeighting(strInteractionID)
{WriteToDebug("NONE_GetInteractionWeighting - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("NONE_GetInteractionLearnerResponses - NONE does not support interaction retrieval, returning empty array");return new Array();}
function NONE_GetInteractionResult(strInteractionID)
{WriteToDebug("NONE_GetInteractionResult - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionLatency(strInteractionID)
{WriteToDebug("NONE_GetInteractionDescription - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_GetInteractionDescription(strInteractionID)
{WriteToDebug("NONE_GetInteractionDescription - NONE does not support interaction retrieval, returning empty string");return'';}
function NONE_CreateDataBucket(strBucketId,intMinSize,intMaxSize){WriteToDebug("NONE_CreateDataBucket - NONE does not support SSP, returning false");return false;}
function NONE_GetDataFromBucket(strBucketId){WriteToDebug("NONE_GetDataFromBucket - NONE does not support SSP, returning empty string");return"";}
function NONE_PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("NONE_PutDataInBucket - NONE does not support SSP, returning false");return false;}
function NONE_DetectSSPSupport(){WriteToDebug("NONE_DetectSSPSupport - NONE does not support SSP, returning false");return false;}
function NONE_GetBucketInfo(strBucketId){WriteToDebug("NONE_DetectSSPSupport - NONE does not support SSP, returning empty SSPBucketSize");return new SSPBucketSize(0,0);}
function NONE_SetFailed(){WriteToDebug("In NONE_SetFailed, Returning true");return true;}
function NONE_SetPassed(){WriteToDebug("In NONE_SetPassed, Returning true");return true;}
function NONE_SetCompleted(){WriteToDebug("In NONE_SetCompleted, Returning true");return true;}
function NONE_ResetStatus(){WriteToDebug("In NONE_ResetStatus, Returning true");return true;}
function NONE_GetStatus(){WriteToDebug("In NONE_GetStatus, Returning "+ LESSON_STATUS_INCOMPLETE);return LESSON_STATUS_INCOMPLETE;}
function NONE_GetProgressMeasure(){WriteToDebug("NONE_GetProgressMeasure - NONE does not support progress_measure, returning false");return false;}
function NONE_SetProgressMeasure(){WriteToDebug("NONE_SetProgressMeasure - NONE does not support progress_measure, returning false");return false;}
function NONE_GetObjectiveProgressMeasure(){WriteToDebug("NONE_GetObjectiveProgressMeasure - NONE does not support progress_measure, returning false");return false;}
function NONE_SetObjectiveProgressMeasure(){WriteToDebug("NONE_SetObjectiveProgressMeasure - NONE does not support progress_measure, returning false");return false;}
function NONE_SetPointBasedScore(intScore,intMaxScore,intMinScore){WriteToDebug("NONE_SetPointBasedScore - NONE does not support SetPointBasedScore, returning false");return false;}
function NONE_GetScaledScore(intScore,intMaxScore,intMinScore){WriteToDebug("NONE_GetScaledScore - NONE does not support GetScaledScore, returning false");return false;}
function NONE_GetLastError(){WriteToDebug("In NONE_GetLastError, Returning "+ NO_ERROR);return NO_ERROR;}
function NONE_GetLastErrorDesc(){WriteToDebug("In NONE_GetLastErrorDesc, Returning ''");return"";}</text>
				</content>
				<redirectionURL/>
				<headersSize>287</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/LMSAPI.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>365</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="LMSAPI.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>function LMSStandardAPI(strStandard){WriteToDebug("In LMSStandardAPI strStandard="+ strStandard);if(strStandard==""){WriteToDebug("No standard specified, using NONE");strStandard="NONE";}
eval("this.Initialize = "+ strStandard+"_Initialize");eval("this.Finish = "+ strStandard+"_Finish");eval("this.CommitData = "+ strStandard+"_CommitData");eval("this.GetStudentID = "+ strStandard+"_GetStudentID");eval("this.GetStudentName = "+ strStandard+"_GetStudentName");eval("this.GetBookmark = "+ strStandard+"_GetBookmark");eval("this.SetBookmark = "+ strStandard+"_SetBookmark");eval("this.GetDataChunk = "+ strStandard+"_GetDataChunk");eval("this.SetDataChunk = "+ strStandard+"_SetDataChunk");eval("this.GetLaunchData = "+ strStandard+"_GetLaunchData");eval("this.GetComments = "+ strStandard+"_GetComments");eval("this.WriteComment = "+ strStandard+"_WriteComment");eval("this.GetLMSComments = "+ strStandard+"_GetLMSComments");eval("this.GetAudioPlayPreference = "+ strStandard+"_GetAudioPlayPreference");eval("this.GetAudioVolumePreference = "+ strStandard+"_GetAudioVolumePreference");eval("this.SetAudioPreference = "+ strStandard+"_SetAudioPreference");eval("this.SetLanguagePreference = "+ strStandard+"_SetLanguagePreference");eval("this.GetLanguagePreference = "+ strStandard+"_GetLanguagePreference");eval("this.SetSpeedPreference = "+ strStandard+"_SetSpeedPreference");eval("this.GetSpeedPreference = "+ strStandard+"_GetSpeedPreference");eval("this.SetTextPreference = "+ strStandard+"_SetTextPreference");eval("this.GetTextPreference = "+ strStandard+"_GetTextPreference");eval("this.GetPreviouslyAccumulatedTime = "+ strStandard+"_GetPreviouslyAccumulatedTime");eval("this.SaveTime = "+ strStandard+"_SaveTime");eval("this.GetMaxTimeAllowed = "+ strStandard+"_GetMaxTimeAllowed");eval("this.DisplayMessageOnTimeout = "+ strStandard+"_DisplayMessageOnTimeout");eval("this.ExitOnTimeout = "+ strStandard+"_ExitOnTimeout");eval("this.GetPassingScore = "+ strStandard+"_GetPassingScore");eval("this.SetScore = "+ strStandard+"_SetScore");eval("this.GetScore = "+ strStandard+"_GetScore");eval("this.GetScaledScore = "+ strStandard+"_GetScaledScore");eval("this.RecordTrueFalseInteraction = "+ strStandard+"_RecordTrueFalseInteraction");eval("this.RecordMultipleChoiceInteraction = "+ strStandard+"_RecordMultipleChoiceInteraction");eval("this.RecordFillInInteraction = "+ strStandard+"_RecordFillInInteraction");eval("this.RecordMatchingInteraction = "+ strStandard+"_RecordMatchingInteraction");eval("this.RecordPerformanceInteraction = "+ strStandard+"_RecordPerformanceInteraction");eval("this.RecordSequencingInteraction = "+ strStandard+"_RecordSequencingInteraction");eval("this.RecordLikertInteraction = "+ strStandard+"_RecordLikertInteraction");eval("this.RecordNumericInteraction = "+ strStandard+"_RecordNumericInteraction");eval("this.GetEntryMode = "+ strStandard+"_GetEntryMode");eval("this.GetLessonMode = "+ strStandard+"_GetLessonMode");eval("this.GetTakingForCredit = "+ strStandard+"_GetTakingForCredit");eval("this.SetObjectiveScore = "+ strStandard+"_SetObjectiveScore");eval("this.SetObjectiveStatus = "+ strStandard+"_SetObjectiveStatus");eval("this.GetObjectiveScore = "+ strStandard+"_GetObjectiveScore");eval("this.GetObjectiveStatus = "+ strStandard+"_GetObjectiveStatus");eval("this.SetObjectiveDescription = "+ strStandard+"_SetObjectiveDescription");eval("this.GetObjectiveDescription = "+ strStandard+"_GetObjectiveDescription");eval("this.SetFailed = "+ strStandard+"_SetFailed");eval("this.SetPassed = "+ strStandard+"_SetPassed");eval("this.SetCompleted = "+ strStandard+"_SetCompleted");eval("this.ResetStatus = "+ strStandard+"_ResetStatus");eval("this.GetStatus = "+ strStandard+"_GetStatus");eval("this.GetLastError = "+ strStandard+"_GetLastError");eval("this.GetLastErrorDesc = "+ strStandard+"_GetLastErrorDesc");eval("this.GetInteractionType = "+ strStandard+"_GetInteractionType");eval("this.GetInteractionTimestamp = "+ strStandard+"_GetInteractionTimestamp");eval("this.GetInteractionCorrectResponses = "+ strStandard+"_GetInteractionCorrectResponses");eval("this.GetInteractionWeighting = "+ strStandard+"_GetInteractionWeighting");eval("this.GetInteractionLearnerResponses = "+ strStandard+"_GetInteractionLearnerResponses");eval("this.GetInteractionResult = "+ strStandard+"_GetInteractionResult");eval("this.GetInteractionLatency = "+ strStandard+"_GetInteractionLatency");eval("this.GetInteractionDescription = "+ strStandard+"_GetInteractionDescription");eval("this.CreateDataBucket = "+ strStandard+"_CreateDataBucket");eval("this.GetDataFromBucket = "+ strStandard+"_GetDataFromBucket");eval("this.PutDataInBucket = "+ strStandard+"_PutDataInBucket");eval("this.DetectSSPSupport = "+ strStandard+"_DetectSSPSupport");eval("this.GetBucketInfo = "+ strStandard+"_GetBucketInfo");eval("this.GetProgressMeasure = "+ strStandard+"_GetProgressMeasure");eval("this.SetProgressMeasure = "+ strStandard+"_SetProgressMeasure");eval("this.SetPointBasedScore = "+ strStandard+"_SetPointBasedScore");this.Standard=strStandard;}</text>
				</content>
				<redirectionURL/>
				<headersSize>280</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.683-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/API.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>362</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="API.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var blnCalledFinish=false;var blnStandAlone=false;var blnLoaded=false;var blnReachedEnd=false;var blnStatusWasSet=false;var blnLmsPresent=false;var dtmStart=null;var dtmEnd=null;var intAccumulatedMS=0;var blnOverrodeTime=false;var intTimeOverrideMS=null;var aryDebug=new Array();var strDebug="";var winDebug;var intError=NO_ERROR;var strErrorDesc="";var objLMS=null;function Start(){var strStandAlone;var strShowInteractiveDebug;var objTempAPI=null;var strTemp="";WriteToDebug("----------------------------------------");WriteToDebug("----------------------------------------");WriteToDebug("In Start - Version: "+ VERSION+"  Last Modified="+ window.document.lastModified);WriteToDebug("Browser Info ("+ navigator.appName+" "+ navigator.appVersion+")");WriteToDebug("URL: "+ window.document.location.href);WriteToDebug("----------------------------------------");WriteToDebug("----------------------------------------");ClearErrorInfo();strStandAlone=GetQueryStringValue("StandAlone",window.location.search);strShowInteractiveDebug=GetQueryStringValue("ShowDebug",window.location.search);WriteToDebug("strStandAlone="+ strStandAlone+"  strShowInteractiveDebug="+ strShowInteractiveDebug);if(ConvertStringToBoolean(strStandAlone)){WriteToDebug("Entering Stand Alone Mode");blnStandAlone=true;}
if(blnStandAlone){WriteToDebug("Using NONE Standard");objLMS=new LMSStandardAPI("NONE");}
else{WriteToDebug("Standard From Configuration File - "+ strLMSStandard);if(strLMSStandard.toUpperCase()=="AUTO"){WriteToDebug("Searching for AICC querystring parameters");strTemp=GetQueryStringValue("AICC_URL",document.location.search);if(strTemp!=null&amp;&amp;strTemp!="")
{WriteToDebug("Found AICC querystring parameters, using AICC");objLMS=new LMSStandardAPI("AICC");blnLmsPresent=true;}else{WriteToDebug("Auto-detecting standard - Searching for SCORM 2004 API");try{objTempAPI=SCORM2004_GrabAPI();}
catch(e){WriteToDebug("Error grabbing 2004 API-"+ e.name+":"+ e.message);}
if(!(typeof(objTempAPI)=="undefined"||objTempAPI==null)){WriteToDebug("Found SCORM 2004 API, using SCORM 2004");objLMS=new LMSStandardAPI("SCORM2004");blnLmsPresent=true;}else{WriteToDebug("Searching for SCORM 1.2 API");try{objTempAPI=SCORM_GrabAPI();}
catch(e){WriteToDebug("Error grabbing 1.2 API-"+ e.name+":"+ e.message);}
if(!(typeof(objTempAPI)=="undefined"||objTempAPI==null)){WriteToDebug("Found SCORM API, using SCORM");objLMS=new LMSStandardAPI("SCORM");blnLmsPresent=true;}else{if(ALLOW_NONE_STANDARD===true)
{WriteToDebug("Could not determine standard, defaulting to Stand Alone");objLMS=new LMSStandardAPI("NONE");}else{WriteToDebug("Could not determine standard, Stand Alone is disabled in configuration");DisplayError("Could not determine standard. Neither SCORM nor AICC APIs could be found");return;}}}}}else{WriteToDebug("Using Standard From Configuration File - "+ strLMSStandard);objLMS=new LMSStandardAPI(strLMSStandard);blnLmsPresent=true;}}
if(ConvertStringToBoolean(strShowInteractiveDebug)||(!(typeof(SHOW_DEBUG_ON_LAUNCH)=="undefined")&amp;&amp;SHOW_DEBUG_ON_LAUNCH===true)){WriteToDebug("Showing Interactive Debug Windows");ShowDebugWindow();}
WriteToDebug("Calling Standard Initialize");objLMS.Initialize();return;}
function InitializeExecuted(blnSuccess,strErrorMessage){WriteToDebug("In InitializeExecuted, blnSuccess="+ blnSuccess+", strErrorMessage="+ strErrorMessage);if(!blnSuccess){WriteToDebug("ERROR - LMS Initialize Failed");if(strErrorMessage==""){strErrorMessage="An Error Has Occurred";}
blnLmsPresent=false;DisplayError(strErrorMessage);return;}
blnLoaded=true;dtmStart=new Date();LoadContent();return;}
function ExecFinish(ExitType){WriteToDebug("In ExecFinish, ExiType="+ ExitType);ClearErrorInfo();if(blnLoaded&amp;&amp;!blnCalledFinish){WriteToDebug("Haven't called finish before, finishing");blnCalledFinish=true;if(blnReachedEnd){WriteToDebug("Reached End, overiding exit type to FINISH");ExitType=EXIT_TYPE_FINISH;}
if(!blnOverrodeTime){WriteToDebug("Did not override time");dtmEnd=new Date();AccumulateTime();objLMS.SaveTime(intAccumulatedMS);}
blnLoaded=false;WriteToDebug("Calling LMS Finish");return objLMS.Finish(ExitType,blnStatusWasSet);}
return true;}
function IsLoaded(){WriteToDebug("In IsLoaded, returning -"+ blnLoaded);return blnLoaded;}
function WriteToDebug(strInfo){if(blnDebug){var dtm=new Date();var strLine;strLine=aryDebug.length+":"+ dtm.toString()+" - "+ strInfo;aryDebug[aryDebug.length]=strLine;if(winDebug&amp;&amp;!winDebug.closed){winDebug.document.write(strLine+"&lt;br&gt;\n");}}
return;}
function ShowDebugWindow(){if(winDebug&amp;&amp;!winDebug.closed){winDebug.close();}
winDebug=window.open("blank.html","Debug","width=600,height=300,resizable,scrollbars");winDebug.document.write(aryDebug.join("&lt;br&gt;\n"));winDebug.document.close();winDebug.focus();return;}
function DisplayError(strMessage){var blnShowDebug;WriteToDebug("In DisplayError, strMessage="+ strMessage);blnShowDebug=confirm("An error has occured:\n\n"+ strMessage+"\n\nPress 'OK' to view debug information to send to technical support.");if(blnShowDebug){ShowDebugWindow();}}
function GetLastError(){WriteToDebug("In GetLastError, intError="+ intError);if(intError!=NO_ERROR){WriteToDebug("Returning API Error");return intError;}
else if(IsLoaded()&amp;&amp;objLMS.GetLastError()!=NO_ERROR){WriteToDebug("Returning LMS Error");return ERROR_LMS;}
WriteToDebug("Returning No Error");return NO_ERROR;}
function GetLastLMSErrorCode(){WriteToDebug("In GetLastLMSErrorCode, intError="+ intError);var LMSError=objLMS.GetLastError();if(IsLoaded()&amp;&amp;LMSError!=NO_ERROR){WriteToDebug("Returning LMS Error: "+ LMSError);return LMSError;}
WriteToDebug("Returning No Error");return NO_ERROR;}
function GetLastErrorDesc(){WriteToDebug("In GetLastErrorDesc");if(intError!=NO_ERROR){WriteToDebug("Returning API Error - "+ strErrorDesc);return strErrorDesc;}
else if(IsLoaded()&amp;&amp;objLMS.GetLastError()!=NO_ERROR){WriteToDebug("returning LMS Error");return objLMS.GetLastErrorDesc;}
WriteToDebug("Returning No Error");return"";}
function SetErrorInfo(intErrorNumToSet,strErrorDescToSet){WriteToDebug("In SetErrorInfo - Num="+ intErrorNumToSet+" Desc="+ strErrorDescToSet);intError=intErrorNumToSet;strErrorDesc=strErrorDescToSet;}
function ClearErrorInfo(){WriteToDebug("In ClearErrorInfo");var intError=NO_ERROR;var strErrorDesc="";}
function CommitData(){WriteToDebug("In CommitData");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!blnOverrodeTime){WriteToDebug("Did not override time, saving incremental time");dtmEnd=new Date();AccumulateTime();dtmStart=new Date();objLMS.SaveTime(intAccumulatedMS);}
return objLMS.CommitData();}
function Suspend(){WriteToDebug("In Suspend");ClearErrorInfo();return ExecFinish(EXIT_TYPE_SUSPEND);}
function Finish(){WriteToDebug("In Finish");ClearErrorInfo();return ExecFinish(EXIT_TYPE_FINISH);}
function TimeOut(){WriteToDebug("In TimeOut");ClearErrorInfo();return ExecFinish(EXIT_TYPE_TIMEOUT);}
function Unload(){WriteToDebug("In Unload");ClearErrorInfo();return ExecFinish(DEFAULT_EXIT_TYPE);}
function SetReachedEnd(){WriteToDebug("In SetReachedEnd");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(blnStatusWasSet==false){objLMS.SetCompleted();}
blnReachedEnd=true;return true;}
function ConcedeControl()
{WriteToDebug("Conceding control with type: "+ EXIT_BEHAVIOR);ClearErrorInfo();var contentRoot=null;var urlBase=null;switch(EXIT_BEHAVIOR)
{case"SCORM_RECOMMENDED":contentRoot=SearchParentsForContentRoot();if(contentRoot==window.top)
{Suspend();contentRoot.window.close();}
else
{Suspend();if(contentRoot!=null){if(IsAbsoluteUrl(EXIT_TARGET)){contentRoot.scormdriver_content.location.href=EXIT_TARGET;}else{urlBase=GetContentRootUrlBase(contentRoot);contentRoot.scormdriver_content.location.href=urlBase+ EXIT_TARGET;}}}
break;case"ALWAYS_CLOSE":Suspend();window.close();break;case"ALWAYS_CLOSE_TOP":Suspend();window.top.close();break;case"NOTHING":Suspend();break;case"REDIR_CONTENT_FRAME":Suspend();contentRoot=SearchParentsForContentRoot();if(contentRoot!=null){if(IsAbsoluteUrl(EXIT_TARGET)){contentRoot.scormdriver_content.location.href=EXIT_TARGET;}else{urlBase=GetContentRootUrlBase(contentRoot);contentRoot.scormdriver_content.location.href=urlBase+ EXIT_TARGET;}}
break;}
return true;}
function GetContentRootUrlBase(contentRoot){var urlParts=contentRoot.location.href.split("/");delete urlParts[urlParts.length- 1];contentRoot=urlParts.join("/");return contentRoot;}
function SearchParentsForContentRoot(){var contentRoot=null;var wnd=window;var i=0;if(wnd.scormdriver_content){contentRoot=wnd;return contentRoot;}
while(contentRoot==null&amp;&amp;wnd!=window.top&amp;&amp;(i++&lt;100)){if(wnd.scormdriver_content){contentRoot=wnd;return contentRoot;}
else{wnd=wnd.parent;}}
WriteToDebug("Unable to locate content root");return null;}
function GetStudentID(){WriteToDebug("In GetStudentID");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetStudentID();}
function GetStudentName(){WriteToDebug("In GetStudentName");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetStudentName();}
function GetBookmark(){WriteToDebug("In GetBookmark");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetBookmark();}
function SetBookmark(strBookmark){WriteToDebug("In SetBookmkar - strBookmark="+ strBookmark);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.SetBookmark(strBookmark);}
function GetDataChunk(){WriteToDebug("In GetDataChunk");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetDataChunk();}
function SetDataChunk(strData){WriteToDebug("In SetDataChunk strData="+ strData);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.SetDataChunk(strData);}
function GetLaunchData(){WriteToDebug("In GetLaunchData");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetLaunchData();}
function GetComments(){var strCommentString;var aryComments;var i;WriteToDebug("In GetComments");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return null;}
strCommentString=objLMS.GetComments();WriteToDebug("strCommentString="+ strCommentString);strCommentString=new String(strCommentString);if(strCommentString!=""){aryComments=strCommentString.split(" | ");for(i=0;i&lt;aryComments.length;i++){WriteToDebug("Returning Comment #"+ i);aryComments[i]=new String(aryComments[i]);aryComments[i]=aryComments[i].replace(/\|\|/g,"|");WriteToDebug("Comment #"+ i+"="+ aryComments[i]);}}
else{aryComments=new Array(0);}
return aryComments;}
function WriteComment(strComment){var strExistingCommentString;WriteToDebug("In WriteComment strComment="+ strComment);ClearErrorInfo();strComment=new String(strComment);if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strComment=strComment.replace(/\|/g,"||");strExistingCommentString=objLMS.GetComments();if(strExistingCommentString!=""){strComment=" | "+ strComment;}
strComment=strComment;return objLMS.WriteComment(strComment);}
function GetLMSComments(){WriteToDebug("In GetLMSComments");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetLMSComments();}
function GetAudioPlayPreference(){WriteToDebug("In GetAudioPlayPreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return PREFERENCE_DEFAULT;}
return objLMS.GetAudioPlayPreference();}
function GetAudioVolumePreference(){WriteToDebug("GetAudioVolumePreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 100;}
return objLMS.GetAudioVolumePreference();}
function SetAudioPreference(PlayPreference,intPercentOfMaxVolume){WriteToDebug("In SetAudioPreference PlayPreference="+ PlayPreference+" intPercentOfMaxVolume="+ intPercentOfMaxVolume);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(PlayPreference!=PREFERENCE_OFF&amp;&amp;PlayPreference!=PREFERENCE_ON){WriteToDebug("Error Invalid PlayPreference");SetErrorInfo(ERROR_INVALID_PREFERENCE,"Invalid PlayPreference passed to SetAudioPreference, PlayPreference="+ PlayPreference);return false;}
if(!ValidInteger(intPercentOfMaxVolume)){WriteToDebug("Error Invalid PercentOfMaxVolume - not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid PercentOfMaxVolume passed to SetAudioPreference (not an integer), intPercentOfMaxVolume="+ intPercentOfMaxVolume);return false;}
intPercentOfMaxVolume=parseInt(intPercentOfMaxVolume,10);if(intPercentOfMaxVolume&lt;1||intPercentOfMaxVolume&gt;100){WriteToDebug("Error Invalid PercentOfMaxVolume - out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid PercentOfMaxVolume passed to SetAudioPreference (must be between 1 and 100), intPercentOfMaxVolume="+ intPercentOfMaxVolume);return false;}
WriteToDebug("Calling to LMS");return objLMS.SetAudioPreference(PlayPreference,intPercentOfMaxVolume);}
function GetLanguagePreference(){WriteToDebug("In GetLanguagePreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return"";}
return objLMS.GetLanguagePreference();}
function SetLanguagePreference(strLanguage){WriteToDebug("In SetLanguagePreference strLanguage="+ strLanguage);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.SetLanguagePreference(strLanguage);}
function GetSpeedPreference(){WriteToDebug("In GetSpeedPreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 100;}
return objLMS.GetSpeedPreference();}
function SetSpeedPreference(intPercentOfMax){WriteToDebug("In SetSpeedPreference intPercentOfMax="+ intPercentOfMax);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!ValidInteger(intPercentOfMax)){WriteToDebug("ERROR Invalid Percent of MaxSpeed, not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid PercentOfMaxSpeed passed to SetSpeedPreference (not an integer), intPercentOfMax="+ intPercentOfMax);return false;}
intPercentOfMax=parseInt(intPercentOfMax,10);if(intPercentOfMax&lt;0||intPercentOfMax&gt;100){WriteToDebug("ERROR Invalid Percent of MaxSpeed, out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid PercentOfMaxSpeed passed to SetSpeedPreference (must be between 1 and 100), intPercentOfMax="+ intPercentOfMax);return false;}
WriteToDebug("Calling to LMS");return objLMS.SetSpeedPreference(intPercentOfMax);}
function GetTextPreference(){WriteToDebug("In GetTextPreference");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetTextPreference();}
function SetTextPreference(intPreference){WriteToDebug("In SetTextPreference intPreference="+ intPreference);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(intPreference!=PREFERENCE_DEFAULT&amp;&amp;intPreference!=PREFERENCE_OFF&amp;&amp;intPreference!=PREFERENCE_ON){WriteToDebug("Error - Invalid Preference");SetErrorInfo(ERROR_INVALID_PREFERENCE,"Invalid Preference passed to SetTextPreference, intPreference="+ intPreference);return false;}
return objLMS.SetTextPreference(intPreference);}
function GetPreviouslyAccumulatedTime(){WriteToDebug("In GetPreviouslyAccumulatedTime");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 0;}
return objLMS.GetPreviouslyAccumulatedTime();}
function AccumulateTime(){WriteToDebug("In AccumulateTime dtmStart="+ dtmStart+" dtmEnd="+ dtmEnd+" intAccumulatedMS="+ intAccumulatedMS);if(dtmEnd!=null&amp;&amp;dtmStart!=null){WriteToDebug("Accumulating Time");intAccumulatedMS+=(dtmEnd.getTime()- dtmStart.getTime());WriteToDebug("intAccumulatedMS="+ intAccumulatedMS);}}
function GetSessionAccumulatedTime(){WriteToDebug("In GetSessionAccumulatedTime");ClearErrorInfo();WriteToDebug("Setting dtmEnd to now");dtmEnd=new Date();WriteToDebug("Accumulating Time");AccumulateTime();if(dtmStart!=null){WriteToDebug("Resetting dtmStart");dtmStart=new Date();}
WriteToDebug("Setting dtmEnd to null");dtmEnd=null;WriteToDebug("Returning "+ intAccumulatedMS);return intAccumulatedMS;}
function SetSessionTime(intMilliseconds){WriteToDebug("In SetSessionTime");ClearErrorInfo();if(!ValidInteger(intMilliseconds)){WriteToDebug("ERROR parameter is not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid intMilliseconds passed to SetSessionTime (not an integer), intMilliseconds="+ intMilliseconds);return false;}
intMilliseconds=parseInt(intMilliseconds,10);if(intMilliseconds&lt;0){WriteToDebug("Error, parameter is less than 0");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid intMilliseconds passed to SetSessionTime (must be greater than 0), intMilliseconds="+ intMilliseconds);return false;}
blnOverrodeTime=true;intTimeOverrideMS=intMilliseconds;objLMS.SaveTime(intTimeOverrideMS);return true;}
function PauseTimeTracking(){WriteToDebug("In PauseTimeTracking");ClearErrorInfo();WriteToDebug("Setting dtmEnd to now");dtmEnd=new Date();WriteToDebug("Accumulating Time");AccumulateTime();WriteToDebug("Setting Start and End times to null");dtmStart=null;dtmEnd=null;return true;}
function ResumeTimeTracking(){WriteToDebug("In ResumeTimeTracking");ClearErrorInfo();WriteToDebug("Setting dtmStart to now");dtmStart=new Date();return true;}
function GetMaxTimeAllowed(){WriteToDebug("In GetMaxTimeAllowed");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return MAX_CMI_TIME;}
return objLMS.GetMaxTimeAllowed();}
function DisplayMessageOnTimeout(){WriteToDebug("In DisplayMessageOnTimeOut");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.DisplayMessageOnTimeout();}
function ExitOnTimeout(){WriteToDebug("In ExitOnTimeOut");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.ExitOnTimeout();}
function GetPassingScore(){WriteToDebug("In GetPassingScore");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 0;}
return objLMS.GetPassingScore();}
function GetScore(){WriteToDebug("In GetScore");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 0;}
return objLMS.GetScore();}
function GetScaledScore(){WriteToDebug("In GetScaledScore");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return 0;}
return objLMS.GetScaledScore();}
function SetScore(intScore,intMaxScore,intMinScore){WriteToDebug("In SetScore, intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!IsValidDecimal(intScore)){WriteToDebug("ERROR - intScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetScore (not a valid decimal), intScore="+ intScore);return false;}
if(!IsValidDecimal(intMaxScore)){WriteToDebug("ERROR - intMaxScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetScore (not a valid decimal), intMaxScore="+ intMaxScore);return false;}
if(!IsValidDecimal(intMinScore)){WriteToDebug("ERROR - intMinScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetScore (not a valid decimal), intMinScore="+ intMinScore);return false;}
WriteToDebug("Converting SCORES to floats");intScore=parseFloat(intScore);intMaxScore=parseFloat(intMaxScore);intMinScore=parseFloat(intMinScore);if(intScore&lt;0||intScore&gt;100){WriteToDebug("ERROR - intScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetScore (must be between 0-100), intScore="+ intScore);return false;}
if(intMaxScore&lt;0||intMaxScore&gt;100){WriteToDebug("ERROR - intMaxScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetScore (must be between 0-100), intMaxScore="+ intMaxScore);return false;}
if(intMinScore&lt;0||intMinScore&gt;100){WriteToDebug("ERROR - intMinScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetScore (must be between 0-100), intMinScore="+ intMinScore);return false;}
if(SCORE_CAN_ONLY_IMPROVE===true){var previousScore=GetScore();if(previousScore!=null&amp;&amp;previousScore!=""&amp;&amp;previousScore&gt;intScore){WriteToDebug("Previous score was greater than new score, configuration only allows scores to improve, returning.");return true;}}
WriteToDebug("Calling to LMS");return objLMS.SetScore(intScore,intMaxScore,intMinScore);}
function SetPointBasedScore(intScore,intMaxScore,intMinScore){WriteToDebug("In SetPointBasedScore, intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!IsValidDecimal(intScore)){WriteToDebug("ERROR - intScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetScore (not a valid decimal), intScore="+ intScore);return false;}
if(!IsValidDecimal(intMaxScore)){WriteToDebug("ERROR - intMaxScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetScore (not a valid decimal), intMaxScore="+ intMaxScore);return false;}
if(!IsValidDecimal(intMinScore)){WriteToDebug("ERROR - intMinScore not a valid decimal");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetScore (not a valid decimal), intMinScore="+ intMinScore);return false;}
WriteToDebug("Converting SCORES to floats");intScore=parseFloat(intScore);intMaxScore=parseFloat(intMaxScore);intMinScore=parseFloat(intMinScore);if(intScore&lt;0||intScore&gt;100){WriteToDebug("ERROR - intScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetScore (must be between 0-100), intScore="+ intScore);return false;}
if(intMaxScore&lt;0||intMaxScore&gt;100){WriteToDebug("ERROR - intMaxScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetScore (must be between 0-100), intMaxScore="+ intMaxScore);return false;}
if(intMinScore&lt;0||intMinScore&gt;100){WriteToDebug("ERROR - intMinScore out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetScore (must be between 0-100), intMinScore="+ intMinScore);return false;}
if(SCORE_CAN_ONLY_IMPROVE===true){var previousScore=GetScore();if(previousScore!=null&amp;&amp;previousScore!=""&amp;&amp;previousScore&gt;intScore){WriteToDebug("Previous score was greater than new score, configuration only allows scores to improve, returning.");return true;}}
WriteToDebug("Calling to LMS");return objLMS.SetPointBasedScore(intScore,intMaxScore,intMinScore);}
function CreateResponseIdentifier(strShort,strLong){if(strShort.replace(" ","")==""){WriteToDebug("Short Identifier is empty");SetErrorInfo(ERROR_INVALID_ID,"Invalid short identifier, strShort="+ strShort);return false;}
if(strShort.length!=1){WriteToDebug("ERROR - Short Identifier  not 1 character");SetErrorInfo(ERROR_INVALID_ID,"Invalid short identifier, strShort="+ strShort);return false;}
if(!IsAlphaNumeric(strShort)){WriteToDebug("ERROR - Short Identifier  not alpha numeric");SetErrorInfo(ERROR_INVALID_ID,"Invalid short identifier, strShort="+ strShort);return false;}
strShort=strShort.toLowerCase();strLong=CreateValidIdentifier(strLong);return new ResponseIdentifier(strShort,strLong);}
function ResponseIdentifier(strShort,strLong){this.Short=new String(strShort);this.Long=new String(strLong);this.toString=function(){return"[Response Identifier "+ this.Short+", "+ this.Long+"]";};}
function MatchingResponse(source,target){if(source.constructor==String){source=CreateResponseIdentifier(source,source);}
if(target.constructor==String){target=CreateResponseIdentifier(target,target);}
this.Source=source;this.Target=target;this.toString=function(){return"[Matching Response "+ this.Source+", "+ this.Target+"]";};}
function CreateMatchingResponse(pattern)
{var aryPairs=new Array();var aryEachPair=new Array();pattern=new String(pattern);aryPairs=pattern.split("[,]");for(var i=0;i&lt;aryPairs.length;i++)
{var thisPair=new String(aryPairs[i]);aryEachPair=thisPair.split("[.]");WriteToDebug("Matching Response ["+ i+"]  source: "+ aryEachPair[0]+"  target: "+ aryEachPair[1]);aryPairs[i]=new MatchingResponse(aryEachPair[0],aryEachPair[1]);}
WriteToDebug("pattern: "+ pattern+" becomes "+ aryPairs[0]);if(aryPairs.length==0)return aryPairs[0];else return aryPairs;}
function CreateValidIdentifier(str){str=new String(str);str=Trim(str);if(str.toLowerCase().indexOf("urn:")==0){str=str.substr(4);}
str=str.replace(/[^\w\-\(\)\+\.\:\=\@\;\$\_\!\*\'\%]/g,"_");return str;}
function Trim(str){str=str.replace(/^\s*/,"");str=str.replace(/\s*$/,"");return str;}
function RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordTrueFalseInteraction strID="+ strID+", blnResponse="+ blnResponse+", blnCorrect="+ blnCorrect+", blnCorrectResponse="+ blnCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(blnResponse!=true&amp;&amp;blnResponse!=false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The Response parameter must be a valid boolean value.");return false;}
if(blnCorrectResponse!=null&amp;&amp;blnCorrectResponse!=true&amp;&amp;blnCorrectResponse!=false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The Correct Response parameter must be a valid boolean value or null.");return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordTrueFalseInteraction(strID,blnResponse,blnCorrect,blnCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordMultipleChoiceInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordMultipleChoiceInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strID=new String(strID);var aryResponse;var aryCorrectResponse;if(response.constructor==String){aryResponse=new Array();var responseIdentifier=CreateResponseIdentifier(response,response);if(responseIdentifier==false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
aryResponse[0]=responseIdentifier;}
else if(response.constructor==ResponseIdentifier){aryResponse=new Array();aryResponse[0]=response;}
else if(response.constructor==Array||response.constructor.toString().search("Array")&gt;0){aryResponse=response;}
else if(window.console&amp;&amp;response.constructor.toString()=='(Internal Function)'&amp;&amp;response.length&gt;0){aryResponse=response;}
else{if(window.console){window.console.log("ERROR_INVALID_INTERACTION_RESPONSE :: The response is not in the correct format.");}
SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
if(correctResponse!=null&amp;&amp;correctResponse!=undefined&amp;&amp;correctResponse!=""){if(correctResponse.constructor==String){aryCorrectResponse=new Array();responseIdentifier=CreateResponseIdentifier(correctResponse,correctResponse);if(responseIdentifier==false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The correct response is not in the correct format");return false;}
aryCorrectResponse[0]=responseIdentifier;}
else if(correctResponse.constructor==ResponseIdentifier){aryCorrectResponse=new Array();aryCorrectResponse[0]=correctResponse;}
else if(correctResponse.constructor==Array||correctResponse.constructor.toString().search("Array")&gt;0){aryCorrectResponse=correctResponse;}
else if(window.console&amp;&amp;correctResponse.constructor.toString()=='(Internal Function)'&amp;&amp;correctResponse.length&gt;0){aryCorrectResponse=correctResponse;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The correct response is not in the correct format");return false;}}
else{aryCorrectResponse=new Array();}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordMultipleChoiceInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordFillInInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordFillInInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordMatchingInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordMatchingInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var aryResponse;var aryCorrectResponse;if(response.constructor==MatchingResponse){aryResponse=new Array();aryResponse[0]=response;}
else if(response.constructor==Array||response.constructor.toString().search("Array")&gt;0){aryResponse=response;}
else if(window.console&amp;&amp;response.constructor.toString()=='(Internal Function)'&amp;&amp;response.length&gt;0){aryResponse=response;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
if(correctResponse!=null&amp;&amp;correctResponse!=undefined){if(correctResponse.constructor==MatchingResponse){aryCorrectResponse=new Array();aryCorrectResponse[0]=correctResponse;}
else if(correctResponse.constructor==Array||correctResponse.constructor.toString().search("Array")&gt;0){aryCorrectResponse=correctResponse;}
else if(window.console&amp;&amp;correctResponse.constructor.toString()=='(Internal Function)'&amp;&amp;correctResponse.length&gt;0){aryCorrectResponse=correctResponse;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}}
else{aryCorrectResponse=new Array();}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordMatchingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordPerformanceInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordPerformanceInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordSequencingInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordSequencingInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var aryResponse;var aryCorrectResponse;if(response.constructor==String){aryResponse=new Array();var responseIdentifier=CreateResponseIdentifier(response,response);if(responseIdentifier==false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
aryResponse[0]=responseIdentifier;}
else if(response.constructor==ResponseIdentifier){aryResponse=new Array();aryResponse[0]=response;}
else if(response.constructor==Array||response.constructor.toString().search("Array")&gt;0){aryResponse=response;}
else if(window.console&amp;&amp;response.constructor.toString()=='(Internal Function)'&amp;&amp;response.length&gt;0){aryResponse=response;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
if(correctResponse!=null&amp;&amp;correctResponse!=undefined&amp;&amp;correctResponse!=""){if(correctResponse.constructor==String){aryCorrectResponse=new Array();responseIdentifier=CreateResponseIdentifier(correctResponse,correctResponse);if(responseIdentifier==false){SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The correct response is not in the correct format");return false;}
aryCorrectResponse[0]=responseIdentifier;}
else if(correctResponse.constructor==ResponseIdentifier){aryCorrectResponse=new Array();aryCorrectResponse[0]=correctResponse;}
else if(correctResponse.constructor==Array||correctResponse.constructor.toString().search("Array")&gt;0){aryCorrectResponse=correctResponse;}
else if(window.console&amp;&amp;correctResponse.constructor.toString()=='(Internal Function)'&amp;&amp;correctResponse.length&gt;0){aryCorrectResponse=correctResponse;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The correct response is not in the correct format");return false;}}
else{aryCorrectResponse=new Array();}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordSequencingInteraction(strID,aryResponse,blnCorrect,aryCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordLikertInteraction(strID,response,blnCorrect,correctResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordLikertInteraction strID="+ strID+", response="+ response+", blnCorrect="+ blnCorrect+", correctResponse="+ correctResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
var riResponse;var riCorrectResponse;if(response.constructor==String){riResponse=CreateResponseIdentifier(response,response);}
else if(response.constructor==ResponseIdentifier){riResponse=response;}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
if(correctResponse==null||correctResponse==undefined){riCorrectResponse=null;}
else if(correctResponse.constructor==ResponseIdentifier){riCorrectResponse=correctResponse;}
else if(correctResponse.constructor==String){riCorrectResponse=CreateResponseIdentifier(correctResponse,correctResponse);}
else{SetErrorInfo(ERROR_INVALID_INTERACTION_RESPONSE,"The response is not in the correct format");return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordLikertInteraction(strID,riResponse,blnCorrect,riCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID){WriteToDebug("In RecordNumericInteraction strID="+ strID+", strResponse="+ strResponse+", blnCorrect="+ blnCorrect+", strCorrectResponse="+ strCorrectResponse+", strDescription="+ strDescription+", intWeighting="+ intWeighting+", intLatency="+ intLatency+", strLearningObjectiveID="+ strLearningObjectiveID);if(!(typeof(DO_NOT_REPORT_INTERACTIONS)=="undefined")&amp;&amp;DO_NOT_REPORT_INTERACTIONS===true){WriteToDebug("Configuration specifies interactions should not be reported, exiting.");return true;}
ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
if(!IsValidDecimal(strResponse)){WriteToDebug("ERROR - Invalid Response, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Response passed to RecordNumericInteraction (not a valid decimal), strResponse="+ strResponse);return false;}
if(strCorrectResponse!=undefined&amp;&amp;strCorrectResponse!=null&amp;&amp;IsValidDecimal(strCorrectResponse)==false){WriteToDebug("ERROR - Invalid Correct Response, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Correct Response passed to RecordNumericInteraction (not a valid decimal), strCorrectResponse="+ strCorrectResponse);return false;}
var dtmTime=new Date();WriteToDebug("Calling to LMS");return objLMS.RecordNumericInteraction(strID,strResponse,blnCorrect,strCorrectResponse,strDescription,intWeighting,intLatency,strLearningObjectiveID,dtmTime);}
function GetStatus(){WriteToDebug("In GetStatus");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return LESSON_STATUS_INCOMPLETE;}
return objLMS.GetStatus();}
function ResetStatus(){WriteToDebug("In ResetStatus");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
WriteToDebug("Setting blnStatusWasSet to false");blnStatusWasSet=false;return objLMS.ResetStatus();}
function GetProgressMeasure(){WriteToDebug("In GetProgressMeasure");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return LESSON_STATUS_INCOMPLETE;}
return objLMS.GetProgressMeasure();}
function SetProgressMeasure(numMeasure){WriteToDebug("In SetProgressMeasure, passing in: "+ numMeasure);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return LESSON_STATUS_INCOMPLETE;}
return objLMS.SetProgressMeasure(numMeasure);}
function SetPassed(){WriteToDebug("In SetPassed");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
WriteToDebug("Setting blnStatusWasSet to true");blnStatusWasSet=true;return objLMS.SetPassed();}
function SetFailed(){WriteToDebug("In SetFailed");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
WriteToDebug("Setting blnStatusWasSet to true");blnStatusWasSet=true;return objLMS.SetFailed();}
function GetEntryMode(){WriteToDebug("In GetEntryMode");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return ENTRY_FIRST_TIME;}
return objLMS.GetEntryMode();}
function GetLessonMode(){WriteToDebug("In GetLessonMode");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return MODE_NORMAL;}
return objLMS.GetLessonMode();}
function GetTakingForCredit(){WriteToDebug("In GetTakingForCredit");ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetTakingForCredit();}
function SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore){WriteToDebug("In SetObjectiveScore, intObjectiveID="+ strObjectiveID+", intScore="+ intScore+", intMaxScore="+ intMaxScore+", intMinScore="+ intMinScore);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strObjectiveID=new String(strObjectiveID);if(strObjectiveID.replace(" ","")==""){WriteToDebug("ERROR - Invalid ObjectiveID, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid ObjectiveID passed to SetObjectiveScore (must have a value), strObjectiveID="+ strObjectiveID);return false;}
if(!IsValidDecimal(intScore)){WriteToDebug("ERROR - Invalid Score, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetObjectiveScore (not a valid decimal), intScore="+ intScore);return false;}
if(!IsValidDecimal(intMaxScore)){WriteToDebug("ERROR - Invalid Max Score, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetObjectiveScore (not a valid decimal), intMaxScore="+ intMaxScore);return false;}
if(!IsValidDecimal(intMinScore)){WriteToDebug("ERROR - Invalid Min Score, not a valid decmial");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetObjectiveScore (not a valid decimal), intMinScore="+ intMinScore);return false;}
WriteToDebug("Converting Scores to floats");intScore=parseFloat(intScore);intMaxScore=parseFloat(intMaxScore);intMinScore=parseFloat(intMinScore);if(intScore&lt;0||intScore&gt;100){WriteToDebug("ERROR - Invalid Score, out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Score passed to SetObjectiveScore (must be between 0-100), intScore="+ intScore);return false;}
if(intMaxScore&lt;0||intMaxScore&gt;100){WriteToDebug("ERROR - Invalid Max Score, out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Score passed to SetObjectiveScore (must be between 0-100), intMaxScore="+ intMaxScore);return false;}
if(intMinScore&lt;0||intMinScore&gt;100){WriteToDebug("ERROR - Invalid Min Score, out of range");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Score passed to SetObjectiveScore (must be between 0-100), intMinScore="+ intMinScore);return false;}
WriteToDebug("Calling To LMS");return objLMS.SetObjectiveScore(strObjectiveID,intScore,intMaxScore,intMinScore);}
function SetObjectiveStatus(strObjectiveID,Lesson_Status){WriteToDebug("In SetObjectiveStatus strObjectiveID="+ strObjectiveID+", Lesson_Status="+ Lesson_Status);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strObjectiveID=new String(strObjectiveID);if(strObjectiveID.replace(" ","")==""){WriteToDebug("ERROR - Invalid ObjectiveID, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid ObjectiveID passed to SetObjectiveStatus (must have a value), strObjectiveID="+ strObjectiveID);return false;}
if((Lesson_Status!=LESSON_STATUS_PASSED)&amp;&amp;(Lesson_Status!=LESSON_STATUS_COMPLETED)&amp;&amp;(Lesson_Status!=LESSON_STATUS_FAILED)&amp;&amp;(Lesson_Status!=LESSON_STATUS_INCOMPLETE)&amp;&amp;(Lesson_Status!=LESSON_STATUS_BROWSED)&amp;&amp;(Lesson_Status!=LESSON_STATUS_NOT_ATTEMPTED)){WriteToDebug("ERROR - Invalid Status");SetErrorInfo(ERROR_INVALID_STATUS,"Invalid status passed to SetObjectiveStatus, Lesson_Status="+ Lesson_Status);return false;}
WriteToDebug("Calling To LMS");return objLMS.SetObjectiveStatus(strObjectiveID,Lesson_Status);}
function GetObjectiveStatus(strObjectiveID){WriteToDebug("In GetObjectiveStatus, strObjectiveID="+ strObjectiveID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetObjectiveStatus(strObjectiveID);}
function SetObjectiveDescription(strObjectiveID,strObjectiveDescription){WriteToDebug("In SetObjectiveDescription strObjectiveID="+ strObjectiveID+", strObjectiveDescription="+ strObjectiveDescription);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strObjectiveID=new String(strObjectiveID);if(strObjectiveID.replace(" ","")==""){WriteToDebug("ERROR - Invalid ObjectiveID, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid ObjectiveID passed to SetObjectiveStatus (must have a value), strObjectiveID="+ strObjectiveID);return false;}
WriteToDebug("Calling To LMS");return objLMS.SetObjectiveDescription(strObjectiveID,strObjectiveDescription);}
function GetObjectiveDescription(strObjectiveID){WriteToDebug("In GetObjectiveDescription, strObjectiveID="+ strObjectiveID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetObjectiveDescription(strObjectiveID);}
function GetObjectiveScore(strObjectiveID){WriteToDebug("In GetObjectiveScore, strObjectiveID="+ strObjectiveID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetObjectiveScore(strObjectiveID);}
function IsLmsPresent(){return blnLmsPresent;}
function SetObjectiveProgressMeasure(strObjectiveID,strObjectiveProgressMeasure){WriteToDebug("In SetObjectiveProgressMeasure strObjectiveID="+ strObjectiveID+", strObjectiveProgressMeasure="+ strObjectiveProgressMeasure);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strObjectiveID=new String(strObjectiveID);if(strObjectiveID.replace(" ","")==""){WriteToDebug("ERROR - Invalid ObjectiveID, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid ObjectiveID passed to SetObjectiveProgressMeasure (must have a value), strObjectiveID="+ strObjectiveID);return false;}
WriteToDebug("Calling To LMS");return objLMS.SetObjectiveProgressMeasure(strObjectiveID,strObjectiveProgressMeasure);}
function GetObjectiveProgressMeasure(strObjectiveID){WriteToDebug("In GetObjectiveProgressMeasure, strObjectiveID="+ strObjectiveID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetObjectiveProgressMeasure(strObjectiveID);}
function GetInteractionType(strInteractionID)
{WriteToDebug("In GetInteractionType, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionType(strInteractionID);}
function GetInteractionTimestamp(strInteractionID)
{WriteToDebug("In GetInteractionTimestamp, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionTimestamp(strInteractionID);}
function GetInteractionCorrectResponses(strInteractionID)
{WriteToDebug("In GetInteractionCorrectResponses, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionCorrectResponses(strInteractionID);}
function GetInteractionWeighting(strInteractionID)
{WriteToDebug("In GetInteractionWeighting, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionWeighting(strInteractionID);}
function GetInteractionLearnerResponses(strInteractionID)
{WriteToDebug("In GetInteractionLearnerResponses, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionLearnerResponses(strInteractionID);}
function GetInteractionResult(strInteractionID)
{WriteToDebug("In GetInteractionResult, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionResult(strInteractionID);}
function GetInteractionLatency(strInteractionID)
{WriteToDebug("In GetInteractionLatency, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionLatency(strInteractionID);}
function GetInteractionDescription(strInteractionID)
{WriteToDebug("In GetInteractionDescription, strInteractionID="+ strInteractionID);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
return objLMS.GetInteractionDescription(strInteractionID);}
function CreateDataBucket(strBucketId,intMinSize,intMaxSize){WriteToDebug("In CreateDataBucket, strBucketId="+ strBucketId+", intMinSize="+ intMinSize+", intMaxSize="+ intMaxSize);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strBucketId=new String(strBucketId);if(strBucketId.replace(" ","")==""){WriteToDebug("ERROR - Invalid BucketId, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid strBucketId passed to CreateDataBucket (must have a value), strBucketId="+ strBucketId);return false;}
if(!ValidInteger(intMinSize)){WriteToDebug("ERROR Invalid Min Size, not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid intMinSize passed to CreateDataBucket (not an integer), intMinSize="+ intMinSize);return false;}
if(!ValidInteger(intMaxSize)){WriteToDebug("ERROR Invalid Max Size, not an integer");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid intMaxSize passed to CreateDataBucket (not an integer), intMaxSize="+ intMaxSize);return false;}
intMinSize=parseInt(intMinSize,10);intMaxSize=parseInt(intMaxSize,10);if(intMinSize&lt;0){WriteToDebug("ERROR Invalid Min Size, must be greater than or equal to 0");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Min Size passed to CreateDataBucket (must be greater than or equal to 0), intMinSize="+ intMinSize);return false;}
if(intMaxSize&lt;=0){WriteToDebug("ERROR Invalid Max Size, must be greater than 0");SetErrorInfo(ERROR_INVALID_NUMBER,"Invalid Max Size passed to CreateDataBucket (must be greater than 0), intMaxSize="+ intMaxSize);return false;}
intMinSize=(intMinSize*2);intMaxSize=(intMaxSize*2);return objLMS.CreateDataBucket(strBucketId,intMinSize,intMaxSize);}
function GetDataFromBucket(strBucketId){WriteToDebug("In GetDataFromBucket, strBucketId="+ strBucketId);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strBucketId=new String(strBucketId);if(strBucketId.replace(" ","")==""){WriteToDebug("ERROR - Invalid BucketId, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid strBucketId passed to GetDataFromBucket (must have a value), strBucketId="+ strBucketId);return false;}
return objLMS.GetDataFromBucket(strBucketId);}
function PutDataInBucket(strBucketId,strData,blnAppendToEnd){WriteToDebug("In PutDataInBucket, strBucketId="+ strBucketId+", blnAppendToEnd="+ blnAppendToEnd+", strData="+ strData);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strBucketId=new String(strBucketId);if(strBucketId.replace(" ","")==""){WriteToDebug("ERROR - Invalid BucketId, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid strBucketId passed to PutDataInBucket (must have a value), strBucketId="+ strBucketId);return false;}
if(blnAppendToEnd!=true){WriteToDebug("blnAppendToEnd was not explicitly true so setting it to false, blnAppendToEnd="+ blnAppendToEnd);blnAppendToEnd=false;}
return objLMS.PutDataInBucket(strBucketId,strData,blnAppendToEnd);}
function DetectSSPSupport(){return objLMS.DetectSSPSupport();}
function GetBucketInfo(strBucketId){WriteToDebug("In GetBucketInfo, strBucketId="+ strBucketId);ClearErrorInfo();if(!IsLoaded()){SetErrorInfo(ERROR_NOT_LOADED,"Cannot make calls to the LMS before calling Start");return false;}
strBucketId=new String(strBucketId);if(strBucketId.replace(" ","")==""){WriteToDebug("ERROR - Invalid BucketId, empty string");SetErrorInfo(ERROR_INVALID_ID,"Invalid strBucketId passed to GetBucketInfo (must have a value), strBucketId="+ strBucketId);return false;}
var bucketInfo=objLMS.GetBucketInfo(strBucketId);bucketInfo.TotalSpace=(bucketInfo.TotalSpace/2);bucketInfo.UsedSpace=(bucketInfo.UsedSpace/2);WriteToDebug("GetBucketInfo returning "+ bucketInfo);return bucketInfo;}
function SSPBucketSize(totalSpace,usedSpace){this.TotalSpace=totalSpace;this.UsedSpace=usedSpace;this.toString=function(){return"[SSPBucketSize "+ this.TotalSpace+", "+ this.UsedSpace+"]";};}</text>
				</content>
				<redirectionURL/>
				<headersSize>277</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.746-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/blank.html</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>text/html, application/xhtml+xml, */*</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>370</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>text/html; charset=UTF-8</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="blank.html"</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>728</size>
					<mimeType>text/html; charset=UTF-8</mimeType>
					<text> 
&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
	window.document.onkeypress = CheckForDebugCommand;

	var intQuestionCounter = 0;
	var ASCII_QUESTION = 63;
	
	function CheckForDebugCommand(e){


		var intKeyCode = 0;			
		if (window.event) {
			e = window.event;
			intKeyCode = e.keyCode;
		}
		else  {
			intKeyCode = e.which;
		}

		if (intKeyCode == ASCII_QUESTION){
			intQuestionCounter++;
			if (intQuestionCounter == 3){
				intQuestionCounter = 0;
				
				parent.ShowDebugWindow();
			}
		}
		else if (intKeyCode !=0){		//in FireFox, the shift key comes through as a keypress with code of 0...we want to ignore this
			intQuestionCounter = 0;
		}
	}		
	
	

	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&amp;nbsp;
 
&lt;/body&gt;
&lt;/html&gt;
</text>
				</content>
				<redirectionURL/>
				<headersSize>259</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.777-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/AICCComm.html</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>text/html, application/xhtml+xml, */*</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>373</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>text/html; charset=UTF-8</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="AICCComm.html"</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>21498</size>
					<mimeType>text/html; charset=UTF-8</mimeType>
					<text> 
&lt;html&gt;
&lt;head&gt;
&lt;script language="JavaScript1.2"&gt;
	function WriteToDebug(str){
		window.parent.WriteToDebug("AICCComm - " + str);
	}
	
	function DisplayError(strMessage){
		window.parent.DisplayError(strMessage);
	}
&lt;/script&gt;
 
 
 
&lt;script language="JavaScript" src="browsersniff.js"&gt;&lt;/script&gt;
&lt;script language="JavaScript"&gt;	
	var objXMLHTTP = null;
	var canUseTryCatch = false;
	
	//determine if we can use try/catch statements in the IE browser family
	if (is_ie5up){
		canUseTryCatch = true;
	}
&lt;/script&gt;
&lt;script language="VBScript"&gt;
	on error resume next
	WriteToDebug("Trying to create MSXML2.XMLHTTP in VBScript")
	Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
	if err.number &lt;&gt; 0 then
		'XMLHTTP object could not be created, might be old version of IE
		WriteToDebug("Could not create object, error number=" &amp; err.number &amp; ", source=" &amp; err.Source &amp; ", desc=" &amp; err.Description)
		set objXMLHTTP = null
	end if
&lt;/script&gt;
&lt;script language="JavaScript1.5"&gt;
	//determine if we can use try/catch statemes in non-IE browsers - anything that runs JavaScript 1.5 (includes all FireFox)
	canUseTryCatch = true;
	
	//JS 1.5 is available in the current Gecko browsers that support the XMLHTTPRequest object, 
	//use it for it's exception catching abilities to avoid errors in earlier browser versions
	
	//XMLHTTP object is unreliable in NS 6 but works in 7 and above, so we explicitly exclude NS6
	
	//Netscape 7 is essentailly Mozilla 1, so Mozilla browsers make it into this conditional
	
	WriteToDebug("Trying to create XMLHttpRequest in JavaScript1.5");
	
	if (is_nav6up &amp;&amp; !is_nav6){
		WriteToDebug("Entered browser conditional");
		try{
			WriteToDebug("Creating object");
			objXMLHTTP = new XMLHttpRequest();
		}
		catch (e){
			//XMLHTTP object could not be created
			WriteToDebug("Could not create object, exception=" + e);
			objXMLHTTP = null;
		}
	}
&lt;/script&gt;
&lt;script language="JavaScript" type="text/javascript"&gt;

//---------------------------------------------------------------------
//Real page code beins here
//---------------------------------------------------------------------

//variables to check for the IFrame's load
var intReCheckLoadedInterval = window.parent.AICC_RE_CHECK_LOADED_INTERVAL;
var intReCheckAttemptsBeforeTimeout = window.parent.AICC_RE_CHECK_ATTEMPTS_BEFORE_TIMEOUT;
var intReCheckAttempts = 0;

var IFrameLoaded_TimeOutID = "";
var blnIFrameLoaded = false;

//AICC Data - content will set these variables (through public methods) for submission to the LMS
var strLessonLocation = "";
var strLessonStatus = "i";
var strScore = "";
var strTime = "00:00:00";

//Communication Capabilities of the current browser - we check the actual capabilities 
//rather than specific browsers to ensure forward compatibility and compatibility with untested browsers
var blnCanUseXMLHTTP;		//set in the onload event
var blnCanUseIFrame;
var blnXMLHTTPIsAvailable;		//determines if the browser supports the XmlHttp object

var blnAppearsToBeCrossDomain;

//constants
var REQUEST_TYPE_GET = "GETPARAM";
var REQUEST_TYPE_PUT = "PUTPARAM";
var REQUEST_TYPE_PUT_INTERACTIONS = "PUTINTERACTIONS";
var REQUEST_TYPE_EXIT = "EXITAU";



WriteToDebug("intReCheckLoadedInterval=" + intReCheckLoadedInterval);
WriteToDebug("intReCheckAttemptsBeforeTimeout=" + intReCheckAttemptsBeforeTimeout);

//---------------------------------------------------------------------
//Public Functions
//---------------------------------------------------------------------


function MakeGetParamRequest(){
		
	var strAICCSID;
	var strAICCURL;
	
	WriteToDebug ("In MakeGetParamRequest");
	
	strAICCSID = GetAICCSID();
	strAICCURL = GetAICCURL();
	
	WriteToDebug ("Submitting Form");
	
	SubmitForm(strAICCURL, strAICCSID, REQUEST_TYPE_GET, "");
	
}


function MakePutParamRequest(strAICCData){

	var strAICCSID;
	var strAICCURL;
	var strAICCData;
	
	WriteToDebug ("In MakePutParamRequest");
	
	if (parent.blnReviewModeSoReadOnly){
		WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");
		return true;
	}
	
	strAICCSID = GetAICCSID();
	strAICCURL = GetAICCURL();
	
	WriteToDebug ("Submitting Form");
	
	SubmitForm(strAICCURL, strAICCSID, REQUEST_TYPE_PUT, strAICCData);

}


function MakePutInteractionsRequest(strAICCData){

	var strAICCSID;
	var strAICCURL;
	var strAICCData;
	
	WriteToDebug ("In MakePutInteractionsRequest");
	
	if (parent.blnReviewModeSoReadOnly){
		WriteToDebug("Mode is Review and configuration setting dictates this should be read only so exiting.");
		return true;
	}
	
	strAICCSID = GetAICCSID();
	strAICCURL = GetAICCURL();
	
	WriteToDebug ("Submitting Form");
	
	SubmitForm(strAICCURL, strAICCSID, REQUEST_TYPE_PUT_INTERACTIONS, strAICCData);

}

function MakeExitAURequest(){

	var strAICCSID;
	var strAICCURL;
	
	WriteToDebug ("In MakeExitAURequest");
	
	strAICCSID = GetAICCSID();
	strAICCURL = GetAICCURL();
		
	WriteToDebug ("Submitting Form");
	
	SubmitForm(strAICCURL, strAICCSID, REQUEST_TYPE_EXIT, "");
	
}






//---------------------------------------------------------------------
//Private Functions
//---------------------------------------------------------------------


//---------------------------------------------------------------------
//IFrame Functions
//---------------------------------------------------------------------


function CheckIFrameLoaded(strRequestType){
	
	WriteToDebug("In CheckIFrameLoaded strRequestType=" + strRequestType);
	
	if (blnIFrameLoaded){
		
		WriteToDebug("Frame Loaded");
		
		ProcessLMSResult(strRequestType, GetIFrameContents());
		
	}
	else{
		//re-call, check for time out
		
		WriteToDebug("Frame Not Loaded");
		
		intReCheckAttempts ++;
		
		if (intReCheckAttempts &gt; intReCheckAttemptsBeforeTimeout){
			
			WriteToDebug("Frame Timeout Error");
			
			parent.InitializeExecuted(false, "The LMS timed out while responding to an AICC request.");
		}
		else{
			WriteToDebug("Resetting CheckIFrameLoaded");
			IFrameLoaded_TimeOutID = window.setTimeout("CheckIFrameLoaded('" + strRequestType + "')", intReCheckLoadedInterval);
		}	
		
	}
}


function IFrameLoaded(){
	
	WriteToDebug(" IFrameLoaded ");
	
	blnIFrameLoaded = true;

}


function GetIFrameContents(){
	
	var strContents;
	
	WriteToDebug("In GetIFrameContents");
	
	if (canUseTryCatch == true){
	
		try{
			strContents = window.AICCFrame.document.body.innerHTML;
		}
		catch (e){
			WriteToDebug("Error submitting form via IFrame, falling back to normal form post and returning ''. Error=" + ((e.message)?e.message:e.toString()) );
			blnCanUseIFrame = false;
			strContents = "";
		}
	}
	else{
		strContents = window.AICCFrame.document.body.innerHTML;
	}
	
	WriteToDebug("strContents=" + strContents);
	
	return strContents;
}


function SubmitFormUsingIFrame(strAICCURL, strAICCSID, strRequestType, strAICCData){
	
	WriteToDebug ("In SubmitFormUsingIFrame, setting fields");

	document.frmAICC.action = strAICCURL;
	document.frmAICC.session_id.value = strAICCSID;
	document.frmAICC.command.value = strRequestType;
	document.frmAICC.aicc_data.value = strAICCData;
	
	WriteToDebug ("Submitting Form");
	
	document.frmAICC.submit();

	blnIFrameLoaded = false;
	intReCheckAttempts = 0;
	
	WriteToDebug ("Clearing Timeout");
	
	if (IFrameLoaded_TimeOutID != ""){
		window.clearTimeout(IFrameLoaded_TimeOutID);
		IFrameLoaded_TimeOutID = "";
	}
	
	CheckIFrameLoaded(strRequestType);
}


//---------------------------------------------------------------------
//XML HTTP Object Functions
//---------------------------------------------------------------------
function SubmitFormUsingXMLHTTP(strAICCURL, strAICCSID, strRequestType, strAICCData){
	
	var strReturn;
	var strPostData;
	
	WriteToDebug ("In SubmitFormUsingXMLHTTP, opening connetion");

	objXMLHTTP.open ("POST", strAICCURL, false);
	
	WriteToDebug ("Setting Request Header");

	objXMLHTTP.setRequestHeader ("Content-Type", "application/x-www-form-urlencoded");
	
	WriteToDebug ("Creating Post Data");
		
	strPostData = "session_id=" + URLEncode(strAICCSID) + 
				  "&amp;version=3.5" + 
				  "&amp;command=" + URLEncode(strRequestType) +
				  "&amp;aicc_data=" + URLEncode(strAICCData);
	
	WriteToDebug ("Sending Post Data-" + strPostData);
	
	objXMLHTTP.send (strPostData);
	
	WriteToDebug ("Looking up Response Text");
						
	strReturn = objXMLHTTP.responseText;

	WriteToDebug ("LMS Response=" + strReturn);
	
	ProcessLMSResult(strRequestType, strReturn);
}


function URLEncode(str){
	
	str = new String(str);
	
	str = escape(str);
	str = str.replace(/%20/g, "+");
	
	return str;
}

function GetBlankHtmlPage(seed){

	objXMLHTTP.open("GET", "blank.html?random=" + seed + (Math.random()), false);
	objXMLHTTP.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
	objXMLHTTP.send ();

	return objXMLHTTP.responseText;
}

//---------------------------------------------------------------------
//Blind Form Submit Functions
//---------------------------------------------------------------------

function SubmitFormNormally(strAICCURL, strAICCSID, strRequestType, strAICCData){

	WriteToDebug ("In SubmitFormNormally, setting fields");
	
	document.frmAICC.target = "rusticisoftware_aicc_results";		//keep this name fairly unique to avoid a potential naming conflict with LMS frames
	
	document.frmAICC.action = strAICCURL;
	document.frmAICC.session_id.value = strAICCSID;
	document.frmAICC.command.value = strRequestType;
	document.frmAICC.aicc_data.value = strAICCData;
	
	WriteToDebug ("Submitting Form");
	
	document.frmAICC.submit();
	
	ProcessLMSResult(strRequestType, "");
}



//---------------------------------------------------------------------
//Form Submission Functions
//---------------------------------------------------------------------


function DetectPreferredCommMethod(){
	
	//if we have an XMLHTTP object, use that
	//else, if we can see the IFrame, use that
	//else - use a blind (write only) form submit
	
	/*
	MR 5/30/07 - Don't do any hard and fast domain checking, we'll simply try the post in a try/catch and check for
	a permission denied error. If the post does not succeed, we'll fall back on a normal form post.
	The rules for cross domain scripting have gotten quite complicated recently, they now relate to 
	how the XmlHttp object was created, the browser type/version and the security context of each site.
	*/
	
	//if the domain of the strAICCURL does not match the current domain, then note that cross domain probably won't work
	
	blnAppearsToBeCrossDomain = false;
	
	var strContentDomain = window.document.domain;
	var strAICCURL = GetAICCURL();

	var aryUrlParts = strAICCURL.split("/");
	var strLmsDomain;
	
	var blnCrossDomain = false;
	
	if (strAICCURL.toLowerCase().indexOf("http://") == 0 || strAICCURL.toLowerCase().indexOf("https://") == 0){
		strLmsDomain = aryUrlParts[2]
	}
	else{
		strLmsDomain = aryUrlParts[0];
	}	
	
	if (strLmsDomain.toLowerCase() != strContentDomain.toLowerCase()){
		//WriteToDebug("LMS and Content Domains don't match, falling back to write-only mode using form submit. strLmsDomain=" + strLmsDomain + ", strContentDomain=" + strContentDomain);
		//blnCanUseXMLHTTP = false;
		//blnCanUseIFrame = false;
		//blnCrossDomain = true;
		
		blnAppearsToBeCrossDomain = true;
	}
	
	
	if (objXMLHTTP != null){
		blnXMLHTTPIsAvailable = true;
	}
	else{
		blnXMLHTTPIsAvailable = false;
	}	
	
	//if (!blnCrossDomain)
	//{
		if (parent.AICC_COMM_DISABLE_XMLHTTP)
		{
			WriteToDebug("In DetectPreferredCommMethod, config override of XMLHTTP to false");
			blnCanUseXMLHTTP = false;
		}
		else
		{
			WriteToDebug("In DetectPreferredCommMethod, checking XMLHTTP");
			if (objXMLHTTP != null){
				blnCanUseXMLHTTP = true;
			}
			else{
				blnCanUseXMLHTTP = false;
			}	
		}
		
		if (parent.AICC_COMM_DISABLE_IFRAME)
		{
			WriteToDebug("In DetectPreferredCommMethod, config override of IFRAME to false");
			blnCanUseIFrame = false;
		}
		else
		{
			//note use of short circuit AND to prevent error if browser doesn't recognize part of the IFrame
			//in Opera 7, there needs to be something in the body of the IFrame for the last condition to evaluate to true
			//in opera 7.1, all tests will pass, but the onload event doesn not fire due to a bug, add a check for blnIFrameLoaded
			//to ensure that the onload event fired
			WriteToDebug("Checking IFrame");
			if (window.AICCFrame &amp;&amp; 
				window.AICCFrame.document &amp;&amp; 
				window.AICCFrame.document.body &amp;&amp; 
				window.AICCFrame.document.body.innerHTML &amp;&amp;
				blnIFrameLoaded){	
				blnCanUseIFrame = true;
			}
			else{
				blnCanUseIFrame = false;
			}	
		}	
	//}
	
	WriteToDebug("blnCanUseXMLHTTP=" + blnCanUseXMLHTTP);
	WriteToDebug("blnCanUseIFrame=" + blnCanUseIFrame);
}



function SubmitForm(strAICCURL, strAICCSID, strRequestType, strAICCData){
	
	WriteToDebug ("In SubmitForm, setting fields");
	WriteToDebug ("strAICCURL = " + strAICCURL);
	WriteToDebug ("strAICCSID = " + strAICCSID);
	WriteToDebug ("strCommand = " + strRequestType);
	WriteToDebug ("strAICCData = " + strAICCData);
	WriteToDebug ("blnCanUseXMLHTTP = " + blnCanUseXMLHTTP);
	WriteToDebug ("blnCanUseIFrame = " + blnCanUseIFrame);
	WriteToDebug ("canUseTryCatch = " + canUseTryCatch);
	
	if (blnCanUseXMLHTTP){
		
		// try/catch is supported in all browsers that support xmlHttp
		try{
			SubmitFormUsingXMLHTTP(strAICCURL, strAICCSID, strRequestType, strAICCData);
		}
		catch(e){
			
			//we have a cross domain issue, so fall back on normal form posts
			WriteToDebug("Error submitting form via XmlHttp, falling back to normal form post. Error=" + ((e.message)?e.message:e.toString()));
			
			blnCanUseXMLHTTP = false;
			blnCanUseIFrame = false;
			SubmitForm(strAICCURL, strAICCSID, strRequestType, strAICCData);
			
		}
	}
	else if(blnCanUseIFrame){
		
		//if we're in a browser that can trap errors, try to trap a permission denied error
		//otherwise, check our rudimentry domain checking to see if we should try iFrame. If it is
		//a disallowed cross domain request that results in a permission denied error
		//then we need to manually disable the iFrame post in the configuration file.
		if (canUseTryCatch == true){
			//this try catch probably won't fire, it will be the one up in GetIFrameContents, 
			//in there we just set things to fall back on normal form posts
			//no need to re-submit the form because it was just the initial Get that won't return data anyway
			try{	
				SubmitFormUsingIFrame(strAICCURL, strAICCSID, strRequestType, strAICCData);
			}
			catch (e){
				//we have a cross domain issue, so fall back on normal form posts
				WriteToDebug("Error submitting form via IFrame, falling back to normal form post. Error=" + ((e.message)?e.message:e.toString()));

				blnCanUseIFrame = false;
				SubmitForm(strAICCURL, strAICCSID, strRequestType, strAICCData);
			}
		}
		else{
			if (blnAppearsToBeCrossDomain == false){
				SubmitFormUsingIFrame(strAICCURL, strAICCSID, strRequestType, strAICCData);
			}
			else{
				blnCanUseIFrame = false;
				SubmitForm(strAICCURL, strAICCSID, strRequestType, strAICCData);
			}
		}
	}
	else{
		SubmitFormNormally(strAICCURL, strAICCSID, strRequestType, strAICCData);
	}
	
}



//---------------------------------------------------------------------
//AICC Functions
//---------------------------------------------------------------------

function ProcessLMSResult(strRequestType, strLMSResult){
	
	WriteToDebug("In ProcessLMSResult, strRequestType=" + strRequestType + " strLMSResult=" + strLMSResult)
	
	var blnMadeBlindSubmit;
	
	var strAICCErrorLine = "";
	var strAICCErrorTextLine = "";
	
	var aryAICCResponseLines;
	var strLine;
	var strTrimmedLine;
	
	var intPos;
	
	var blnError;
	var strErrorMessage;
	
	//if we made a blind submit with a standard form, we can't read the result, so just proceed
	blnMadeBlindSubmit = (!blnCanUseXMLHTTP &amp;&amp; !blnCanUseIFrame);
	
	WriteToDebug("blnMadeBlindSubmit=" + blnMadeBlindSubmit);
	
	
	strLMSResult = new String(unescape(strLMSResult));
	aryAICCResponseLines = strLMSResult.split("\n");	//only use \n instead of \r\n b/c some LMS's will only use one character
	
	for (var i=0; i &lt; aryAICCResponseLines.length; i++){
		
		WriteToDebug("Processing Line #" + i + ": " + aryAICCResponseLines[i]);
		
		strLine = aryAICCResponseLines[i];
		
		strLine = strLine.replace(/\r/g, "");
		
		strTrimmedLine = parent.Trim(strLine);
		
		//need to look for the text "error" only at the start of the line since the
		//value of the field can conceivably contain the text "error"
		if (strTrimmedLine.toLowerCase().indexOf("error") == 0){
			if (strTrimmedLine.toLowerCase().indexOf("error_text") == 0){
				WriteToDebug("Found Error Text Line");
				strAICCErrorTextLine = strLine;
			}
			else{
				WriteToDebug("Found Error Number Line");
				strAICCErrorLine = strLine;
			}
		}

	}
	
	
	//check for errors and alert if found, check for AICC error, as well as HTTP error like 404
	blnError = false;
	strErrorMessage = "";
	
	if (!blnMadeBlindSubmit){
	
		if (strAICCErrorLine == ""){
			blnError = true;
			strErrorMessage = "ERROR - LMS did not return a valid status code.";
		}
		
		if (strAICCErrorLine != "" &amp;&amp; strAICCErrorLine.toLowerCase().search(/error\s*=\s*0/) == -1){
			blnError = true;
			strErrorMessage = "ERROR - LMS returned an error - " + strAICCErrorLine + " - " + strAICCErrorTextLine;			
		}
	}
	
	if (blnError){
		WriteToDebug("Found Error");
		parent.AICC_SetErrorInfo(strAICCErrorLine, strAICCErrorTextLine);
		
		if (strRequestType == REQUEST_TYPE_GET){
			parent.InitializeExecuted(false, strErrorMessage);
			return;		
		}
		if (strRequestType == REQUEST_TYPE_PUT){
			parent.AICC_PutParamFailed();
			return;		
		}
		if (strRequestType == REQUEST_TYPE_PUT_INTERACTIONS){
			parent.AICC_PutInteractionsFailed();
			return;				
		}
		else{
			DisplayError(strErrorMessage);
			return;
		}
	}
	
	if (strRequestType == REQUEST_TYPE_GET){
		
		WriteToDebug("In request type = get");
		
		//keep default values if we made a blind submit
		if (!blnMadeBlindSubmit){
			window.parent.ParseGetParamData(strLMSResult);
		}
		
		WriteToDebug("Calling InitializeExecuted");
		
		parent.InitializeExecuted(true, "");
	}
	
}



function GetAICCSID(){
	
	var strSID = "";
	
	WriteToDebug("In GetAICCSID");
	
	strSID = window.parent.GetQueryStringValue("AICC_SID", window.parent.document.location.search)
	
	WriteToDebug("GetAICCSID returning: " + strSID);
	
	return strSID;
	
}

function GetAICCURL(){
	
	var strURL = "";
	
	WriteToDebug("In GetAICCURL");
	
	strURL = window.parent.GetQueryStringValue("AICC_URL", window.parent.document.location.search)
	
	WriteToDebug("Querystring value = " + strURL);
	
	if (strURL != null &amp;&amp; strURL.length &gt; 0){
	
		if (window.parent.AICC_COMM_PREPEND_HTTP_IF_MISSING === undefined || 
			window.parent.AICC_COMM_PREPEND_HTTP_IF_MISSING === null || 
			window.parent.AICC_COMM_PREPEND_HTTP_IF_MISSING === true){
			
			WriteToDebug("Checking for presense of 'http://'");
			
			if (strURL.indexOf("http://") &lt; 0 &amp;&amp; strURL.indexOf("https://") &lt; 0){
				WriteToDebug("Prepending 'http://'");
				strURL = "http://" + strURL;
			}
		}
	}
	
	WriteToDebug("GetAICCURL returning: " + strURL);
	
	return strURL;

}

//MR 5/31/05 - added this because this frame is always slightly visible so we have an avenue into the debug information even if the content developer doesn't build one in
window.document.onkeypress = CheckForDebugCommand;

var intQuestionCounter = 0;
var ASCII_QUESTION = 63;

function CheckForDebugCommand(e){

	var intKeyCode = 0;			
	if (window.event) {
		e = window.event;
		intKeyCode = e.keyCode;
	}
	else  {
		intKeyCode = e.which;
	}

	if (intKeyCode == ASCII_QUESTION){
		intQuestionCounter++;
		if (intQuestionCounter == 3){
			intQuestionCounter = 0;
			
			window.parent.ShowDebugWindow();
		}
	}
	else if (intKeyCode !=0){		//in FireFox, the shift key comes through as a keypress with code of 0...we want to ignore this
		intQuestionCounter = 0;
	}
}		

//MR 5/31/05 - added this call in addition to the frameset onunload calls to give us a better chance of getting an AICC EXITAU call in before the frames unload
function ProcessUnload(){
	if (window.parent){
		window.parent.Unload();
	}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="DetectPreferredCommMethod();" onunload="ProcessUnload();" onbeforeunload="ProcessUnload();"&gt;
&lt;iframe id="AICCFrame" name="AICCFrame" style="width:10px; height:10px; border: 0px" src="blank.html" onload="IFrameLoaded();"&gt;&lt;/iframe&gt;
&lt;form name="frmAICC" method="Post" action="blank.html" target="AICCFrame" ID="Form1"&gt;
&lt;input type="hidden" name="session_id" value="" ID="Hidden1"&gt;
&lt;input type="hidden" name="command" value="" ID="Hidden2"&gt;
&lt;input type="hidden" name="version" value="3.5" ID="Hidden3"&gt;
&lt;input type="hidden" name="aicc_data" value="" ID="Hidden4"&gt;
&lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</text>
				</content>
				<redirectionURL/>
				<headersSize>262</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.777-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/browsersniff.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/AICCComm.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>374</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="browsersniff.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var agt=navigator.userAgent.toLowerCase();var is_major=parseInt(navigator.appVersion);var is_minor=parseFloat(navigator.appVersion);var is_nav=((agt.indexOf('mozilla')!=-1)&amp;&amp;(agt.indexOf('spoofer')==-1)&amp;&amp;(agt.indexOf('compatible')==-1)&amp;&amp;(agt.indexOf('opera')==-1)&amp;&amp;(agt.indexOf('webtv')==-1)&amp;&amp;(agt.indexOf('hotjava')==-1));var is_nav2=(is_nav&amp;&amp;(is_major==2));var is_nav3=(is_nav&amp;&amp;(is_major==3));var is_nav4=(is_nav&amp;&amp;(is_major==4));var is_nav4up=(is_nav&amp;&amp;(is_major&gt;=4));var is_navonly=(is_nav&amp;&amp;((agt.indexOf(";nav")!=-1)||(agt.indexOf("; nav")!=-1)));var is_nav6=(is_nav&amp;&amp;(is_major==5)&amp;&amp;(agt.indexOf('rv:0')&gt;-1));var is_nav6up=(is_nav&amp;&amp;(is_major&gt;=5));var is_gecko=(agt.indexOf('gecko')!=-1);var is_ie=((agt.indexOf("msie")!=-1)&amp;&amp;(agt.indexOf("opera")==-1));var is_ie3=(is_ie&amp;&amp;(is_major&lt;4));var is_ie4=(is_ie&amp;&amp;(is_major==4)&amp;&amp;(agt.indexOf("msie 4")!=-1));var is_ie4up=(is_ie&amp;&amp;(is_major&gt;=4));var is_ie5=(is_ie&amp;&amp;(is_major==4)&amp;&amp;(agt.indexOf("msie 5.0")!=-1));var is_ie5_5=(is_ie&amp;&amp;(is_major==4)&amp;&amp;(agt.indexOf("msie 5.5")!=-1));var is_ie5up=(is_ie&amp;&amp;!is_ie3&amp;&amp;!is_ie4);var is_ie5_5up=(is_ie&amp;&amp;!is_ie3&amp;&amp;!is_ie4&amp;&amp;!is_ie5);var is_ie6=(is_ie&amp;&amp;(is_major==4)&amp;&amp;(agt.indexOf("msie 6.")!=-1));var is_ie6up=(is_ie&amp;&amp;!is_ie3&amp;&amp;!is_ie4&amp;&amp;!is_ie5&amp;&amp;!is_ie5_5);var is_aol=(agt.indexOf("aol")!=-1);var is_aol3=(is_aol&amp;&amp;is_ie3);var is_aol4=(is_aol&amp;&amp;is_ie4);var is_aol5=(agt.indexOf("aol 5")!=-1);var is_aol6=(agt.indexOf("aol 6")!=-1);var is_opera=(agt.indexOf("opera")!=-1);var is_opera2=(agt.indexOf("opera 2")!=-1||agt.indexOf("opera/2")!=-1);var is_opera3=(agt.indexOf("opera 3")!=-1||agt.indexOf("opera/3")!=-1);var is_opera4=(agt.indexOf("opera 4")!=-1||agt.indexOf("opera/4")!=-1);var is_opera5=(agt.indexOf("opera 5")!=-1||agt.indexOf("opera/5")!=-1);var is_opera5up=(is_opera&amp;&amp;!is_opera2&amp;&amp;!is_opera3&amp;&amp;!is_opera4);var is_webtv=(agt.indexOf("webtv")!=-1);var is_TVNavigator=((agt.indexOf("navio")!=-1)||(agt.indexOf("navio_aoltv")!=-1));var is_AOLTV=is_TVNavigator;var is_hotjava=(agt.indexOf("hotjava")!=-1);var is_hotjava3=(is_hotjava&amp;&amp;(is_major==3));var is_hotjava3up=(is_hotjava&amp;&amp;(is_major&gt;=3));var is_js;if(is_nav2||is_ie3)is_js=1.0;else if(is_nav3)is_js=1.1;else if(is_opera5up)is_js=1.3;else if(is_opera)is_js=1.1;else if((is_nav4&amp;&amp;(is_minor&lt;=4.05))||is_ie4)is_js=1.2;else if((is_nav4&amp;&amp;(is_minor&gt;4.05))||is_ie5)is_js=1.3;else if(is_hotjava3up)is_js=1.4;else if(is_nav6||is_gecko)is_js=1.5;else if(is_nav6up)is_js=1.5;else if(is_ie5up)is_js=1.3
else is_js=0.0;var is_win=((agt.indexOf("win")!=-1)||(agt.indexOf("16bit")!=-1));var is_win95=((agt.indexOf("win95")!=-1)||(agt.indexOf("windows 95")!=-1));var is_win16=((agt.indexOf("win16")!=-1)||(agt.indexOf("16bit")!=-1)||(agt.indexOf("windows 3.1")!=-1)||(agt.indexOf("windows 16-bit")!=-1));var is_win31=((agt.indexOf("windows 3.1")!=-1)||(agt.indexOf("win16")!=-1)||(agt.indexOf("windows 16-bit")!=-1));var is_winme=((agt.indexOf("win 9x 4.90")!=-1));var is_win2k=((agt.indexOf("windows nt 5.0")!=-1));var is_win98=((agt.indexOf("win98")!=-1)||(agt.indexOf("windows 98")!=-1));var is_winnt=((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1));var is_win32=(is_win95||is_winnt||is_win98||((is_major&gt;=4)&amp;&amp;(navigator.platform=="Win32"))||(agt.indexOf("win32")!=-1)||(agt.indexOf("32bit")!=-1));var is_os2=((agt.indexOf("os/2")!=-1)||(navigator.appVersion.indexOf("OS/2")!=-1)||(agt.indexOf("ibm-webexplorer")!=-1));var is_mac=(agt.indexOf("mac")!=-1);if(is_mac&amp;&amp;is_ie5up)is_js=1.4;var is_mac68k=(is_mac&amp;&amp;((agt.indexOf("68k")!=-1)||(agt.indexOf("68000")!=-1)));var is_macppc=(is_mac&amp;&amp;((agt.indexOf("ppc")!=-1)||(agt.indexOf("powerpc")!=-1)));var is_sun=(agt.indexOf("sunos")!=-1);var is_sun4=(agt.indexOf("sunos 4")!=-1);var is_sun5=(agt.indexOf("sunos 5")!=-1);var is_suni86=(is_sun&amp;&amp;(agt.indexOf("i86")!=-1));var is_irix=(agt.indexOf("irix")!=-1);var is_irix5=(agt.indexOf("irix 5")!=-1);var is_irix6=((agt.indexOf("irix 6")!=-1)||(agt.indexOf("irix6")!=-1));var is_hpux=(agt.indexOf("hp-ux")!=-1);var is_hpux9=(is_hpux&amp;&amp;(agt.indexOf("09.")!=-1));var is_hpux10=(is_hpux&amp;&amp;(agt.indexOf("10.")!=-1));var is_aix=(agt.indexOf("aix")!=-1);var is_aix1=(agt.indexOf("aix 1")!=-1);var is_aix2=(agt.indexOf("aix 2")!=-1);var is_aix3=(agt.indexOf("aix 3")!=-1);var is_aix4=(agt.indexOf("aix 4")!=-1);var is_linux=(agt.indexOf("inux")!=-1);var is_sco=(agt.indexOf("sco")!=-1)||(agt.indexOf("unix_sv")!=-1);var is_unixware=(agt.indexOf("unix_system_v")!=-1);var is_mpras=(agt.indexOf("ncr")!=-1);var is_reliant=(agt.indexOf("reliantunix")!=-1);var is_dec=((agt.indexOf("dec")!=-1)||(agt.indexOf("osf1")!=-1)||(agt.indexOf("dec_alpha")!=-1)||(agt.indexOf("alphaserver")!=-1)||(agt.indexOf("ultrix")!=-1)||(agt.indexOf("alphastation")!=-1));var is_sinix=(agt.indexOf("sinix")!=-1);var is_freebsd=(agt.indexOf("freebsd")!=-1);var is_bsd=(agt.indexOf("bsd")!=-1);var is_unix=((agt.indexOf("x11")!=-1)||is_sun||is_irix||is_hpux||is_sco||is_unixware||is_mpras||is_reliant||is_dec||is_sinix||is_aix||is_linux||is_bsd||is_freebsd);var is_vms=((agt.indexOf("vax")!=-1)||(agt.indexOf("openvms")!=-1));</text>
				</content>
				<redirectionURL/>
				<headersSize>286</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.808-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/blank.html</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>text/html, application/xhtml+xml, */*</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>370</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>text/html; charset=UTF-8</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="blank.html"</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>728</size>
					<mimeType>text/html; charset=UTF-8</mimeType>
					<text> 
&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
	window.document.onkeypress = CheckForDebugCommand;

	var intQuestionCounter = 0;
	var ASCII_QUESTION = 63;
	
	function CheckForDebugCommand(e){


		var intKeyCode = 0;			
		if (window.event) {
			e = window.event;
			intKeyCode = e.keyCode;
		}
		else  {
			intKeyCode = e.which;
		}

		if (intKeyCode == ASCII_QUESTION){
			intQuestionCounter++;
			if (intQuestionCounter == 3){
				intQuestionCounter = 0;
				
				parent.ShowDebugWindow();
			}
		}
		else if (intKeyCode !=0){		//in FireFox, the shift key comes through as a keypress with code of 0...we want to ignore this
			intQuestionCounter = 0;
		}
	}		
	
	

	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&amp;nbsp;
 
&lt;/body&gt;
&lt;/html&gt;
</text>
				</content>
				<redirectionURL/>
				<headersSize>259</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.839-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/blank.html</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>text/html, application/xhtml+xml, */*</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>370</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>text/html; charset=UTF-8</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="blank.html"</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>728</size>
					<mimeType>text/html; charset=UTF-8</mimeType>
					<text> 
&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
	window.document.onkeypress = CheckForDebugCommand;

	var intQuestionCounter = 0;
	var ASCII_QUESTION = 63;
	
	function CheckForDebugCommand(e){


		var intKeyCode = 0;			
		if (window.event) {
			e = window.event;
			intKeyCode = e.keyCode;
		}
		else  {
			intKeyCode = e.which;
		}

		if (intKeyCode == ASCII_QUESTION){
			intQuestionCounter++;
			if (intQuestionCounter == 3){
				intQuestionCounter = 0;
				
				parent.ShowDebugWindow();
			}
		}
		else if (intKeyCode !=0){		//in FireFox, the shift key comes through as a keypress with code of 0...we want to ignore this
			intQuestionCounter = 0;
		}
	}		
	
	

	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&amp;nbsp;
 
&lt;/body&gt;
&lt;/html&gt;
</text>
				</content>
				<redirectionURL/>
				<headersSize>259</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.886-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/blank.html</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>text/html, application/xhtml+xml, */*</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/AICCComm.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>373</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>text/html; charset=UTF-8</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="blank.html"</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>728</size>
					<mimeType>text/html; charset=UTF-8</mimeType>
					<text> 
&lt;html&gt;
&lt;head&gt;
&lt;script&gt;
	window.document.onkeypress = CheckForDebugCommand;

	var intQuestionCounter = 0;
	var ASCII_QUESTION = 63;
	
	function CheckForDebugCommand(e){


		var intKeyCode = 0;			
		if (window.event) {
			e = window.event;
			intKeyCode = e.keyCode;
		}
		else  {
			intKeyCode = e.which;
		}

		if (intKeyCode == ASCII_QUESTION){
			intQuestionCounter++;
			if (intQuestionCounter == 3){
				intQuestionCounter = 0;
				
				parent.ShowDebugWindow();
			}
		}
		else if (intKeyCode !=0){		//in FireFox, the shift key comes through as a keypress with code of 0...we want to ignore this
			intQuestionCounter = 0;
		}
	}		
	
	

	&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&amp;nbsp;
 
&lt;/body&gt;
&lt;/html&gt;
</text>
				</content>
				<redirectionURL/>
				<headersSize>259</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.917-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story.html</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>text/html, application/xhtml+xml, */*</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/index_lms.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>366</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>text/html; charset=UTF-8</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="story.html"</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>3496</size>
					<mimeType>text/html; charset=UTF-8</mimeType>
					<text>&lt;!DOCTYPE HTML&gt;
&lt;html style="height: 100%;"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8"&gt;
 
 
&lt;title&gt;Defensive Driving&lt;/title&gt;
&lt;style&gt;body{margin:0px;}object{outline:none;}&lt;/style&gt;
&lt;script&gt;
var g_bHtml5Supported = true;
&lt;/script&gt;
&lt;!--[if lte IE 9]&gt;&lt;script&gt;g_bHtml5Supported = false;&lt;/script&gt;&lt;![endif]--&gt;
&lt;script type="text/javascript"&gt;

// Detect min flash version
var g_bMinFlash = false;

if (navigator.plugins["Shockwave Flash"])
{
	var arrDescription = navigator.plugins["Shockwave Flash"].description.split(" ");
	var nVersion = Number(arrDescription[arrDescription.length - 2]);

	g_bMinFlash = (nVersion &gt;= 10) || isNaN(nVersion);
}
else
{
	try 
	{
		var oActiveX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.10");
		if (oActiveX)
		{
			g_bMinFlash = true;
		}
	}
	catch (e) {}
}

var g_bLMS = true;
var g_bWarnOnCommitFail = false;
var g_bUseHtml5 = true &amp;&amp; g_bHtml5Supported;
var g_bUseMobilePlayer = true;
var g_biOS = (navigator.userAgent.indexOf("AppleWebKit/") &gt; -1 &amp;&amp; navigator.userAgent.indexOf("Mobile/") &gt; -1);
var g_biPad = (navigator.userAgent.indexOf("iPad") &gt; -1)

if (g_biOS)
{
	if (g_bUseMobilePlayer &amp;&amp; g_biPad)
	{
		location.replace("ioslaunch.html");
	}
	else if (g_bUseHtml5)
	{
		var strLocation = "story_html5.html";
		
		if (g_bLMS)
		{
			strLocation += "?lms=1";
			
			if (g_bWarnOnCommitFail)
			{
				strLocation += "&amp;warncommit=1";
			}
		}
		
		location.replace(strLocation);	
	}
}
else if (!g_bMinFlash &amp;&amp; g_bUseHtml5)
{
	var strLocation = "story_html5.html";
	
	if (g_bLMS)
	{
		strLocation += "?lms=1";
		
		if (g_bWarnOnCommitFail)
		{
			strLocation += "&amp;warncommit=1";
		}
	}
	
	location.replace(strLocation);	
}

var g_bAOSupport = false;
var g_strContentFolder = "story_content";
var g_bProjector = false;
var g_strSwfFile = "story.swf";
var g_nWidth = 740;
var g_nHeight = 634;
var g_strScale = "show all";	// noscale | show all
var g_strBrowserSize = "default";	// default, fullscreen, optimal
var g_strBgColor = "#FFFFFF";
var g_strAlign = "middle";
var g_strQuality = "best";
var g_bCaptureRC = false;
var g_strFlashVars = "";
var g_bScrollbars = true;
var g_strWMode = "window"; // opaque | window (use "window" for optimal performance, opaque for webobject support)

if (g_strScale == "show all")
{
	g_bScrollbars = false;
}

&lt;/script&gt;
&lt;script LANGUAGE="JavaScript1.2" SRC="story_content/user.js" TYPE="text/javascript"&gt;&lt;/script&gt;
&lt;script src="story_content/story.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body style="height: 100%;" onunload="DoOnClose()" onbeforeunload="DoOnClose()"&gt;
&lt;script type="text/javascript"&gt;

document.bgColor = g_strBgColor;

if (g_bScrollbars)
{
	document.write("&lt;table border=0 cellpadding=0 cellspacing=0 width='100%' height='100%' align=center&gt;");
	document.write("&lt;tr&gt;");
	document.write("&lt;td align=center&gt;");
}

	WriteSwfObject(g_strSwfFile,
		       g_nWidth, 
		       g_nHeight, 
		       g_strScale,
		       g_strAlign, 
		       g_strQuality, 
		       g_strBgColor, 
			   g_bCaptureRC,
			   g_strWMode,
		       g_strFlashVars);

if (g_bScrollbars)
{
	document.write("&lt;/td&gt;");
	document.write("&lt;/tr&gt;");
	document.write("&lt;/table&gt;");
}

ResizeBrowser(g_strBrowserSize);
&lt;/script&gt;
&lt;DIV id='divEmail' style="position: absolute; width: 10; height: 10; left: 10; top: 10; visibility:hidden"&gt;&lt;/DIV&gt;
&lt;DIV id='divWebObjects'&gt;&lt;/DIV&gt;
&lt;/body&gt;
&lt;/html&gt;
</text>
				</content>
				<redirectionURL/>
				<headersSize>259</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.917-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story_content/user.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>369</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="user.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text/>
				</content>
				<redirectionURL/>
				<headersSize>278</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.933-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story_content/story.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>370</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="story.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var IE=((document.all)&amp;&amp;(navigator.appVersion.indexOf("MSIE")!=-1))?true:false;var IE6=((document.all)&amp;&amp;(navigator.appVersion.indexOf("MSIE 6.")!=-1))?true:false;var FF=(navigator.userAgent.indexOf("Firefox")!=-1)?true:false;var Safari3=(navigator.appVersion.indexOf("Safari")&amp;&amp;navigator.appVersion.indexOf("Version/3"));var g_strDelim="|~|";var g_strInteractionDelim="|#|";var g_oContentResults=new ContentResults();var g_listQuizzes=new Object();var g_oPrintOptions=new Object();var g_bLMSPresent=false;if(g_bLMS)
{document.write("&lt;SCR"+"IPT LANGUAGE='JavaScript1.2' SRC='lms/lms.js' TYPE='text/javascript'&gt;&lt;\/SCR"+"IPT&gt;");}
if(g_bAOSupport)
{document.write("&lt;SCR"+"IPT LANGUAGE='JavaScript1.2' SRC='"+ g_strContentFolder+"/AOComm.js' TYPE='text/javascript'&gt;&lt;\/SCR"+"IPT&gt;");}
function WriteSwfObject(strSwfFile,nWidth,nHeight,strScale,strAlign,strQuality,strBgColor,bCaptureRC,strWMode,strFlashVars)
{var strHtml="";if(strScale=="show all")
{nWidth="100%";nHeight="100%";}
if(strFlashVars!="")
{strFlashVars+="&amp;";}
strFlashVars+="vHtmlContainer=true";if(navigator.userAgent.toLowerCase().indexOf("chrome")&gt;=0)
{strWMode="opaque";}
if(bCaptureRC&amp;&amp;strWMode=="window")
{strFlashVars+="&amp;vCaptureRC=true";strWMode="opaque";}
strFlashVars+="&amp;vLMSPresent="+ g_bLMSPresent;strFlashVars+="&amp;vAOSupport="+ g_bAOSupport;if(g_bLMSPresent)
{RetrieveStateData();strFlashVars+="&amp;vResumeData="+ encodeURI(g_strResumeData);}
var strLocProtocol=location.protocol;if(strLocProtocol.indexOf("file")&gt;=0)
{strLocProtocol="http:";}
strHtml+="&lt;div style='width:"+ nWidth+"; height:"+ nHeight+";' id='divSwf'&gt;";strHtml+="&lt;object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='"+ strLocProtocol+"//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0' width='"+ nWidth+"' height='"+ nHeight+"' align='"+ strAlign+"' id='player'&gt;";strHtml+="&lt;param name='scale' value='"+ strScale+"' /&gt;";strHtml+="&lt;param name='movie' value='"+ strSwfFile+"' /&gt;";strHtml+="&lt;param name='quality' value='"+ strQuality+"' /&gt;";strHtml+="&lt;param name='name' value='player' /&gt;";strHtml+="&lt;param name='allowFullScreen' value='true' /&gt;";strHtml+="&lt;param name='bgcolor' value='"+ strBgColor+"' /&gt;";strHtml+="&lt;param name='flashvars' value='"+ strFlashVars+"' /&gt;";strHtml+="&lt;param name='wmode' value='"+ strWMode+"'/&gt;";strHtml+="&lt;param name='AllowScriptAccess' value='always'&gt;";strHtml+="&lt;embed id='eplayer' name='player' allowFullScreen='true' wmode='"+ strWMode+"' src='"+ strSwfFile+"' flashvars='"+ strFlashVars+"' scale='"+ strScale+"' quality='"+ strQuality+"' bgcolor='"+ strBgColor+"' width='"+ nWidth+"' height='"+ nHeight+"' align='"+ strAlign+"' swLiveConnect='true' type='application/x-shockwave-flash' pluginspage='"+ strLocProtocol+"//www.macromedia.com/go/getflashplayer' AllowScriptAccess='always'/&gt;";strHtml+="&lt;/object&gt;";strHtml+="&lt;/div&gt;";document.write(strHtml);if(bCaptureRC)
{AddRightClickListener();}}
function onBWEvent(command,args)
{args=unescape(args);command=String(command);var arrArgs=args.split(g_strDelim);switch(command)
{case"BW_UpdateViewStatus":g_oContentResults.strStatus=arrArgs[0];g_oContentResults.strType=arrArgs[1];break;case"BW_UpdateStatus":g_oContentResults.strStatus=arrArgs[0];g_oContentResults.nScore=arrArgs[1];g_oContentResults.nPassingScore=arrArgs[4];g_oContentResults.strType=arrArgs[5];g_oContentResults.dtmFinished=new Date();break;case"BW_StoreQuestionResult":var strQuizId=arrArgs[0];var strId=arrArgs[1];var strLMSId=arrArgs[2];var strType=arrArgs[3];var strCorrectResponse=arrArgs[4];var strUserResponse=arrArgs[5];var nLatency=arrArgs[6];var strStatus=arrArgs[7];var nPoints=arrArgs[8];var strCompletedTime=arrArgs[9];var nWeight=arrArgs[10];var nQuestionNumber=arrArgs[11];var strDescription=arrArgs[12];var strQuizName=arrArgs[13];var bTracked=(arrArgs[14]=="true");if(g_listQuizzes[strQuizId]==null)
{g_listQuizzes[strQuizId]=new QuizData(strQuizId,strQuizName);}
var oResult=new QuestionResults(strId,strLMSId,strType,strCorrectResponse,strUserResponse,nLatency,strStatus,nPoints,strCompletedTime,nWeight,nQuestionNumber,strDescription,bTracked);g_listQuizzes[strQuizId].AddQuestionResult(oResult);break;case"BW_UpdateQuizResults":var strQuizId=arrArgs[0];var strQuizName=arrArgs[1];var nPassScore=arrArgs[2];var nPassPercent=arrArgs[3];var nScore=arrArgs[4];var nPercentScore=arrArgs[5];if(g_listQuizzes[strQuizId]==null)
{g_listQuizzes[strQuizId]=new QuizData(strQuizId,strQuizName);}
g_listQuizzes[strQuizId].nPassingScore=nPassPercent;g_listQuizzes[strQuizId].nPtScore=nPercentScore;g_listQuizzes[strQuizId].dtmFinished=new Date();break;case"BW_PrintResults":g_oPrintOptions.bShowUserScore=(arrArgs[0]=="true");g_oPrintOptions.bShowPassingScore=(arrArgs[1]=="true");g_oPrintOptions.bShowShowPassFail=(arrArgs[2]=="true");g_oPrintOptions.bShowQuizReview=(arrArgs[3]=="true");g_oPrintOptions.strName=arrArgs[4];g_oPrintOptions.strMainQuizId=arrArgs[5];g_oPrintOptions.arrQuizzes=arrArgs[6].split(",");window.open(GetBasePath()+ g_strContentFolder+"/report.html","Reports")
break;case"BW_EmailResults":EmailResults(arrArgs[0]=="true",arrArgs[1]=="true",arrArgs[2]=="true",arrArgs[3]=="true",arrArgs[4],arrArgs[5],arrArgs[6].split(","));break;case"BW_UpdateWebObjects":UpdateWebObjects(parseInt(arrArgs[0]),parseInt(arrArgs[1]));break;case"BW_OpenWebObject":OpenWebObject(arrArgs[0],arrArgs[1],parseInt(arrArgs[2]),parseInt(arrArgs[3]),parseInt(arrArgs[4]),parseInt(arrArgs[5]),parseInt(arrArgs[6]),parseInt(arrArgs[7]))
break;case"BW_CloseWebObject":CloseWebObject(arrArgs[0]);break;case"BW_MailTo":MailTo(arrArgs[0]);break;case"BW_OpenUrl":OpenUrl(arrArgs[0],arrArgs[1],arrArgs[2],arrArgs[3],arrArgs[4],arrArgs[5],arrArgs[6],arrArgs[7],arrArgs[8],arrArgs[9],arrArgs[10],arrArgs[11]);break;case"BW_CloseAllWebObjects":CloseAllWebObjects(arrArgs[0]);break;case"BW_RestoreWebObjects":RestoreWebObjects();break;case"BW_ExecuteJavascript":ExecuteScript(arrArgs[0]);break;case"BW_OpenSwf":OpenSwfWindow(arrArgs[0],arrArgs[1],arrArgs[2],arrArgs[3],arrArgs[4],arrArgs[5],arrArgs[6],arrArgs[7],arrArgs[8]);break;case"BW_ResizeSwf":ResizeSwf(arrArgs[0],arrArgs[1]);break;case"BW_ClosePlayer":if(!g_bLMS)
{if(FF)
{setTimeout("CloseWindow()",100);}
else
{CloseWindow();}}
break;case"BW_OpenVideo":OpenVideo(arrArgs[0],arrArgs[1],arrArgs[2],arrArgs[3],arrArgs[4],arrArgs[5],arrArgs[6],arrArgs[7],arrArgs[8],arrArgs[9],arrArgs[10],arrArgs[11],arrArgs[12],arrArgs[13],arrArgs[14],arrArgs[15],arrArgs[16])
break;case"BW_RestoreFocus":var oPlayer=GetPlayer();try
{oPlayer.tabIndex=0;oPlayer.focus();}
catch(e)
{}
break;}
if(g_bLMS)
{lms_DoFSCommand(command,args);}
if(g_bAOSupport)
{AO_DoFSCommand(command,args);}}
function GetPlayer()
{var player=null;if(IE)
{player=document.getElementById("player");}
else
{player=document.getElementById("eplayer");}
return player;}
function CloseWindow()
{top.window.close();}
var g_nWindowWidth=0;var g_nWindowHeight=0;var g_nSizeInterval=null;var g_nIntervalCount=0;function ResizeBrowser(strBrowserSize)
{switch(strBrowserSize)
{case"fullscreen":ResizeFullScreen();break;case"optimal":ResizeOptimal();break;}}
function ResizeFullScreen()
{top.moveTo(0,0);top.window.resizeTo(screen.availWidth,screen.availHeight);}
function ResizeOptimal()
{var nFrameWidth=0;var nFrameHeight=0;var nXPos=GetXPos();var nYPos=GetYPos();var bMove=false;g_nWindowWidth=g_nWidth+ 30;g_nWindowHeight=g_nHeight+ 30;if(screen.availWidth&gt;g_nWindowWidth&amp;&amp;screen.availHeight&gt;g_nWindowHeight)
{if(GetContentWidth()!=g_nWidth||GetContentHeight()!=g_nHeight)
{if(nXPos+ g_nWindowWidth&gt;screen.availWidth)
{bMove=true;nXPos=screen.availWidth- g_nWindowWidth- 5;}
if(nYPos+ g_nWindowHeight+ 160&gt;screen.availHeight)
{bMove=true;nYPos=screen.availHeight- g_nWindowHeight- 165;}
if(nXPos&lt;0)
{nXPos=0;}
if(nYPos&lt;0)
{nYPos=0;}
if(bMove)
{top.window.moveTo(nXPos,nYPos);}
top.window.resizeTo(g_nWindowWidth,g_nWindowHeight);nFrameWidth=(g_nWindowWidth)- GetContentWidth();nFrameHeight=(g_nWindowHeight)- GetContentHeight();g_nWindowWidth=g_nWidth+ nFrameWidth;g_nWindowHeight=g_nHeight+ nFrameHeight;top.window.resizeTo(g_nWindowWidth,g_nWindowHeight);if(IE)
{g_nSizeInterval=setInterval(CheckSize,500);}}}
else
{ResizeFullScreen();}}
function CheckSize()
{var nContentWidth=GetContentWidth();var nContentHeight=GetContentHeight();var nFrameWidth=0;var nFrameHeight=0;g_nIntervalCount++;if(nContentWidth!=g_nWidth||nContentHeight!=g_nHeight)
{nFrameWidth=g_nWindowWidth- nContentWidth;nFrameHeight=g_nWindowHeight- nContentHeight;g_nWindowWidth=g_nWidth+ nFrameWidth;g_nWindowHeight=g_nHeight+ nFrameHeight;top.window.resizeTo(g_nWindowWidth,g_nWindowHeight);clearInterval(g_nSizeInterval);}
if(g_nIntervalCount&gt;4)
{clearInterval(g_nSizeInterval);}}
function GetContentWidth()
{var nResult=0;if(IE||Safari3)
{nResult=document.body.clientWidth;}
else
{nResult=window.innerWidth;}
return nResult;}
function GetContentHeight()
{var nResult=0;if(IE||Safari3)
{nResult=nContentHeight=document.body.clientHeight;}
else
{nResult=nContentHeight=window.innerHeight;}
return nResult}
function GetXPos()
{var nResult=0;if(IE)
{nResult=window.screenLeft;}
else
{nResult=window.screenX;}
return nResult;}
function GetYPos()
{var nResult=0;if(IE)
{nResult=window.screenTop;}
else
{nResult=window.screenX;}
return nResult;}
function ResizeSwf(nWidth,nHeight)
{var oPlayer=GetPlayer();oPlayer.width=nWidth;oPlayer.height=nHeight;var divPlayer=document.getElementById("divSwf");divPlayer.style.width=nWidth;divPlayer.style.height=nHeight}
var g_bCloseExecuted=false;function DoOnClose()
{if(!g_bCloseExecuted)
{g_bCloseExecuted=true;if(g_bLMS)
{LMSUnload();}
if(g_bAOSupport)
{DoAOOnUnload();}}}
var g_oWebObjects=new Object();var g_arrStoredWebObjects=new Array();function UpdateWebObjects(nSlideXOffset,nSlideYOffset)
{for(var items in g_oWebObjects)
{var oWebObject=g_oWebObjects[items];oWebObject.Position.SlideXOffset=nSlideXOffset;oWebObject.Position.SlideYOffset=nSlideYOffset;}
RepositionDivs();}
function OpenWebObject(strId,strUrl,nXPos,nYPos,nWidth,nHeight,nSlideXOffset,nSlideYOffset)
{var oWebObject=g_oWebObjects[strId];if(!oWebObject)
{oWebObject=new Object();oWebObject.strId=strId;oWebObject.strInitUrl=strUrl;oWebObject.Div=document.createElement('div');oWebObject.Div.style.position="absolute";var oIFrame=document.createElement('iframe');oIFrame.frameBorder="0";oIFrame.id="div"+ strId;oIFrame.style.border="0";oIFrame.style.width="100%";oIFrame.style.height="100%";oIFrame.allowtransparency="true";oWebObject.Div.appendChild(oIFrame);oWebObject.IFrame=oIFrame;var oTarget=document.getElementById('divWebObjects');oTarget.appendChild(oWebObject.Div);g_oWebObjects[strId]=oWebObject;oIFrame.src=strUrl;setTimeout("RepositionDivs()",100);}
else
{var oTarget=document.getElementById('divWebObjects');oTarget.removeChild(oWebObject.Div);oTarget.appendChild(oWebObject.Div);}
oWebObject.Open=true;if(oWebObject.strUrl!=strUrl||oWebObject.Div.style.visibility!="visible")
{oWebObject.IFrame.src=strUrl;oWebObject.strUrl=strUrl;var oPosition=new Object();oPosition.XPos=nXPos;oPosition.YPos=nYPos;oPosition.Width=nWidth;oPosition.Height=nHeight;oPosition.SlideXOffset=nSlideXOffset;oPosition.SlideYOffset=nSlideYOffset;oWebObject.Position=oPosition;var oRect=GetDivRect(oPosition);oWebObject.Div.style.left=oRect.left+"px";oWebObject.Div.style.top=oRect.top+"px";oWebObject.Div.style.width=oRect.width+"px";oWebObject.Div.style.height=oRect.height+"px";oWebObject.Div.style.visibility="visible";}}
function RestoreWebObjects()
{var oWebObject=null;for(var i=0;i&lt;g_arrStoredWebObjects.length;i++)
{oWebObject=g_oWebObjects[g_arrStoredWebObjects[i]];OpenWebObject(oWebObject.strId,oWebObject.strInitUrl,oWebObject.Position.XPos,oWebObject.Position.YPos,oWebObject.Position.Width,oWebObject.Position.Height,oWebObject.Position.SlideXOffset,oWebObject.Position.SlideYOffset)}
g_arrStoredWebObjects=new Array();}
function CloseAllWebObjects(strStore)
{var bStore=(strStore=="true");for(var items in g_oWebObjects)
{var oWebObject=g_oWebObjects[items];if(bStore&amp;&amp;oWebObject.Open)
{g_arrStoredWebObjects.push(items);}
CloseWebObject(items);}}
function CloseWebObject(strId)
{var oWebObject=g_oWebObjects[strId];oWebObject.Div.style.visibility="hidden";oWebObject.IFrame.src=g_strContentFolder+"/blank.html";oWebObject.strUrl="";oWebObject.Open=false;}
function GetDivRect(oPosition)
{var oRect=new Object();var nClientWidth=GetContentWidth();var nClientHeight=GetContentHeight();var nLeftMargin=0;var nSwfWidth=parseInt(g_nWidth);var nSwfHeight=parseInt(g_nHeight);if(g_strScale=="noscale")
{nLeftMargin=(nClientWidth- nSwfWidth)/2;nTopMargin=(nClientHeight- nSwfHeight)/2;if(nLeftMargin&lt;0)
{nLeftMargin=0;}
if(nTopMargin&lt;0)
{nTopMargin=0;}
oRect.left=nLeftMargin+ oPosition.SlideXOffset+ oPosition.XPos;oRect.top=nTopMargin+ oPosition.SlideYOffset+ oPosition.YPos;oRect.width=oPosition.Width;oRect.height=oPosition.Height;}
else
{var nXScale=nClientWidth/nSwfWidth;var nYScale=nClientHeight/nSwfHeight;var nScale=nXScale;var bXScale=true;var nTopMargin=0;var nLeftMargin=0;if(nYScale&lt;nScale)
{nScale=nYScale;}
nTopMargin=(nClientHeight- nSwfHeight*nScale)/2;nLeftMargin=(nClientWidth- nSwfWidth*nScale)/2;oRect.left=nLeftMargin+(oPosition.SlideXOffset+ oPosition.XPos)*nScale;oRect.top=nTopMargin+(oPosition.SlideYOffset+ oPosition.YPos)*nScale;oRect.width=Math.floor(oPosition.Width*nScale);oRect.height=Math.floor(oPosition.Height*nScale);}
return oRect;}
function RepositionDivs()
{for(items in g_oWebObjects)
{var oWebObject=g_oWebObjects[items];var oRect=GetDivRect(oWebObject.Position);oWebObject.Div.style.left=oRect.left+"px";oWebObject.Div.style.top=oRect.top+"px";oWebObject.Div.style.width=oRect.width+"px";oWebObject.Div.style.height=oRect.height+"px";}}
window.onresize=RepositionDivs;function OpenUrl(strUrl,strWindow,strWindowSize,strWidth,strHeight,strUseDefaultControls,strStatus,strToolbar,strLocation,strMenubar,strScrollbars,strResizable)
{var nWndWidth=parseInt(strWidth);var nWndHeight=parseInt(strHeight);var bUseDefaultSize=(strWindowSize.toLowerCase()=="default");var bUseDefaultControls=(strUseDefaultControls.toLowerCase()=="true");var bFullScreen=(strWindowSize.toLowerCase()=="fullscreen");strUrl=ReplaceAll(strUrl,"%25","?");if(bFullScreen)
{nWndWidth=screen.availWidth;nWndHeight=screen.availHeight;}
else
{if(nWndWidth&gt;screen.availWidth)
{nWndWidth=screen.availWidth;}
if(nWndHeight&gt;screen.availHeight)
{nWndHeight=screen.availHeight;}}
var strOptions="";if(!bUseDefaultControls)
{if(!bUseDefaultSize)
{strOptions+="width="+ nWndWidth+", ";strOptions+="height="+ nWndHeight+", ";}
strOptions+="status="+((strStatus.toLowerCase()=="true")?1:0);strOptions+=", toolbar="+((strToolbar.toLowerCase()=="true")?1:0);strOptions+=", scrollbars="+((strScrollbars.toLowerCase()=="true")?1:0);strOptions+=", resizable="+((strResizable.toLowerCase()=="true")?1:0);strOptions+=", alwaysRaised=1";}
else
{strOptions+="status=1";strOptions+=", toolbar=1";strOptions+=", scrollbars=1";strOptions+=", resizable=1";strOptions+=", alwaysRaised=1";}
var oNewWnd;if(bUseDefaultSize&amp;&amp;bUseDefaultControls)
{g_wndLast=window.open(strUrl,strWindow,strOptions);}
else if(bUseDefaultControls)
{if(IE)
{oNewWnd=window.open(GetBasePath()+ g_strContentFolder+"/blank.html",strWindow,"alwaysRaised=true");if(bFullScreen)
{oNewWnd.moveTo(0,0);}
oNewWnd.resizeTo(nWndWidth,nWndHeight);oNewWnd.document.location=strUrl;}
else
{oNewWnd=window.open(strUrl,strWindow,"alwaysRaised=true");oNewWnd.resizeTo(nWndWidth,nWndHeight);}
g_wndLast=oNewWnd;}
else
{oNewWnd=window.open(strUrl,strWindow,strOptions);g_wndLast=oNewWnd;}
if(bFullScreen&amp;&amp;!(bUseDefaultControls&amp;&amp;IE))
{oNewWnd.moveTo(0,0);}}
function ReplaceAll(strTarget,strChar,strNew)
{var arrRemoved=strTarget.split(strChar);return arrRemoved.join(strNew);}
var g_oSwfInfo=new Object();var g_wndSwf;var g_wndLast;function OpenSwfWindow(strFileName,nWidth,nHeight,strStatus,strToolbar,strLocation,strMenubar,strScrollbars,strResizable)
{var strScroll="0";g_oSwfInfo.strContentFolder=g_strContentFolder;g_oSwfInfo.strFileName=strFileName;g_oSwfInfo.nWidth=parseInt(nWidth);g_oSwfInfo.nHeight=parseInt(nHeight);if(g_oSwfInfo.nWidth&gt;screen.availWidth)
{g_oSwfInfo.nWidth=screen.availWidth;strScroll="1";}
if(g_oSwfInfo.nHeight&gt;screen.availHeight)
{g_oSwfInfo.nHeight=screen.availHeight;strScroll="1";}
var strSearch="";strSearch+="path="+ g_strContentFolder+"&amp;";strSearch+="file="+ strFileName+"&amp;";strSearch+="w="+ nWidth+"&amp;";strSearch+="h="+ nHeight;var strOptions="";strOptions+="width="+ g_oSwfInfo.nWidth;strOptions+=", height="+ g_oSwfInfo.nHeight;strOptions+=", status="+((strStatus.toLowerCase()=="true")||true?1:0);strOptions+=", toolbar="+((strToolbar.toLowerCase()=="true")||true?1:0);strOptions+=", location="+((strLocation.toLowerCase()=="true")||true?1:0);strOptions+=", menubar="+((strMenubar.toLowerCase()=="true")||true?1:0);strOptions+=", scrollbars="+((strScrollbars.toLowerCase()=="true")||true?1:0);strOptions+=", resizable="+((strResizable.toLowerCase()=="true")||true?1:0);if(g_wndSwf)
{try
{g_wndSwf.close()}
catch(e)
{}}
g_wndSwf=window.open(GetBasePath()+ g_strContentFolder+"/swf.html?"+ strSearch,"SwfWnd",strOptions);g_wndLast=g_wndSwf;}
function GetBasePath()
{var strFullPath=document.location.href;var nPosHash=strFullPath.indexOf("#");if(nPosHash&gt;0)
{strFullPath=strFullPath.substring(0,nPosHash);}
var nPos1=-1;var nPos2=-1;nPos1=strFullPath.lastIndexOf("\\");nPos2=strFullPath.lastIndexOf("/");if(nPos2&gt;nPos1)
{nPos1=nPos2;}
if(nPos1&gt;=0)
{strFullPath=strFullPath.substring(0,nPos1+ 1);}
return(strFullPath);}
function OpenVideo(strUrl,strWndWidth,strWndHeight,strVidWidth,strVidHeight,strDuration,strPlaybar,strVolume,strAutoPlay,strStatus,strToolbar,strLocation,strMenubar,strScrollbars,strResizable,strType,strASVersion)
{var nWndWidth=parseInt(strWndWidth);var nWndHeight=parseInt(strWndHeight);var strSearch="exUrl="+ strUrl+"&amp;exWndWidth="+ strWndWidth+"&amp;exWndHeight="+ strWndHeight+"&amp;exWidth="+ strVidWidth+"&amp;exHeight="+ strVidHeight+"&amp;exDuration="+ strDuration+"&amp;exPlaybar="+ strPlaybar+"&amp;exVolume="+ strVolume+"&amp;exAutoPlay="+ strAutoPlay+"&amp;exType="+ strType+"&amp;exASVersion="+ strASVersion;if(nWndWidth&gt;screen.availWidth)
{nWndWidth=screen.availWidth;}
if(nWndHeight&gt;screen.availHeight)
{nWndHeight=screen.availHeight;}
var strOptions="";strOptions+="width="+ nWndWidth;strOptions+=", height="+ nWndHeight;strOptions+=", status="+((strStatus.toLowerCase()=="true")?1:0);strOptions+=", toolbar="+((strToolbar.toLowerCase()=="true")?1:0);strOptions+=", location="+((strLocation.toLowerCase()=="true")?1:0);strOptions+=", menubar="+((strMenubar.toLowerCase()=="true")?1:0);strOptions+=", scrollbars="+((strScrollbars.toLowerCase()=="true")?1:0);strOptions+=", resizable="+((strResizable.toLowerCase()=="true")?1:0);if(g_wndSwf)
{try
{g_wndSwf.close()}
catch(e)
{}}
var nXPos=0;var nYPos=0;var nWidth=screen.availWidth;var nHeight=screen.availHeight;if(window.screenX!=undefined)
{nXPos=window.screenX;nYPos=window.screenY;nWidth=window.innerWidth;nHeight=window.innerHeight;}
else if(window.screenLeft!=undefined)
{nXPos=window.screenLeft;nYPos=window.screenTop;nWidth=document.body.offsetWidth;nHeight=document.body.offsetHeight;}
strOptions+=", left="+(nXPos+(nWidth- nWndWidth)/2);strOptions+=", screenX="+(nXPos+(nWidth- nWndWidth)/2);strOptions+=", top="+(nYPos+(nHeight- nWndHeight)/2);strOptions+=", screenY="+(nYPos+(nHeight- nWndHeight)/2);g_wndSwf=window.open(GetBasePath()+ g_strContentFolder+"/VideoPlayer.html?"+ strSearch,"Video",strOptions);g_wndLast=g_wndSwf;}
var g_bSetCapture=false;function AddRightClickListener()
{if(IE)
{divSwf.onmousedown=IEMouseDown;divSwf.onmouseup=IEMouseUp
divSwf.oncontextmenu=DivContextMenu;}
else
{window.addEventListener('mousedown',NSMouseDown(),true);window.addEventListener('mouseup',NSMouseUp(),true);}}
function IEMouseDown(evt)
{if(event.button==2)
{if(NotifyRightDown("player"))
{divSwf.setCapture();g_bSetCapture=true;}}}
function IEMouseUp()
{if(event.button==2)
{NotifyRightUp("player");}
if(g_bSetCapture)
{g_bSetCapture=false;divSwf.releaseCapture();}}
function DivContextMenu()
{return false;}
function NSMouseDown()
{return function(evt)
{if(evt.button==2)
{if(NotifyRightDown(evt.target.id))
{evt.stopPropagation();evt.preventDefault();}}}}
function NSMouseUp()
{return function(evt)
{if(evt.button==2)
{if(NotifyRightUp(evt.target.id))
{evt.stopPropagation();evt.preventDefault();}}}}
function NotifyRightDown(strId)
{var bResult=false;if(strId=="player"||strId=="eplayer")
{var oPlayer=GetPlayer();bResult=oPlayer.NotifyRightMouseDown();}
return bResult;}
function NotifyRightUp(strId)
{var bResult=false;if(strId=="player"||strId=="eplayer")
{var oPlayer=GetPlayer();bReuslt=oPlayer.NotifyRightMouseUp();}
return bResult;}
function MailTo(strAddress)
{document.location="mailto:"+ strAddress;}
function EmailResults(bShowUserScore,bShowPassingScore,bShowPassFail,bShowQuizReview,strAddress,strMainQuizId,arrQuizzes)
{var strNewLine="\n";if(IE)
{strNewLine="%0D%0A";}
var strTitle=g_listQuizzes[strMainQuizId].strQuizName;var g_strSubject="Quiz Results: "+ strTitle;var strQuizResults="";var strMainHeader=" "+ strTitle+ strNewLine+"Status, Score, Passing Score, Max Score, Min Score, Time"+ strNewLine;var strLineHeader=strNewLine+ strNewLine+"Date, Time, Score, Quiz Name, Interaction ID, Interaction Type, Student Response, Result, Weight, Latency"+ strNewLine;var strMainData=strNewLine;var strLineData=strNewLine;var oQuizResult=g_listQuizzes[strMainQuizId];var nPtScore=Number(oQuizResult.nPtScore);var nPassScore=Number(oQuizResult.nPassingScore);var strStatus=(nPtScore&gt;=nPassScore)?"Pass":"Fail";strMainData+=strStatus
strMainData+=",";strMainData+=nPtScore+",";strMainData+=nPassScore+",";strMainData+=100+",";strMainData+=0+",";strMainData+=GetTime(oQuizResult.dtmFinished);for(var j=0;j&lt;arrQuizzes.length;j++)
{strQuizId=arrQuizzes[j];oQuizData=g_listQuizzes[strQuizId];var arrQuestions=oQuizData.arrQuestions;for(var i=0;i&lt;arrQuestions.length;i++)
{strLineData+=GetDate(new Date())+",";strLineData+=arrQuestions[i].strCompletedTime+",";strLineData+=arrQuestions[i].nPoints+",";strLineData+=oQuizData.strQuizName+",";strLineData+=arrQuestions[i].strLMSId+",";strLineData+=arrQuestions[i].strType+",";var strResponse=arrQuestions[i].strUserResponse;strResponse=ReplaceAll(strResponse,"'","%27");strLineData+=strResponse+",";strLineData+=arrQuestions[i].strStatus+",";strLineData+=arrQuestions[i].nWeight+",";strLineData+=arrQuestions[i].nLatency;strLineData+=strNewLine;}}
strQuizResults=strMainHeader+ strMainData+ strLineHeader+ strLineData;var sHTML="";if(IE)
{sHTML+='&lt;FORM id="formQuiz" method="POST" action="mailto:'+ strAddress+'?subject='+ g_strSubject+'&amp;amp;body='+ strQuizResults+'" enctype="text/plain"&gt;';}
else
{sHTML+='&lt;FORM id="formQuiz" method="POST" action="mailto:'+ strAddress+'?subject='+ g_strSubject+'" enctype="text/plain"&gt;';sHTML+='&lt;INPUT TYPE="hidden" NAME="Quiz Results" VALUE=\''+ strQuizResults+'\'&gt;';}
sHTML+='&lt;br&gt;&lt;input type="submit"&gt;&lt;br&gt;';sHTML+='&lt;/FORM&gt;';document.getElementById("divEmail").innerHTML=sHTML;document.getElementById("formQuiz").submit();}
function GetTime(dtmDate)
{var strResult="";var nHours=dtmDate.getHours();var strAM="am";var nMinutes=dtmDate.getMinutes();var strMinutes=""+ nMinutes;var nSeconds=dtmDate.getSeconds();var strSeconds=""+ nSeconds;if(nMinutes&lt;10)
{strMinutes="0"+ nMinutes;}
if(nSeconds&lt;10)
{strSeconds="0"+ nSeconds;}
strResult=nHours+":"+ strMinutes+":"+ strSeconds;return strResult;}
function GetDate(dtmDate)
{var strResult="";strResult=(dtmDate.getMonth()+ 1)+"/"+ dtmDate.getDate()+"/"+ dtmDate.getFullYear();return strResult;}
function QuizData(strQuizId,strQuizName)
{this.strQuizId=strQuizId;this.strQuizName=strQuizName;this.arrQuestions=new Array();this.dtmFinished=new Date();this.strStatus="";this.nScore=0;this.nPassingScore=80;this.nMinScore=0;this.nMaxScore=100;this.nPtScore=0;this.nPtMax=100;this.AddQuestionResult=function(oQuestionResult)
{var bFound=false;for(var i=0;i&lt;this.arrQuestions.length;i++)
{if(this.arrQuestions[i].nQuestionNumber==oQuestionResult.nQuestionNumber)
{this.arrQuestions[i]=oQuestionResult;bFound=true;}}
if(!bFound)
{this.arrQuestions.push(oQuestionResult);}}}
function ContentResults()
{this.dtmFinished=new Date();this.nPassingScore=80;this.nScore=0;this.strStatus="incomplete";this.strType="quiz";}
function QuestionResults(strId,strLMSId,strType,strCorrectResponse,strUserResponse,nLatency,strStatus,nPoints,strCompletedTime,nWeight,nQuestionNumber,strDescription,bTracked)
{this.strId=strId;this.strLMSId=strLMSId;this.strType=strType;this.strCorrectResponse=strCorrectResponse;this.strUserResponse=strUserResponse;this.nLatency=nLatency;this.strStatus=strStatus;this.nPoints=nPoints;this.strCompletedTime=strCompletedTime;this.nWeight=nWeight;this.nQuestionNumber=nQuestionNumber;this.strDescription=strDescription;this.bTracked=bTracked;}</text>
				</content>
				<redirectionURL/>
				<headersSize>279</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.964-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/lms/lms.js</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>application/javascript, */*;q=0.8</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story.html</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>358</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-javascript</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="lms.js"</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:52 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>0</size>
					<mimeType>application/x-javascript</mimeType>
					<text>var SURVEY_CORRECT_RESPONSE="_";var lmsAPI=parent;var g_bAPIPresent=false;var g_bLMSPresent=false;var g_bLessonCompleted=false;var g_strResumeData="";var g_nSaveTimeout;var g_nDelayCount=0;var g_strStatus="";if(lmsAPI&amp;&amp;lmsAPI.IsLmsPresent)
{g_bAPIPresent=true;g_bLMSPresent=lmsAPI.IsLmsPresent();}
var g_strLDelim="|~|";var g_strLInteractionDelim="|#|";function lms_DoFSCommand(command,args)
{if(g_bAPIPresent)
{args=String(args);command=String(command);var arrArgs=args.split(g_strLDelim);switch(command)
{case"BW_StoreQuestionResult":RecordInteraction(arrArgs);break;case"BW_SetResumeData":g_strResumeData=args;SaveStateData();break;case"BW_UpdateStatus":ReportStatus();break;case"BW_UpdateViewStatus":SetStatus(normalizeStatus(g_oContentResults.strStatus));break;case"BW_InitResume":if(arrArgs[0]=="true")
{g_strStatus="incomplete";}
else
{SetStatus("incomplete");}
break;case"BW_ClosePlayer":ReportStatus();LMSCommit();lmsAPI.ConcedeControl()
break;}}}
function ReportStatus()
{if(g_oContentResults.strType=="quiz")
{lmsAPI.SetScore(g_oContentResults.nScore,100,0);}
SetStatus(normalizeStatus(g_oContentResults.strStatus));}
function RecordInteraction(arrArgs)
{var bResult=true;var strQuizId=arrArgs[0];var strId=arrArgs[1];var strType=arrArgs[3];var strCorrectResponse=arrArgs[4];var strStudentResponse=arrArgs[5];var nLatency=arrArgs[6];var strResult=arrArgs[7];var nPoints=arrArgs[8];var strTime=arrArgs[9];var strWeight=arrArgs[10];var nQuestionNumber=arrArgs[11];var strDescription=arrArgs[12];var strLearningObjectiveId=arrArgs[13];var bTracked=(arrArgs[14]=="true");var bSurvey=(strResult.toLowerCase()=="neutral");if(bTracked)
{strLearningObjectiveId=strLearningObjectiveId.replace(/[ \t\r\n\v\f]/g,"_");strResult=normalizeResult(strResult);var strTemp="";strTemp+="Description: "+ strDescription+"\n";strTemp+="Time: "+ strTime+"\n";strTemp+="Id: "+ strId+"\n";strTemp+="Learning Objective Id: "+ strLearningObjectiveId+"\n";strTemp+="Type: "+ strType+"\n";strTemp+="Correct Response: "+ strCorrectResponse+"\n";strTemp+="Student Response: "+ strStudentResponse+"\n";strTemp+="Result: "+ strResult+"\n";strTemp+="Weight: "+ strWeight+"\n";strTemp+="Latency: "+ parseInt(nLatency)+"\n";strTemp+="Survey: "+ bSurvey;switch(strType)
{case"truefalse":var bUserResult=(strStudentResponse.toLowerCase()=="true");var bCorrectResult=(strCorrectResponse.toLowerCase()=="true");bResult=lmsAPI.RecordTrueFalseInteraction(strId,bUserResult,strResult,bCorrectResult,strDescription,parseInt(strWeight),parseInt(nLatency),strLearningObjectiveId);break;case"wordbank":case"hotspot":case"multiplechoice":case"multipleresponse":var arrUserResult=strStudentResponse.split(g_strLInteractionDelim);var arrCorrectResult=strCorrectResponse.split(g_strLInteractionDelim);for(var i=0;i&lt;arrUserResult.length;i++)
{var objUserResult=lmsAPI.CreateResponseIdentifier(arrUserResult[i].substr(0,1),arrUserResult[i]);arrUserResult[i]=objUserResult;}
if(!bSurvey)
{for(var i=0;i&lt;arrCorrectResult.length;i++)
{var strShort="";if(arrCorrectResult[i].length&gt;0)
{strShort=arrCorrectResult[i].substr(0,1);}
var objCorrectResponse=lmsAPI.CreateResponseIdentifier(strShort,arrCorrectResult[i]);arrCorrectResult[i]=objCorrectResponse;}}
else
{arrCorrectResult=new Array();}
bResult=lmsAPI.RecordMultipleChoiceInteraction(strId,arrUserResult,strResult,arrCorrectResult,strDescription,parseInt(strWeight),parseInt(nLatency),strLearningObjectiveId);break;case"essay":case"fillin":case"numeric":bResult=lmsAPI.RecordFillInInteraction(strId,strStudentResponse,strResult,strCorrectResponse,strDescription,parseInt(strWeight),parseInt(nLatency),strLearningObjectiveId);break;case"matching":var arrUserResult=strStudentResponse.split(g_strLInteractionDelim);var arrCorrectResult=strCorrectResponse.split(g_strLInteractionDelim);var arrNewUserResult=new Array();var arrNewCorrectResult=new Array();var nIndex=0;for(var i=0;i&lt;arrUserResult.length;i+=2)
{var strShort=""+(nIndex+ 1);var objSource=lmsAPI.CreateResponseIdentifier(strShort.substr(0,1),arrUserResult[i]);var objUserResult=lmsAPI.CreateResponseIdentifier(arrUserResult[i+ 1].substr(0,1),arrUserResult[i+ 1]);arrNewUserResult[nIndex]=new lmsAPI.MatchingResponse(objSource,objUserResult);nIndex++;}
nIndex=0;if(!bSurvey)
{for(var i=0;i&lt;arrCorrectResult.length;i+=2)
{var strShort=""+(nIndex+ 1);var objSource=lmsAPI.CreateResponseIdentifier(strShort.substr(0,1),arrCorrectResult[i]);var objCorrectResponse=lmsAPI.CreateResponseIdentifier(arrCorrectResult[i+ 1].substr(0,1),arrCorrectResult[i+ 1]);arrNewCorrectResult[nIndex]=new lmsAPI.MatchingResponse(objSource,objCorrectResponse);nIndex++;}}
bResult=lmsAPI.RecordMatchingInteraction(strId,arrNewUserResult,strResult,arrNewCorrectResult,strDescription,parseInt(strWeight),parseInt(nLatency),strLearningObjectiveId);break;case"sequence":var arrUserResult=strStudentResponse.split(g_strLInteractionDelim);var arrCorrectResult=strCorrectResponse.split(g_strLInteractionDelim);for(var i=0;i&lt;arrUserResult.length;i++)
{var objUserResult=lmsAPI.CreateResponseIdentifier(arrUserResult[i].substr(0,1),arrUserResult[i]);arrUserResult[i]=objUserResult;}
if(!bSurvey)
{for(var i=0;i&lt;arrCorrectResult.length;i++)
{var strShort="";if(arrCorrectResult[i].length&gt;0)
{strShort=arrCorrectResult[i].substr(0,1);}
var objCorrectResponse=lmsAPI.CreateResponseIdentifier(arrCorrectResult[i].substr(0,1),arrCorrectResult[i]);arrCorrectResult[i]=objCorrectResponse;}}
else
{arrCorrectResult=new Array();}
bResult=lmsAPI.RecordSequencingInteraction(strId,arrUserResult,strResult,arrCorrectResult,strDescription,parseInt(strWeight),parseInt(nLatency),strLearningObjectiveId);break;case"likert":bResult=lmsAPI.RecordLikertInteraction(strId,lmsAPI.CreateResponseIdentifier(strStudentResponse.substr(0,1),strStudentResponse),strResult,strCorrectResponse,strDescription,parseInt(strWeight),parseInt(nLatency),strLearningObjectiveId);break;break;default:break;}}}
function normalizeResult(result)
{switch(result.toUpperCase().charAt(0))
{case'C':return lmsAPI.INTERACTION_RESULT_CORRECT;case'I':return lmsAPI.INTERACTION_RESULT_WRONG;case'W':return lmsAPI.INTERACTION_RESULT_WRONG;case'U':return lmsAPI.INTERACTION_RESULT_UNANTICIPATED;case'N':return lmsAPI.INTERACTION_RESULT_NEUTRAL;}
return result;}
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;}
function timecodeToMilliSeconds(tCode)
{var results=tCode.split(":");var secs;for(var i=0;i&lt;results.length;i++)
{if(results[i].substr(0,1)=="0")
{results[i]=results[i].substr(1);}}
secs=((parseInt(results[0])*60)+ parseInt(results[1]))*60+ parseInt(results[2]);return secs*1000;}
function SetStatus(strStatus)
{if(strStatus!=g_strStatus)
{g_strStatus=strStatus;switch(strStatus)
{case"complete":case"completed":lmsAPI.SetReachedEnd();break;case"incomplete":lmsAPI.ResetStatus();break;case"not attempted":break;case"failed":lmsAPI.SetFailed();break;case"passed":lmsAPI.SetPassed();break;}
ForceCommit();}}
function SaveStateData()
{g_nDelayCount++;if(g_nSaveTimeout)
{clearTimeout(g_nSaveTimeout);}
if(g_nDelayCount&gt;=10)
{SaveNow();}
else
{g_nSaveTimeout=setTimeout("SaveNow()",500);}}
function ForceCommit()
{if(g_bAPIPresent)
{lmsAPI.SetDataChunk(g_strResumeData);LMSCommit();}}
function SaveNow()
{g_nDelayCount=0;if(g_bAPIPresent)
{lmsAPI.SetDataChunk(g_strResumeData);}}
function RetrieveStateData()
{if(g_bAPIPresent)
{g_strResumeData=lmsAPI.GetDataChunk();g_bLessonCompleted=(lmsAPI.GetStatus()==lmsAPI.LESSON_STATUS_COMPLETED);}}
function LMSCommit()
{if(g_bWarnOnCommitFail)
{var bResult=true;try
{bResult=lmsAPI.CommitData();}
catch(e)
{bResult=false;};if(!bResult)
{WarnCommit();}}
else
{lmsAPI.CommitData();}}
function WarnCommit()
{var bResult=false;while(!bResult)
{bResult=true;if(confirm("The method CommitData failed sending data to LMS. Retry?"))
{try
{bResult=lmsAPI.CommitData();}
catch(e)
{bResult=false;};}}}
function LMSUnload()
{if(g_bAPIPresent)
{ReportStatus();lmsAPI.Unload();}}
setInterval("ForceCommit()",600000);if(g_bAPIPresent)
{if(IE6)
{setTimeout("ForceCommit()",5000);}
else
{LMSCommit();}}</text>
				</content>
				<redirectionURL/>
				<headersSize>277</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:26.980-07:00</startedDateTime>
			<time>124</time>
			<request>
				<method>POST</method>
				<url>http://demo.moodle.net/mod/scorm/datamodel.php</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies>
					<cookie>
						<name>__cfduid</name>
						<value>d671ef6df61fbdb99a168a2ad022887721351025982</value>
					</cookie>
					<cookie>
						<name>MoodleSessiondemo</name>
						<value>9j0cdmavh4knt1t090qm82jl85</value>
					</cookie>
				</cookies>
				<headers>
					<header>
						<name>Accept</name>
						<value>*/*</value>
					</header>
					<header>
						<name>Content-Type</name>
						<value>application/x-www-form-urlencoded</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/mod/scorm/player.php</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-us</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
					<header>
						<name>Content-Length</name>
						<value>48</value>
					</header>
					<header>
						<name>Connection</name>
						<value>Keep-Alive</value>
					</header>
					<header>
						<name>Cache-Control</name>
						<value>no-cache</value>
					</header>
					<header>
						<name>Cookie</name>
						<value>__cfduid=d671ef6df61fbdb99a168a2ad022887721351025982; MoodleSessiondemo=9j0cdmavh4knt1t090qm82jl85</value>
					</header>
				</headers>
				<queryString/>
				<postData>
					<mimeType>application/x-www-form-urlencoded</mimeType>
					<text>id=0&amp;a=29&amp;sesskey=2HVMbBRpib&amp;attempt=1&amp;scoid=162</text>
				</postData>
				<headersSize>498</headersSize>
				<bodySize>48</bodySize>
			</request>
			<response>
				<status>200</status>
				<statusText>OK</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Server</name>
						<value>cloudflare-nginx</value>
					</header>
					<header>
						<name>Date</name>
						<value>Thu, 01 Nov 2012 00:11:29 GMT</value>
					</header>
					<header>
						<name>Content-Type</name>
						<value>text/html; charset=UTF-8</value>
					</header>
					<header>
						<name>Transfer-Encoding</name>
						<value>chunked</value>
					</header>
					<header>
						<name>Connection</name>
						<value>keep-alive</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 19 Nov 1981 08:52:00 GMT</value>
					</header>
					<header>
						<name>Cache-Control</name>
						<value>no-store, no-cache, must-revalidate, post-check=0, pre-check=0</value>
					</header>
					<header>
						<name>Pragma</name>
						<value>no-cache</value>
					</header>
				</headers>
				<content>
					<size>6</size>
					<mimeType>text/html; charset=UTF-8</mimeType>
					<text>true
0</text>
				</content>
				<redirectionURL/>
				<headersSize>336</headersSize>
				<bodySize>6</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>124</wait>
				<receive>0</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:27.120-07:00</startedDateTime>
			<time>47</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story.swf</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>*/*</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story.html</value>
					</header>
					<header>
						<name>x-flash-version</name>
						<value>11,4,402,287</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>358</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-shockwave-flash</value>
					</header>
					<header>
						<name>Content-Length</name>
						<value>226324</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="story.swf"</value>
					</header>
					<header>
						<name>ETag</name>
						<value>79f3f7326e7114fcb9aea1ed0f3d758c80d22a46</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:54 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>226324</size>
					<mimeType>application/x-shockwave-flash</mimeType>
				</content>
				<redirectionURL/>
				<headersSize>329</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>47</receive>
			</timings>
		</entry>
		<entry>
			<pageref>0</pageref>
			<startedDateTime>2012-11-01T00:11:27.276-07:00</startedDateTime>
			<time>0</time>
			<request>
				<method>GET</method>
				<url>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story_content/data.swf</url>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Accept</name>
						<value>*/*</value>
					</header>
					<header>
						<name>Accept-Language</name>
						<value>en-US</value>
					</header>
					<header>
						<name>Referer</name>
						<value>http://demo.moodle.net/pluginfile.php/2258/mod_scorm/content/1/story.swf</value>
					</header>
					<header>
						<name>x-flash-version</name>
						<value>11,4,402,287</value>
					</header>
					<header>
						<name>Accept-Encoding</name>
						<value>gzip, deflate</value>
					</header>
					<header>
						<name>User-Agent</name>
						<value>Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)</value>
					</header>
					<header>
						<name>Host</name>
						<value>demo.moodle.net</value>
					</header>
				</headers>
				<queryString/>
				<headersSize>370</headersSize>
				<bodySize>0</bodySize>
			</request>
			<response>
				<status>304</status>
				<statusText>Not Modified</statusText>
				<httpVersion>HTTP/1.1</httpVersion>
				<cookies/>
				<headers>
					<header>
						<name>Content-Type</name>
						<value>application/x-shockwave-flash</value>
					</header>
					<header>
						<name>Content-Length</name>
						<value>104629</value>
					</header>
					<header>
						<name>X-Powered-By</name>
						<value>PHP/5.3.8</value>
					</header>
					<header>
						<name>Pragma</name>
						<value/>
					</header>
					<header>
						<name>Content-Disposition</name>
						<value>inline; filename="data.swf"</value>
					</header>
					<header>
						<name>ETag</name>
						<value>b631c5bd8ecb2911f1d7e19c3e417e71402d5c82</value>
					</header>
					<header>
						<name>CF-Cache-Status</name>
						<value>HIT</value>
					</header>
					<header>
						<name>Expires</name>
						<value>Thu, 01 Nov 2012 23:37:54 GMT</value>
					</header>
					<header>
						<name>Last-Modified</name>
						<value>Wed, 31 Oct 2012 23:33:31 GMT</value>
					</header>
				</headers>
				<content>
					<size>104629</size>
					<mimeType>application/x-shockwave-flash</mimeType>
				</content>
				<redirectionURL/>
				<headersSize>328</headersSize>
				<bodySize>0</bodySize>
			</response>
			<cache/>
			<timings>
				<send>0</send>
				<wait>0</wait>
				<receive>0</receive>
			</timings>
		</entry>
	</entries>
</log>