// Grammar Monster © | Copyright Registration Number: 226604 | All rights reserved  


var q=1
var ans=1
var mid=""
var len=0
var rans=1
var rw=1
var choice="abcde"; chc=""; cl=1; chca = "eae--"
questin = new Array (50)
question = new Array (50)
qcheck = new Array (50)
questin[1] = "The abbreviation e.g. stands for:"
questin[2] = "The abbreviation i.e. stands for:"
questin[3] = "You can use a comma:"
questin[4] = "You should never use a semicolon before i.e."
questin[5] = "I love mints; e.g. Polos.  Therefore, I love:"
questin[6] = "I am scared of dogs; i.e. Jack Russells. Therefore, I am scared of:"
questin[7] = "Using etc. at the end of a list following e.g. is usually:"
questin[8] = "You must always follow i.e. and e.g. with a comma."
questin[9] = "I know rock stars; e.g. Bob Geldof.  Therefore, I know:"
questin[10] = "I know rock stars; i.e. Bob Geldof.  Therefore, I know:"
answer = new Array (200)
answr = new Array (200)
// answers to question 1
answr[1] = "#exempli gratia"
answr[2] = ".extra gratis"
answr[3] = ".example given"
answr[4] = "exempli gratia#E.g. is an abbreviation of the Latin term 'exempli gratia'.  It best translates as 'for example'."

// answers to question 2
answr[11] = ".in effect"
answr[12] = "#id est"
answr[13] = ".in extremis"
answr[14] = "id est#I.e. is an abbreviation of the Latin term 'id est'.  It best translates as 'that is'."


// answers to question 3
answr[21] = ".only before e.g."
answr[22] = ".only after e.g."
answr[23] = "#before and after e.g."
answr[24] = "before and after#There is a lot of leniency surrounding the use of e.g. and i.e. &nbsp;You can use a comma before and after.  You can omit the comma after the abbreviation if you wish.  You can use a semicolon before or you can place the whole thing in brackets.  Use the format that best assists the reader understand your sentence."

// answers to question 4
answr[31] = ".True"
answr[32] = "#Not true"
answr[33] = ".Only if your comma key is broken"
answr[34] = "Not true#You can use a semicolon before i.e. and e.g. &nbsp; In fact, there is a lot of leniency surrounding the use of e.g. and i.e. &nbsp;You can use a comma before and after.  You can omit the comma after the abbreviation if you wish.  You can even place the whole thing in brackets.  Use the format that best assists the reader understand your sentence."

// answers to question 5
answr[41] = ".Just Polos"
answr[42] = ".Polos and Everton mints"
answr[43] = "#Many types of mints, including Polos"
answr[44] = "Many types of mints, including Polos#e.g. means 'for example'.  The confectionary Polos is just a sample from the selection of mints you love."

// answers to question 6
answr[51] = ".All dogs"
answr[52] = ".All small dogs"
answr[53] = "#Jack Russells"
answr[54] = "Jack Russells#i.e. can be translated 'in other words'.  In this example, it has the effect of restating the previous statement."

// answers to question 7
answr[61] = ".dangerous for your PC"
answr[62] = "#redundant"
answr[63] = ".necessary"
answr[64] = "redundant#The examples you offer after using e.g. are usually samples from a more complete list. Therefore, it is often not appropriate to use 'etc.' after e.g. since it is understood that you only offering a partial list by way of example."

// answers to question 8
answr[71] = "#Not true"
answr[72] = ".Yes, that's right"
answr[73] = ".Only if it looks good"
answr[74] = "Not true#It is common to use a comma after e.g. and i.e., especially in the US. It is less common in the UK. There is a lot of leniency surrounding this issue.  Whatever format you use, be consistent."

// answers to question 9
answr[81] = ".Just Bob Geldof"
answr[82] = "#Some rock stars, including Bob Geldof"
answr[83] = ".Bob Geldof's mate's mate"
answr[84] = "Some rock stars, including Bob Geldof#e.g. means 'for example'.  Therefore, Bob Geldof is a sample of the rock stars I know."

// answers to question 10
answr[91] = "#Just Bob Geldof"
answr[92] = ".Many rock stars, including Bob Geldof"
answr[93] = ".Bob Geldof's mate's mate"
answr[94] = "Just Bob Geldof#i.e. can be translated 'in other words'.  In this example, it has the effect of restating the previous statement."


function chan(){

// select three random questions

q=1

for (i = 0; i < 11; i++){qcheck[i]=0} 

while (q<4){

var cl = Math.ceil(10*Math.random())

if (qcheck[cl]==0){
	qcheck[cl]=1;
	question[q]=questin[cl];
	rans=((q-1)*10)+1; ans=((cl-1)*10)+1;
	answer[rans]=answr[ans];
	answer[rans+1]=answr[ans+1];
	answer[rans+2]=answr[ans+2];
	answer[rans+3]=answr[ans+3];
	q++}
}


q=1; ans=1; rans=1; rw=1
var x=document.getElementById('myTable').rows
while (q<4){
// random number

var cl = Math.ceil(3*Math.random())

// assign MyTable to x and y
var y=x[rw].cells
y[0].innerHTML="<br><font color=blue><b>Q" + q + "</b></font>&nbsp; " + question[q];rw++
// count to three
while (rans<4){
len=answer[ans].length
// the correct answer loop
if (answer[ans].substr(0,1)=="#"){
mid=answer[ans].substring(1,len)
var y=x[rw].cells
y[((cl-1)*2)+1].innerHTML=choice.substr(cl-1,1) + ". " + mid;
// add the letter of the correct answer to the chc string
chc=chc+choice.substr(cl-1,1)
rans++;cl++;ans++;
if (cl==4){cl=1}
}
// the wrong answer loop
if (rans<4){
len=answer[ans].length
mid=answer[ans].substring(1,len)
var y=x[rw].cells
y[((cl-1)*2)+1].innerHTML=choice.substr(cl-1,1) + ". " + mid;
rans++; cl++; ans++;
if (cl==4){cl=1}
}
}
rans=1;ans=ans+7
q++; rw++; 
}
}
function look(){
var x=document.getElementById('myTable').rows
document.getElementById('buttons').innerHTML="<input type='button' value='Renew the test' style='background-color:#222299; color: #ffffff;' onClick='chang()'>"

// bogus answer

chca = "-----"

chosen = "-"
for (i = 0; i < 3; i++) {
if (document.frm.r1[i].checked) {
chosen = document.frm.r1[i].value
}
}
chca=chosen + chca.substr(1,4)

chosen = "-"
for (i = 0; i < 3; i++) {
if (document.frm.r2[i].checked) {
chosen = document.frm.r2[i].value
}
}
chca=chca.substr(0,1) + chosen + chca.substr(2,3)

chosen = "-"
for (i = 0; i < 3; i++) {
if (document.frm.r3[i].checked) {
chosen = document.frm.r3[i].value
}
}
chca=chca.substr(0,2) + chosen + chca.substr(3,2)

cl=0; rw=0; chosen = "";
len=chc.length + 1
for (start=1; start < len; start++){
if (chca.substr(start-1,1)==chc.substr(start-1,1)){
 cl++;  mid="<img border=0 src=../images/bultick.gif width=11 height=11>"
 chosen=chosen + start + ":" + "<font color=green><b>" + chca.substr(start-1,1) + "</b></font>&nbsp; "}
 
else if (chca.substr(start-1,1)=="-"){mid=" <font color=red>no selection</font> <img border=0 src=../images/bulx.gif width=11 height=11>&nbsp;&nbsp;&nbsp;&nbsp;<span style='background-color: #FFFF00'>[<span onclick='shw(" + start + ",event)' class=curs>explanation</span>]</span>"; chosen=chosen + start + ":" + "<font color=black>nil</font>&nbsp; "}
else {mid="<img border=0 src=../images/bulx.gif width=11 height=11>&nbsp;&nbsp;&nbsp;&nbsp;<span style='background-color: #FFFF00'>[<span onclick='shw(" + start + ",event)' class=curs>explanation</span>]</span>"
chosen=chosen + start + ":" + "<font color=red><b>" + chca.substr(start-1,1) + "</b></font>&nbsp; "}


rw=start*2-1
var y=x[rw].cells
y[0].innerHTML="<br><font color=blue><b>Q" + start + "</b></font>&nbsp; " + question[start] + " " + mid
}
rw=start*2-1
var y=x[rw].cells
y[0].innerHTML="You selected: " + chosen + "<table border=0 cellspacing=0 cellpadding=0><tr><tr><td background='../images/yourscore.jpg' width=124 height=65 align=center valign=middle><b class=big>" + cl + "/" + (q-1) + "</b></td></tr></table>"}


function shw(q, e){

mid = answer[((q-1)*10)+4]


var posx = 0;
var posy = 0;

  // Get mouse position; IE & FF Compatibility!
  if (e.pageX || e.pageY)
  {
    posx = e.pageX;
    posy = e.pageY;
  }
  else if (e.clientX || e.clientY)
  {
    posx = e.clientX + document.body.scrollLeft
      + document.documentElement.scrollLeft;
    posy = e.clientY + document.body.scrollTop
      + document.documentElement.scrollTop;}

if (posx > 860){posx = 860}


document.getElementById('popup').style.left = parseInt(posx);
document.getElementById('popup').style.top = parseInt(posy);
document.getElementById('popup').style.display = 'block';

document.getElementById('popup').innerHTML="<table border=0 width=321 cellpadding=3 cellspacing=0 background='../images/footer.jpg' style='border: 6px solid #0000FF'><tr><th align=left width=311 style='color:white'><font color=yellow>THE ANSWER</font><br><br>&quot;<span id='toppmsg'></span>&quot; <img border=0 src=../images/bultickl.gif width=11 height=11></th><td width=20 align=right valign=top><span onclick='clos()'><img border=0 src=../images/close.gif width=15 height=15></span></td></tr><tr><th align=left colspan=2 style='color: white'><br><font color=yellow>WHY?</font><br><br><span id='btmmsg'></span></th></tr></table>"

len=mid.indexOf('#')

document.getElementById('toppmsg').innerHTML="<font color=white>" + mid.substr(0,len) + "</font>";
document.getElementById('btmmsg').innerHTML="<font color=white>" + mid.substr(len+1, (mid.length)+1) + "</font>";
}

function clos(){
document.getElementById('popup').innerHTML="";}

function chang(){
var x=document.getElementById('myTable').rows
var y=x[7].cells
y[0].innerHTML="&nbsp"
document.getElementById('buttons').innerHTML="<input type='button' value='Renew the test' style='background-color: #222299; color: #ffffff;' onClick='chang()'><input type='reset' value='Clear my answers'style='background-color:#222299; color: #ffffff;'><br><input type='button' value='Check my answers' style='background-color:GREEN; color: #ffffff;' onclick='look()'>";
var q=1
var ans=1
var mid=""
var len=0
var rans=1
var rw=1
var choice="abcde"; chc=""; cl=1; chca = "eae--"
clos()
chan()}







































