// 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] = "This word means to apportion or distribute. "
questin[2] = "This means a large extent, a large amount or a large number. "
questin[3] = "This words does not exist. "
questin[4] = "Replace the bold word:  There are <b>many</b> whales here nowadays. "
questin[5] = "Replace the bold word: Can you <b>apportion</b> the money as discussed? "
questin[6] = "Replace the bold words: I am <b>handing out</b> the resources in line with the original plan. "
questin[7] = "Replace the bold word:  I could give you <b>dozens of</b> reasons. "
questin[8] = "Never write this word: "
questin[9] = "Replace the bold words: She goes out <b>often</b>. "
questin[10] = "Replace the bold word: You must <b>give</b> each member enough time to make a case. " 
answer = new Array (200)
answr = new Array (200)
// answers to question 1
answr[1] = "#allot"
answr[2] = ".alott"
answr[3] = ".a lot"
answr[4] = "allot#The verb 'allot' means to apportion, divide or distribute something. (Note: It is spelt with two Ls and one T.)"

// answers to question 2
answr[11] = ".allot"
answr[12] = "#a lot"
answr[13] = ".alot"
answr[14] = "a lot#'A lot' means a large extent, a large amount or a large number. It is written as two words. (Note: The word alot does not exist.)"


// answers to question 3
answr[21] = ".alloted"
answr[22] = ".a lot"
answr[23] = "#alot"
answr[24] = "alot#'Alot' is often written erroneously is place of 'a lot'.  'Alot' (with one L) does not exist."

// answers to question 4
answr[31] = ".alot of"
answr[32] = "#a lot of"
answr[33] = ".allot of"
answr[34] = "a lot of#'A lot' means a large extent, a large amount or a large number. It is written as two words. (Note: The word alot does not exist.)"

// answers to question 5
answr[41] = ".alott"
answr[42] = ".alot"
answr[43] = "#allot"
answr[44] = "allot#The verb 'allot' means to apportion, divide or distribute something. (Note: It is spelt with two Ls and one T.)"

// answers to question 6
answr[51] = ".alloting"
answr[52] = ".aloting"
answr[53] = "#allotting"
answr[54] = "allotting#The verb 'allot' means to apportion, divide or distribute something. (Note: 'Allotting' is spelt with two Ls and two Ts ). "

// answers to question 7
answr[61] = ".alot of"
answr[62] = "#a lot of"
answr[63] = ".allot of"
answr[64] = "a lot of#'A lot' means a large extent, a large amount or a large number. It is written as two words. (Note: The word alot does not exist.)"

// answers to question 8
answr[71] = "#alot"
answr[72] = ".allot"
answr[73] = ".allotted"
answr[74] = "alot#'Alot' is often written erroneously is place of 'a lot'.  'Alot' (with one L) does not exist. (Note: 'Allotting' and 'allotted' are spelt with two Ls and two Ts ). "


// answers to question 9
answr[81] = ".alot"
answr[82] = "#a lot"
answr[83] = ".allot"
answr[84] = "a lot#'A lot' means a large extent, a large amount or a large number. It is written as two words. (Note: The word alot does not exist.) In this example, 'a lot' is an adverb."

// answers to question 10
answr[91] = ".alot"
answr[92] = "#allot"
answr[93] = ".a lot"
answr[94] = "allot#The verb 'allot' means to apportion, divide or distribute something. (Note: It is spelt with two Ls and one T.)"


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;}

posx = posx - 140
posy = posy - 148

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=350 cellpadding=0 cellspacing=0><tr><td><img src='../images/callout_top.gif' border='0' usemap='#smap'><map name='smap' id='smap'><area	shape='rect' coords='323,12,338,26' href='javascript: clos()'/></map></td></tr></table><table border=0 width=350 cellpadding=0 cellspacing=0 background='../images/callout_mid.gif'><tr><td><table cellpadding='7' cellspacing=0><tr><td valign='top'>&quot;<span id='toppmsg'></span>&quot; <img src='../images/bultik.gif'><h2>Why?</h2><span id='btmmsg'></span></td></tr></table></td></tr></table><table border=0 width=350 cellpadding=0 cellspacing=0><tr><td><img src='../images/callout_bot.gif' border='0'></td></tr></table>"

len=mid.indexOf('#')

document.getElementById('toppmsg').innerHTML=mid.substr(0,len);
document.getElementById('btmmsg').innerHTML=mid.substr(len+1, (mid.length)+1);
}

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








































