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

selec = new Array (100)
ans = new Array (100)
selec[11]="#Dr Pinner added: &quot;The crew ate rats and the fish they caught.&quot; |=Dr Pinner added, &quot;The crew ate rats and the fish they caught.&quot;"
selec[12]="#Dan said that it was the worst outbreak of measles ever in Kent. |=Dan said &quot;that it was the worst outbreak of measles ever in Kent.&quot;"
selec[13]="#Did Malcolm say, &quot;4 cheese-and-onion pasties&quot;? |=Did Malcolm say, &quot;4 cheese-and-onion pasties?&quot;"
selec[14]="#She yelled: &quot;I have already seen &quot;Phantom of the Opera&quot; twice.&quot; |#She yelled: &quot;I have already seen 'Phantom of the Opera' twice.&quot;"
selec[15]="=Over 50,000 bacteria were found on the &quot;clean&quot; surface. |#Over 50,000 bacteria were found on the so-called &quot;clean&quot; surface." 

ans[11]="quotation_(speech)_marks_colon_or_comma.htm'>Colon or comma before quotation (speech) marks?"
ans[12]="quotation_(speech)_marks_colon_or_comma.htm'>Reported speech (read the 'Beware' section on the right)"
ans[13]="quotation_(speech)_marks_punctuation_in_or_out.htm'>Punctuation inside or outside quotation (speech) marks?"
ans[14]="quotation_(speech)_marks_single_or_double.htm'>Double or single quotation (speech) marks?"
ans[15]="quotation_(speech)_marks_meaning_alleged_so-called.htm'>Quotation marks meaning 'alleged' or 'so called'"






selec[21]="=His so-called &quot;mates&quot; left him to freeze in the doorway. |#His &quot;mates&quot; left him to freeze in the doorway."
selec[22]="#The lawyer claimed: &quot;Simon screamed, 'I was not speeding' three times.&quot; |#The lawyer claimed: &quot;Simon screamed, &quot;I was not speeding&quot; three times.&quot;"
selec[23]="#Did she actually say, &quot;Don't call us. We'll call you&quot;? |=Did she actually say, &quot;Don't call us. We'll call you?&quot;"
selec[24]="=&quot;This is not a library. If you're not going to buy it, leave it&quot: she snarled. |#&quot;This is not a library. If you're not going to buy it, leave it&quot, she snarled."
selec[25]="#She snarled: &quot;This is not a library. If you're not going to buy it, leave it.&quot |=She snarled, &quot;This is not a library. If you're not going to buy it, leave it.&quot."

ans[21]="quotation_(speech)_marks_meaning_alleged_so-called.htm'>Quotation marks meaning 'alleged' or 'so called'"
ans[22]="quotation_(speech)_marks_single_or_double.htm'>Double or single quotation (speech) marks?"
ans[23]="quotation_(speech)_marks_punctuation_in_or_out.htm'>Punctuation inside or outside quotation (speech) marks?"
ans[24]="quotation_(speech)_marks_colon_or_comma.htm'>Colon or comma before quotation (speech) marks?"
ans[25]="quotation_(speech)_marks_colon_or_comma.htm'>Colon or comma before quotation (speech) marks?"


var chosen = ""; var len = 0; var perv = ""; var vtor = ""; var shw = ""; var qu = 0; var short = 0; var pervans = ""; var vtorans = ""; var tot = 0; var set = 0; var wher = ""

len = Math.ceil(2*Math.random()); set = len*10

function text(){
for (k = 1; k < 6; k++){
chosen = selec[k + set]
len=chosen.indexOf('|')
if (chosen.substr(0,1)=="-" || chosen.substr(len+1,1)=="-"){short=1}
qu++; shw = shw + "<img src=../images/q"+qu+".gif><span id=msg" + qu + "></span><span id=les" + qu + "></span><br>"
perv = chosen.substr(1,len-1)
vtor = chosen.substr(len+2, (chosen.length))
if (chosen.substr(0,1)=="-" || chosen.substr(0,1)=="="){pervans = "wrong"; vtorans = "right"} 
else {pervans = "right"; vtorans = "wrong"} 
if (short==0){shw = shw + "<Input type = radio Name = r" + qu + " Value = '"+ pervans +"'>" + perv + "<br>";}
if (short==1){shw = shw + "<Input type = radio Name = r" + qu + " Value = '"+ pervans +"'>" + perv + "&nbsp;&nbsp;";}
shw = shw + "<Input type = radio Name = r" + qu + " Value = '" + vtorans +"'>" + vtor + "<br>";
short = 0; 
}
document.getElementById('topmsg').innerHTML=shw;
}


function cler(){
chosen = ""; len = 0; perv = ""; vtor = ""; shw = ""; qu=0; short = 0; pervans = ""; vtorans = ""; tot = 0
document.getElementById('btmmsg').innerHTML="";
text()
}


function nexttest(){
qu = 0
document.getElementById('buttons').innerHTML="<input type='button' value='Next test' style='background-color: #222299; color: #ffffff;' onClick='nexttest()'><input type='button' value='Clear my answers' style='background-color:#222299; color: #ffffff;' onclick='cler()'><input type='button' value='Check my answers' style='background-color:GREEN; color: #ffffff;' onclick='look()'>"
if (set==10){set=20; qu=1}
if (set==20 && qu==0) {set=10}
cler()
}



function look() {
tot = 0; qu = 0; short = 0
if (document.frm.r1[0].checked && document.frm.r1[0].value=="right"){
document.getElementById('msg1').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot=tot+100}
else { 
document.getElementById('msg1').innerHTML="&nbsp;<img src=../images/bulx.gif>";}
if (document.frm.r1[1].checked && document.frm.r1[1].value=="right"){
document.getElementById('msg1').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot++} 

if (document.frm.r2[0].checked && document.frm.r2[0].value=="right"){
document.getElementById('msg2').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot=tot+100}
else { 
document.getElementById('msg2').innerHTML="&nbsp;<img src=../images/bulx.gif>";}
if (document.frm.r2[1].checked && document.frm.r2[1].value=="right"){
document.getElementById('msg2').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot++}


if (document.frm.r3[0].checked && document.frm.r3[0].value=="right"){
document.getElementById('msg3').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot=tot+100}
else { 
document.getElementById('msg3').innerHTML="&nbsp;<img src=../images/bulx.gif>";}
if (document.frm.r3[1].checked && document.frm.r3[1].value=="right"){
document.getElementById('msg3').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot++}


if (document.frm.r4[0].checked && document.frm.r4[0].value=="right"){
document.getElementById('msg4').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot=tot+100}
else { 
document.getElementById('msg4').innerHTML="&nbsp;<img src=../images/bulx.gif>";}
if (document.frm.r4[1].checked && document.frm.r4[1].value=="right"){
document.getElementById('msg4').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot++}

if (document.frm.r5[0].checked && document.frm.r5[0].value=="right"){
document.getElementById('msg5').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot=tot+100}
else { 
document.getElementById('msg5').innerHTML="&nbsp;<img src=../images/bulx.gif>";}
if (document.frm.r5[1].checked && document.frm.r5[1].value=="right"){
document.getElementById('msg5').innerHTML="&nbsp;<img src=../images/bultick.gif>";tot++}


for (k = 1; k < 6; k++){
wher = "les" + k
document.getElementById(wher).innerHTML="<span class='small'>&nbsp;Associated lesson <a target='_blank' href='../lessons/" + ans[k + set] + "</a></span>"
}


qu = parseInt(tot/100); short = tot - (qu*100); tot = qu + short

document.getElementById('btmmsg').innerHTML="&nbsp;You scored " + tot + " out of 5<br><br>"
document.getElementById('buttons').innerHTML="<input type='button' value='Next test' style='background-color: #222299; color: #ffffff;' onClick='nexttest()'>"
}
























































