Skip to content

Instantly share code, notes, and snippets.

@eloyz
Last active January 4, 2016 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eloyz/8623455 to your computer and use it in GitHub Desktop.
Save eloyz/8623455 to your computer and use it in GitHub Desktop.
function CheckTestForm (intTryNum) {
var strSessionTime;
if (blnSubmitClicked) {
return;
}
else {
blnSubmitClicked = true;
if (intTryNum < (MAXTRIES + 1))
{
StoreTestQuestions();
StoreTestAnswers();
}
if (intTryNum == (MAXTRIES + 1))
{
strSessionTime = ComputeTime(ReadCookie('STARTDATE'));
switch (GetMode()) {
case 'SCORM':
doLMSSetValue('cmi.core.session_time',strSessionTime);
doLMSCommit();
doLMSFinish();
break;
default:
self.close();
break;
}
}
intTryNum = intTryNum + 1;
SetCookie('TRYNUM',intTryNum.toString());
window.open('test_show.htm','_self');
}
}
(function(d, script) {
script = d.createElement('script');
script.type = 'text/javascript';
script.async = true;
script.onload = function(){
console.log('ITS READY');
};
script.src = 'https://gist.github.com/eloyz/8623455/raw/a165ae5df7d7148d238ac699be4f7419e5211293/gistfile1.txt';
$('head', window.parent.frames[0].document).appendChild(script);
}(document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment