// 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] = "I cannot take you <b>???</b> on Tuesday. "
questin[2] = "All <b>???</b> tickets were sold in 20 minutes. "
questin[3] = "I know <b>???</b> a pain, but you'll have to put up with them. "
questin[4] = "<b>???</b> wearing jeans on their heads. "
questin[5] = "<b>???</b> leaving at 9 o'clock. "
questin[6] = "Do you know <b>???</b> secret recipe? "
questin[7] = "I know <b>???</b> must be a solution. "
questin[8] = "The two boys reached for <b>???</b> penknives. "
questin[9] = "Give me an hour to look at <b>???</b> response. "
questin[10] = "The boss is seeking assurance that <b>???</b> on the right track. " 
answer = new Array (200)
answr = new Array (200)
// answers to question 1
answr[1] = "#there"
answr[2] = ".they're"
answr[3] = ".their"
answr[4] = "I cannot take you there...#The word 'there' is similar to the word 'here' in that it represents a place.  In this example, it could be substituted with 'to that place'. I cannot take you <font color=yellow>to that place</font>."

// answers to question 2
answr[11] = ".there"
answr[12] = "#their"
answr[13] = ".they're"
answr[14] = "All their tickets...#The word 'their' is used for possession (e.g. Whose are these tickets?  They are <b>their</b> tickets.) It is just like my, your, his, her, its and our.  (These are called 'possessive adjectives'.)"


// answers to question 3
answr[21] = ".their"
answr[22] = ".there"
answr[23] = "#they're"
answr[24] = "I know they're a pain...#<font color=yellow>They're</font> is a shortened version of <font color=yellow>they are</font>. (The apostrophe replaces the letter <font color=yellow>a</font>.) Only use <font color=yellow>they're</font> if you can substitute it with <font color=yellow>they are</font>.  This is a 100% rule. "

// answers to question 4
answr[31] = ".There"
answr[32] = "#They're"
answr[33] = ".Their"
answr[34] = "They're wearing jeans...#<font color=yellow>They're</font> is a shortened version of <font color=yellow>they are</font>. (The apostrophe replaces the letter <font color=yellow>a</font>.) Only use <font color=yellow>they're</font> if you can substitute it with <font color=yellow>they are</font>.  This is a 100% rule. "

// answers to question 5
answr[41] = ".Their"
answr[42] = ".There"
answr[43] = "#They're"
answr[44] = "They're leaving...#<font color=yellow>They're</font> is a shortened version of <font color=yellow>they are</font>. (The apostrophe replaces the letter <font color=yellow>a</font>.) Only use <font color=yellow>they're</font> if you can substitute it with <font color=yellow>they are</font>.  This is a 100% rule. "

// answers to question 6
answr[51] = ".they're"
answr[52] = ".thier"
answr[53] = "#their"
answr[54] = "Do you know their secret recipe?#The word 'their' is used for possession.  In this example, it tells us that the receipe belongs to them (i.e. it is theirs - it's their recipe). The word 'their' is just like my, your, his, her, its and our.  (These are called 'possessive adjectives'.) "

// answers to question 7
answr[61] = ".they're"
answr[62] = "#there"
answr[63] = ".their"
answr[64] = "I know there must be a solution.#The word 'there' is similar to the word 'here' in that it represents a place.  It has two main uses:<br>(1) It is a specified place (e.g. The apple is <b>there</b>. Take me <b>there</b>.)<br>(2) It is an unspecified place and is often to used to show something exists (e.g. <b>There</b> is an apple. <b>There</b> is concern.)<br>In this example, the writer is certain that a solution exists (i.e. <b>There</b> must be one.) "

// answers to question 8
answr[71] = "#their"
answr[72] = ".there"
answr[73] = ".they're"
answr[74] = "...reached for their penknives.#The word 'their' is used for possession.  In this example, it tells us that the penknives belong to them (i.e. they are theirs - they are their penknives). The word 'their' is just like my, your, his, her, its and our.  (These are called 'possessive adjectives'.) "


// answers to question 9
answr[81] = ".there"
answr[82] = "#their"
answr[83] = ".they're"
answr[84] = "...to look at their response.#The word 'their' is used for possession (e.g. Whose response?  <b>Their</b> response.)  The word 'their' is just like my, your, his, her, its and our.  (These are called 'possessive adjectives'.) "


// answers to question 10
answr[91] = ".their"
answr[92] = "#they're"
answr[93] = ".there"
answr[94] = "... that they're on the right track.#<font color=yellow>They're</font> is a shortened version of <font color=yellow>they are</font>. (The apostrophe replaces the letter <font color=yellow>a</font>.) Only use <font color=yellow>they're</font> if you can substitute it with <font color=yellow>they are</font>.  This is a 100% rule. "


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()}







































