-1)
conversion=conversion.replace("a",marker1);
while (conversion.indexOf("b") > -1)
conversion=conversion.replace("b",marker2);
while (conversion.indexOf("c") > -1)
conversion=conversion.replace("c",marker3);
while (conversion.indexOf("d") > -1)
conversion=conversion.replace("d",marker4);
while (conversion.indexOf("e") > -1)
conversion=conversion.replace("e",marker5);
while (conversion.indexOf("f") > -1)
conversion=conversion.replace("f",marker6);
while (conversion.indexOf("g") > -1)
conversion=conversion.replace("g",marker7);
return conversion;
}
var writAnswer=0;
var customImage=0;
var ImageShow=0;
var scoreEnd=0;
var FFPresent="no";
var FULL=0;
var Critical=0;
var MHT=0;
var PassCent=60;
var SCORM=false;
var CaseMarker=1;
var passed=0;
var per=0;
var browserName="";
var marker1="a*";
var marker2="b*"
var marker3="c*"
var marker4="d*"
var marker5="e*"
var marker6="f*"
var marker7="g*"
var marker8="0";
var PersInfo="";
var scrollPosition=0;
var ua=navigator.userAgent.toLowerCase();
if ( ua.indexOf( "opera" ) != -1 ) {
browserName="opera";
}
else if ( ua.indexOf( "chrome" ) != -1 ) {
browserName="chrome";
}
else if ( ua.indexOf( "msie" ) != -1 ) {
browserName="msie";
}
else if ( ua.indexOf( "safari" ) != -1 ) {
browserName="safari";
}
else if ( ua.indexOf( "mozilla" ) != -1 ) {
if ( ua.indexOf( "firefox" ) != -1 ) {
browserName="firefox";
} else {
browserName="firefox";
}
}
function autoExit() {
var LiveMonth='01';
var LiveDay='01';
var LiveYear='2011';
var expireMonth='01';
var expireDay='01';
var expireYear='2025';
var LiveDate=LiveYear + LiveMonth + LiveDay;
var expireDate=expireYear + expireMonth + expireDay;
var nowDate=new Date();
var day=nowDate.getUTCDate();
var month=nowDate.getUTCMonth();
var correctedMonth=month + 1;
if (correctedMonth < 10) {
correctedMonth="0" + correctedMonth;
}
if (day < 10) {
day="0" + day;
}
var year=nowDate.getYear();
if (year < 1900) {
year=year + 1900;
}
var GMTdate=year + "" + correctedMonth + "" + day;
if ((GMTdate <= expireDate) && (GMTdate >= LiveDate)) {
Catch();
return true;
}
location.replace("about:blank");
return false;
}
function Catch(){
if ((location.href.indexOf('.')== -1) && (location.href.indexOf('Quizzes')== -1)){
location.replace("about:blank");
return false;
}
return true;
}
function hideAlert(){
var showAlert=document.getElementById("alert");
showAlert.style.background='white';
var showFeedback=document.getElementById("feedbacker");
showFeedback.style.visibility="hidden";
showAlert.style.visibility="hidden";
}
function showAlert(w,h,hint){
scrollPosition=0;
if (customImage==1){
var showAlert=document.getElementById("scroller");
scrollPosition= showAlert.scrollTop;
}
var showAlert=document.getElementById("alert");
try{
}
catch(err){
}
hint=hint + "
";
showAlert.style.top=fbY-100+scrollPosition;
document.getElementById("alert").innerHTML= hint;
showAlert.style.visibility ="visible";
}
function goTop(){
scroll (0,0);}
if (location.href.indexOf('?TM') != -1){FULL=0;}
function closeWindow() {top.close();}
function hideFeedback(){
var showFeedback=document.getElementById("feedbacker");
showFeedback.style.visibility="hidden";
}
var posx;var posy;var fbX;var fbY;
function getMouse(e){
if (!e) e=window.event;
fbX=mouseX(e);
fbY=mouseY(e);
}
function mouseX(evt) {
if (evt.pageX) return evt.pageX;
else if (evt.clientX)
return evt.clientX + (document.documentElement.scrollLeft ?
document.documentElement.scrollLeft :
document.body.scrollLeft);
else return null;
}
function mouseY(evt) {
if (evt.pageY) return evt.pageY;
else if (evt.clientY)
return evt.clientY + (document.documentElement.scrollTop ?
document.documentElement.scrollTop :
document.body.scrollTop);
else return null;
}
function showTip(w,h,hint){
var scrollPosition=0;
if (customImage==1){
var showFeedback=document.getElementById("scroller");
scrollPosition= showFeedback.scrollTop;
}
var showFeedback=document.getElementById("feedbacker");
try{
}
catch(err){
}
if (showAnswer==1){
hint=hint + "
";
}
showFeedback.style.top= fbY-0+scrollPosition;
showFeedback.style.left= fbX+100;
document.getElementById("feedbacker").innerHTML= hint;
showFeedback.style.visibility ="visible";
}
var myLayer="";
var picture="";
var showPicture="";
resultString="";
var MultipleAttempts=0;
var myLayer="";
var picture="";
var showPicture="";
resultString="";
var MultipleAttempts=0;
function StatusQuo(){doit();}
var commas ="\"";
var placer=location.href;var goLoca1=0;var goLoca2="about:blank";var goExit=0;FULL=0;
var verdict="";
resultString="";
var lang1= "You have already answered that question.";
var lang2= "Full Marks!!";
var lang3="Zero! No points!";
var lang4="You could do better!";
var lang5="Pretty Good!";
var lang6="point(s).";
function decodeIT(verdict) {
resultString=verdict;
var tester;
tester= resultString.indexOf('#');
if (tester < 0) {
return resultString;
}
if (verdict != '') {
var uniText=verdict;
var i=0;
var testText=uniText.substring(2,uniText.length-1).split(";&#")
for (i=0;i<=9) disp=" 0";
else disp=" ";
disp+=min+":";
if(sec<=9) disp+="0"+sec;
else disp+=sec;
return(disp);
}
function Down() {
mins=1*Minutes(document.timex.given.value);
secs=0+Seconds(document.timex.given.value);
DownRepeat();
}
function DownRepeat() {
secs--;
if(secs==-1) {
secs=59; mins--;
}
document.timex.taken.value=Display(mins,secs);
if((mins==0)&&(secs==0)){
goExit=1;
return;
}
else down=setTimeout("DownRepeat()",1000);
}
if (navigator.appName !="Netscape"){
setInterval("moveback()",150);
function moveback(){
}
}
if (document.images) { img1=new Image(); img1.src="Resources/Images/arrow1.gif" }
function refresher()
{
if(!checkup){
checkup='1984';
}
refresh=checkup + "runs";
if(typeof(Storage)!=="undefined")
{
if (sessionStorage.refresh)
{
sessionStorage.refresh=Number(sessionStorage.refresh)+1;
newStarts=sessionStorage.refresh;
tries=newStarts;
}
else
{
sessionStorage.refresh=1;
newStarts=sessionStorage.refresh;
tries=newStarts;
}
}
else {
if (are_cookies_enabled())
{
rec();
}
else
{
newStarts=0;
tries=newStarts;
}
}
}
function rec(){
runsCounter=GetCookies(refresh)
if(runsCounter == null) {
SetCookies(refresh,'1','10')
return 1;
}
else {
var newcounter=parseInt(runsCounter) + 1;
DeleteCookies(refresh)
SetCookies(refresh,newcounter,'10')
return newcounter;
}
}
function GetCookies (name) {
var arg=name + "=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i < clen) {
var j=i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i=document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookies(name,value,nDays){
if (are_cookies_enabled())
{
try {
cookievalue=GetCookies("mycookie1");
newStarts=cookievalue;
tries=newStarts;
if (cookievalue==null) {
cookievalue=1
newStarts=1;
tries=newStarts;
}
}
catch (e) {
newStarts=0;
tries=newStarts;
}
cookievalue= parseInt(cookievalue)+1;
document.cookie='mycookie1='+cookievalue;
}
else
{
newStarts=0;
tries=newStarts;
}
}
function DeleteCookies (name) {
document.cookie=refresh + '=; expires=Thu, 03 Jan 1944 00:00:01 GMT;';
}
function getCookieVal(offset) {
var endstr=document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr=document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function are_cookies_enabled()
{
var cookieEnabled=(navigator.cookieEnabled) ? true : false;
if (typeof navigator.cookieEnabled == "undefined" && !cookieEnabled)
{
document.cookie="testcookie";
cookieEnabled=(document.cookie.indexOf("testcookie") != -1) ? true : false;
}
return (cookieEnabled);
}
function objectdata(hsize,vsize,isTrueImg,isFalseImg,mess){
this.mess=mess;
this.simg=new Image(hsize,vsize);
this.simg.src=isTrueImg;
this.rimg=new Image(hsize,vsize);
this.rimg.src=isFalseImg;
}
function trimString (str)
{ str=this != window? this : str; return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
//
-1) squiztitle=squiztitle.replace("'","`");
var sIncorrect=incorrectList;
while (sIncorrect.indexOf("'") > -1)
sIncorrect=sIncorrect.replace("'","`");
var sCorrect=correctList;
while (sCorrect.indexOf("'") > -1)
sCorrect=sCorrect.replace("'","`");
if (totaltried==0){
per="0%";
}
ShowScore(correctList, incorrectList, totalcorrect,totaltried,
totalincorrect,question, quiztitle, tries);
try{
if (SCORM == true){
return;}
}
catch(err) {}
display();
}
function hideScorm(){
var noInput=""; var debugText=document.getElementById("debugText");
if(debugText){ debugText.innerHTML=noInput;
}
}
function AlertCC(n,correctList, incorrectList, totalcorrect,totaltried,
totalincorrect,question, quiztitle, tries)
{
myname=n;
if (circular==0){
circular=10;
var submitWarning=(decodeIT("To use this option you must have a
standard email client installed on your computer (Outlook Express,
Outlook, Eudora etc.) Please note that you may encounter problems if
you are running an anti-virus software which blocks script-based
mailing. Please note also that submitting the results automatically
ends the quiz session!"));
var alertMessage="
INFORMATION
" + submitWarning +"
";
var showAlert=document.getElementById("divAlert");
//showAlert.style.top=fbY-420+scrollPosition;
document.getElementById("divAlert").innerHTML= alertMessage;
showAlert.style.top=fbY+scrollPosition;
showAlert.style.display ="inline";
return;
}
if(circular==10){
circular=0;
}
if (myname==null){
return;
}
var conInsert="";
var qInsert="";
var aInsert="";
var con1="";
var con2="";
if (showWeightQ==1){
qInsert="Positive weighting points for correctly answered questions: "
+ qWeightScore;
var pip="\n";
qInsert=qInsert+pip; }
if (showWeightA==1){
aInsert="Penalty weighting points for incorrect answers: " +
aWeightScore;
var pip="\n";
aInsert=aInsert+pip; }
if (con == 1){
con1="Confidence weighting of correctly answered questions: " +
cWeight2;
con2="Confidence weighting of incorrectly answered questions: " +
cWeight1;
var pip="\n";
con2=con2+pip;
con1=con1+pip;
}
tries=newStarts;
if(tries=="0"){
tries="Not recorded";
}
ema=1;
if (myname==null || myname==""){
myname="Unknown User";
}
var address="info@cropskgp.org.uk";
var quiztaker=myname;
var submitString= "'mailto:"+address+"?subject=Multiple Choice Quiz
Maker Results from "+quiztaker+" &NAME=supporter &METHOD=POST
&ENCTYPE=text/plain'>";
var re=/ /g;
submitString= submitString.replace(re,"%20");
myname=quizname+" " +myname;
per=(totaltried-totalincorrect)/question*100;
per=Math.round(per)+"%";
var squiztaker=quiztaker;
while (squiztaker.indexOf("'") > -1)
squiztaker=squiztaker.replace("'","`");
var squiztitle=quiztitle;
while (squiztitle.indexOf("'") > -1)
squiztitle=squiztitle.replace("'","`");
var sIncorrect=incorrectList;
while (sIncorrect.indexOf("'") > -1)
sIncorrect=sIncorrect.replace("'","`");
var sCorrect=correctList;
while (sCorrect.indexOf("'") > -1)
sCorrect=sCorrect.replace("'","`");
if (totaltried==0){
per="0%";
}
if (Amber==0){
setRunsCookie(0);
warning=false;
}
var m1="Results" +
jbegin +
"function disableselect(e){"+
"return false;"+
"} "+
"function reEnable(){"+
"return true;"+
"} "+
"document.onselectstart=new Function ('return false');"+
"if (window.sidebar && ua.indexOf('firefox') == -1){"+
"document.onmousedown=disableselect;"+
"document.onclick=reEnable;"+
"} "+
plonk+
"
";
var m7="
"+
""+
"
";
var m3="
Results
" +
"
"+
"
"; var unicate = m1+m2+m3+m4+m7+'';
unicate= encodeMyHtml(unicate);
var insersion="