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

selec = new Array (100)
ans = new Array (100)
selec[11]="-Yes Mark, that's correct. |#Yes, Mark, that's correct."
selec[12]="#2,345.7 |-23,45.7"
selec[13]="#As a result, we cannot afford the trip on Friday. |=As a result we cannot afford the trip on Friday."
selec[14]="#The grateful janitor opened his present once the children had left. |=The grateful janitor opened his present, once the children had left."
selec[15]="=Morris carried the ladders and his partner cleaned the windows. |#Morris carried the ladders, and his partner cleaned the windows."
selec[16]="#She leapt to her feet and screamed, 'Get off that table!' |=She leapt to her feet and screamed: 'Get off that table!'"
selec[17]="#Claire, on the other hand, is a very tidy person. |=Claire on the other hand, is a very tidy person."
selec[18]="#Please order ink cartridges, paper, memo pads and screen wipes. |=Please order ink cartridges, paper, memo pads, and screen wipes."
selec[19]="=Her husband just said: 'No. Mrs Jenkins will not be attending today.' |#Her husband just said: 'No, Mrs Jenkins will not be attending today.'"

ans[11]="commas_with_vocative_case.htm'>Commas with the vocative case"
ans[12]="commas_with_numbers.htm'>Commas with numbers"
ans[13]="commas_after_a_transitional_phrase.htm'>Commas after transitional phrases"
ans[14]="commas_after_a_sentence_introduction.htm'>Commas after sentence introductions"
ans[15]="commas_before_conjunctions.htm'>Commas before conjunctions (and, or, but)"
ans[16]="commas_with_quotation_(speech)_marks.htm'>Commas with quotation (speech) marks"
ans[17]="commas_for_parenthesis.htm'>Commas for parenthesis"
ans[18]="commas_in_lists.htm'>Commas in lists"
ans[19]="commas_after_interjections.htm'>Commas after interjections (yes, no, indeed)"


selec[21]="#She whined, 'No, anything but water.' |=She whined: 'No, anything but water.'"
selec[22]="#Do me a favour, Tommy. |-Do me a favour Tommy."
selec[23]="=Therefore the bridge is more vulnerable in winter. |#Therefore, the bridge is more vulnerable in winter."
selec[24]="#The band will start up at 4 o'clock on Wednesday. |=The band will start up, at 4 o'clock on Wednesday."
selec[25]="=She must be able to sing and she must be able to dance. |#She must be able to sing, and she must be able to dance."
selec[26]="#123,446,016.72 |-123446,0016.72"
selec[27]="=Mark as it happens, will be available from midnight. |#Mark, as it happens, will be available from midnight."
selec[28]="#Take the show to Leeds, Newcastle and Sunderland. |=Take the show to Leeds, Newcastle, and Sunderland."
selec[29]="=After 30 minutes take the cake out of the oven. |#After 30 minutes, take the cake out the oven."

ans[21]="commas_with_quotation_(speech)_marks.htm'>Commas with quotation (speech) marks"
ans[22]="commas_with_vocative_case.htm'>Commas with the vocative case"
ans[23]="commas_after_a_transitional_phrase.htm'>Commas after transitional phrases"
ans[24]="commas_after_a_sentence_introduction.htm'>Commas after sentence introductions"
ans[25]="commas_before_conjunctions.htm'>Commas before conjunctions (and, or, but)"
ans[26]="commas_with_numbers.htm'>Commas with numbers"
ans[27]="commas_for_parenthesis.htm'>Commas for parenthesis"
ans[28]="commas_in_lists.htm'>Commas in lists"
ans[29]="commas_after_a_sentence_introduction.htm'>Commas after sentence introductions"


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 < 10; 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+".jpg><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++}


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


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


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


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

for (k = 1; k < 10; 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 9<br><br>"





document.getElementById('buttons').innerHTML="<input type='button' value='Next test' style='background-color: #222299; color: #ffffff;' onClick='nexttest()'>"
}























































