var  isNS = window.navigator.appName.toLowerCase().indexOf("netscape")!= -1 ;

p1=5; p2=3; p3=3; p4=1; p5=2; p6=0; p7=5; p8=5; p9=8; p10=5; p11=12; p12=1; p13=2; p14=8;
p15=7; p16=6; p17=2; p18=5;
p19=7; p20=12; p21=""; p22="e"; p23=9; p24=19; p25=""; p26=""; p27=4; p28="e"; p29="gt";
p30=1; p31=5; p32=3; p33=8; p34=2; p35=3; p36=1; p37=7;
p38=7; p39=10; p40=21; p41=50; p42=47; p43=100; p44=0.2; p45=0.75; p46=0.375; p47=30; p48=12.5; p49=6.5;

function randint(lowlimit,highlimit)
{
	result = Math.floor(lowlimit+Math.random()*(highlimit-lowlimit+1))
	return(result);
}

function randenom()
{
	num2s=randint(0,3);
	if (num2s==0) {num5s=randint(1,2)} else {num5s=randint(0,2)}
	result=1;
	for (count=1; count<=num2s; count++) {result=result*2}
	for (count=1; count<=num5s; count++) {result=result*5}
	return(result);
}

function simp(f1,f2)
{
	if (f1==1) {result=true}
	else
	{
		result=true;
		for (count=2; count<=f1; count++)
		{
			if (f1%count==0 && f2%count==0) {result=false} ;
		}
	}
	return result;
}

function fraceq(id1,id2,val)
{
	f1 = document.forms.qf.elements[id1].value;
	f2 = document.forms.qf.elements[id2].value;
	if (Math.round(f1)==f1 && Math.round(f2)==f2 && (f1/f2==val) && simp(f1,f2)) {result=true} else {result=false};
	return result;
}

function randomise()
{
	p1=randint(1,9); p2=randint(1,8);
	p3=0; while (p3==0 || p3==1 || p3==4 || p3==9) {p3=randint(1,9)}
	p5=randint(2,9); p4=0; while (p4==0 || !simp(p4,p5)) {p4=randint(1,p5-1)}
	p6=randint(0,9); p7=randint(1,9);
	p9=randint(2,9); p8=0; while (p8==0 || !simp(p8,p9)) {p8=randint(1,p9-1)}
	p10=randint(1,9);
	p11=randint(10,19); p13=randint(2,9); p12=0; while (p12==0 || !simp(p12,p13)) {p12=randint(1,p13-1)}
	p14=randint(1,9);
	p15=randint(4,6); p16=randint(p15+1,9); p17=randint(1,p15-1); p18=p16; while (p18==p16) {p18=randint(1,9)};
	p19=randint(1,10); p20=randint(p19+2,19); if (Math.random()>0.5) {p21=""} else {p21="e"}; if (Math.random()>0.5) {p22=""} else {p22="e"};
	p23=randint(1,10); p24=randint(p23+2,19); if (Math.random()>0.5) {p25=""} else {p25="e"}; if (Math.random()>0.5) {p26=""} else {p26="e"};
	p27=randint(2,18); if (Math.random()>0.5) {p28=""} else {p28="e"}; if (Math.random()>0.5) {p29="gt"} else {p29="lt"};
//	p31=randint(2,9); p30=0; while (p30==0 || !simp(p30,p31)) {p30=randint(1,p31-1)}
//	p33=0; p32=0; while ( ((p33==0) && (p32==0)) || ((p32==p30) && (p33==p31)) )
//			{ p33=randint(2,9); p32=0; while (p32==0 || !simp(p32,p33)) {p32=randint(1,p33-1)} }
//	p35=0; p34=0; while ( ((p35==0) && (p34==0)) || ((p34==p30) && (p35==p31)) || ((p34==p32) && (p35==p33)) )
//			{ p35=randint(2,9); p34=0; while (p34==0 || !simp(p34,p35) ) {p34=randint(1,p35-1)} }
//	p37=0; p36=0; while ( ((p37==0) && (p36==0)) || ((p36==p30) && (p37==p31)) || ((p36==p32) && (p37==p33)) || ((p36==p34) && (p37==p35)) )
//			{ p37=randint(2,9); p36=0; while (p36==0 || !simp(p36,p37) ) {p36=randint(1,p37-1)} }
	p31=randint(2,9); p30=0; while (p30==0 || !simp(p30,p31)) {p30=randint(1,p31-1)}
	p33=0; p32=0; while ( ((p33==0) && (p32==0)) || (p33==p31) )
			{ p33=randint(2,9); p32=0; while (p32==0 || !simp(p32,p33)) {p32=randint(1,p33-1)} }
	p35=0; p34=0; while ( ((p35==0) && (p34==0)) || (p35==p31) || (p35==p33) )
			{ p35=randint(2,9); p34=0; while (p34==0 || !simp(p34,p35) ) {p34=randint(1,p35-1)} }
	p37=0; p36=0; while ( ((p37==0) && (p36==0)) || (p37==p31) || (p37==p33) || (p37==p35) )
			{
				if ( (p31!=3) && (p33!=3) && (p35!=3) && (p31!=7) && (p33!=7) && (p35!=7) && (p31!=9) && (p33!=9) && (p35!=9) ) 
					{ p37sel = randint(1,3); p37 = (7 * p37sel) - 3 - (p37sel * p37sel) }
				else
					{ p37=randint(2,9) }
				p36=0; while (p36==0 || !simp(p36,p37) ) {p36=randint(1,p37-1)}
			}
	p39=randenom(); p38=0; while (p38==0 || !simp(p38,p39)) {p38=randint(1,p39-1)}
	p41=randenom(); p40=0; while (p40==0 || !simp(p40,p41)) {p40=randint(1,p41-1)}
	p43=randenom(); p42=0; while (p42==0 || !simp(p42,p43)) {p42=randint(1,p43-1)}
	rd=randenom(); rn=0; while (rn==0 || !simp(rn,rd)) {rn=randint(1,rd-1)}; p44=Math.round(rn/rd*1000)/1000;
	rd=randenom(); rn=0; while (rn==0 || !simp(rn,rd)) {rn=randint(1,rd-1)}; p45=Math.round(rn/rd*1000)/1000;
	rd=randenom(); rn=0; while (rn==0 || !simp(rn,rd)) {rn=randint(1,rd-1)}; p46=Math.round(rn/rd*1000)/1000;
	rd=randenom(); rn=0; while (rn==0 || !simp(rn,rd)) {rn=randint(1,rd-1)}; p47=Math.round(rn/rd*10000)/100;
	rd=randenom(); rn=0; while (rn==0 || !simp(rn,rd)) {rn=randint(1,rd-1)}; p48=Math.round(rn/rd*10000)/100;
	rd=randenom(); rn=0; while (rn==0 || !simp(rn,rd)) {rn=randint(1,rd-1)}; p49=Math.round(rn/rd*10000)/100;
}

var dq='"';
var sq="'";

randomise();

var testchecked=false;

correct = new Image();
correct.src = "correct18.gif";
wrong = new Image();
wrong.src = "wrong18.gif";
clicbutt = new Image();
clicbutt.src = "clicbutt.gif";

var errorlist = "TTA_A1";

<!-- QUESTION CHECK PROCEDURES -->

function checkQ1()
{
	params = "-"+p1+"."+p2+"r | sqrt("+p3+") | "+p4+"/"+p5+" | "+p6+"."+p7+" | 0 | -"+p8+"/"+p9+" | pi | "+p10+" | "+p11+"&"+p12+"/"+p13+" | -"+p14;

	tnr = ""; wnt = "";
	score1a=0; wr1a=0;
	if (document.forms.qf.elements.q001.checked) {document.images["c001"].src=wrong.src; wr1a++; tnr = tnr+"a1"}
	if (document.forms.qf.elements.q002.checked) {document.images["c002"].src=wrong.src; wr1a++; tnr = tnr+"a2"}
	if (document.forms.qf.elements.q003.checked) {document.images["c003"].src=wrong.src; wr1a++; tnr = tnr+"a3"}
	if (document.forms.qf.elements.q004.checked) {document.images["c004"].src=wrong.src; wr1a++; tnr = tnr+"a4"}
	if (document.forms.qf.elements.q005.checked) {document.images["c005"].src=wrong.src; wr1a++; tnr = tnr+"a5"}
	if (document.forms.qf.elements.q006.checked) {document.images["c006"].src=wrong.src; wr1a++; tnr = tnr+"a6"}
	if (document.forms.qf.elements.q007.checked) {document.images["c007"].src=wrong.src; wr1a++; tnr = tnr+"a7"}
	if (!document.forms.qf.elements.q008.checked) {document.images["c008"].src=wrong.src; wnt = wnt+"a7"} else {document.images["c008"].src=correct.src; score1a++}
	if (document.forms.qf.elements.q009.checked) {document.images["c009"].src=wrong.src; wr1a++; tnr = tnr+"a9"}
	if (document.forms.qf.elements.q010.checked) {document.images["c010"].src=wrong.src; wr1a++; tnr = tnr+"a10"}
	if ( (tnr!="") || (wnt!="") )
	{
		if ( (wnt=="a7") && (tnr=="") )
			{ errorlist = errorlist + "#1a#natural? "+params+"#apparently not attempted" }
		else
			{ errorlist = errorlist + "#1a#natural? "+params+"#TNR: "+tnr+" WNT: "+wnt }
	}

	tnr = ""; wnt = "";
	score1b=0; wr1b=0;
	if (!document.forms.qf.elements.q011.checked) {document.images["c011"].src=wrong.src; wnt = wnt+"b1"} else {document.images["c011"].src=correct.src; score1b++}
	if (document.forms.qf.elements.q012.checked) {document.images["c012"].src=wrong.src; wr1b++; tnr = tnr+"b2"}
	if (!document.forms.qf.elements.q013.checked) {document.images["c013"].src=wrong.src; wnt = wnt+"b3"} else {document.images["c013"].src=correct.src; score1b++}
	if (!document.forms.qf.elements.q014.checked) {document.images["c014"].src=wrong.src; wnt = wnt+"b4"} else {document.images["c014"].src=correct.src; score1b++}
	if (!document.forms.qf.elements.q015.checked) {document.images["c015"].src=wrong.src; wnt = wnt+"b5"} else {document.images["c015"].src=correct.src; score1b++}
	if (!document.forms.qf.elements.q016.checked) {document.images["c016"].src=wrong.src; wnt = wnt+"b6"} else {document.images["c016"].src=correct.src; score1b++}
	if (document.forms.qf.elements.q017.checked) {document.images["c017"].src=wrong.src; wr1b++; tnr = tnr+"b7"}
	if (!document.forms.qf.elements.q018.checked) {document.images["c018"].src=wrong.src; wnt = wnt+"b8"} else {document.images["c018"].src=correct.src; score1b++}
	if (!document.forms.qf.elements.q019.checked) {document.images["c019"].src=wrong.src; wnt = wnt+"b9"} else {document.images["c019"].src=correct.src; score1b++}
	if (!document.forms.qf.elements.q020.checked) {document.images["c020"].src=wrong.src; wnt = wnt+"b10"} else {document.images["c020"].src=correct.src; score1b++}
	if ( (tnr!="") || (wnt!="") )
	{
		if ( (wnt=="b1b3b4b5b6b8b9b10") && (tnr=="") )
			{ errorlist = errorlist + "#1b#rational? "+params+"#apparently not attempted" }
		else
			{ errorlist = errorlist + "#1b#rational? "+params+"#TNR: "+tnr+" WNT: "+wnt }
	}

	tnr = ""; wnt = "";
	score1c=0; wr1c=0;
	if (document.forms.qf.elements.q021.checked) {document.images["c021"].src=wrong.src; wr1c++; tnr = tnr+"c1"}
	if (!document.forms.qf.elements.q022.checked) {document.images["c022"].src=wrong.src; wnt = wnt+"c2"} else {document.images["c022"].src=correct.src; score1c++}
	if (document.forms.qf.elements.q023.checked) {document.images["c023"].src=wrong.src; wr1c++; tnr = tnr+"c3"}
	if (document.forms.qf.elements.q024.checked) {document.images["c024"].src=wrong.src; wr1c++; tnr = tnr+"c4"}
	if (document.forms.qf.elements.q025.checked) {document.images["c025"].src=wrong.src; wr1c++; tnr = tnr+"c5"}
	if (document.forms.qf.elements.q026.checked) {document.images["c026"].src=wrong.src; wr1c++; tnr = tnr+"c6"}
	if (!document.forms.qf.elements.q027.checked) {document.images["c027"].src=wrong.src; wnt = wnt+"c7"} else {document.images["c027"].src=correct.src; score1c++}
	if (document.forms.qf.elements.q028.checked) {document.images["c028"].src=wrong.src; wr1c++; tnr = tnr+"c8"}
	if (document.forms.qf.elements.q029.checked) {document.images["c029"].src=wrong.src; wr1c++; tnr = tnr+"c9"}
	if (document.forms.qf.elements.q030.checked) {document.images["c030"].src=wrong.src; wr1c++; tnr = tnr+"c10"}
	if ( (tnr!="") || (wnt!="") )
	{
		if ( (wnt=="c2c7") && (tnr=="") )
			{ errorlist = errorlist + "#1c#irrational? "+params+"#apparently not attempted" }
		else
			{ errorlist = errorlist + "#1c#irrational? "+params+"#TNR: "+tnr+" WNT: "+wnt }
	}

	tnr = ""; wnt = "";
	score1d=0; wr1d=0;
	if (document.forms.qf.elements.q031.checked) {document.images["c031"].src=wrong.src; wr1d++; tnr = tnr+"d1"}
	if (document.forms.qf.elements.q032.checked) {document.images["c032"].src=wrong.src; wr1d++; tnr = tnr+"d2"}
	if (document.forms.qf.elements.q033.checked) {document.images["c033"].src=wrong.src; wr1d++; tnr = tnr+"d3"}
	if (document.forms.qf.elements.q034.checked) {document.images["c034"].src=wrong.src; wr1d++; tnr = tnr+"d4"}
	if (!document.forms.qf.elements.q035.checked) {document.images["c035"].src=wrong.src; wnt = wnt+"d5"} else {document.images["c035"].src=correct.src; score1d++}
	if (document.forms.qf.elements.q036.checked) {document.images["c036"].src=wrong.src; wr1d++; tnr = tnr+"d6"}
	if (document.forms.qf.elements.q037.checked) {document.images["c037"].src=wrong.src; wr1d++; tnr = tnr+"d7"}
	if (!document.forms.qf.elements.q038.checked) {document.images["c038"].src=wrong.src; wnt = wnt+"d8"} else {document.images["c038"].src=correct.src; score1d++}
	if (document.forms.qf.elements.q039.checked) {document.images["c039"].src=wrong.src; wr1d++; tnr = tnr+"d9"}
	if (!document.forms.qf.elements.q040.checked) {document.images["c040"].src=wrong.src; wnt = wnt+"d10"} else {document.images["c040"].src=correct.src; score1d++}
	if ( (tnr!="") || (wnt!="") )
	{
		if ( (wnt=="d5d8d10") && (tnr=="") )
			{ errorlist = errorlist + "#1d#integer? "+params+"#apparently not attempted" }
		else
			{ errorlist = errorlist + "#1d#integer? "+params+"#TNR: "+tnr+" WNT: "+wnt }
	}

	tnr = ""; wnt = "";
	score1e=0; 
	if (!document.forms.qf.elements.q041.checked) {document.images["c041"].src=wrong.src; wnt = wnt+"e1"} else {document.images["c041"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q042.checked) {document.images["c042"].src=wrong.src; wnt = wnt+"e2"} else {document.images["c042"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q043.checked) {document.images["c043"].src=wrong.src; wnt = wnt+"e3"} else {document.images["c043"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q044.checked) {document.images["c044"].src=wrong.src; wnt = wnt+"e4"} else {document.images["c044"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q045.checked) {document.images["c045"].src=wrong.src; wnt = wnt+"e5"} else {document.images["c045"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q046.checked) {document.images["c046"].src=wrong.src; wnt = wnt+"e6"} else {document.images["c046"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q047.checked) {document.images["c047"].src=wrong.src; wnt = wnt+"e7"} else {document.images["c047"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q048.checked) {document.images["c048"].src=wrong.src; wnt = wnt+"e8"} else {document.images["c048"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q049.checked) {document.images["c049"].src=wrong.src; wnt = wnt+"e9"} else {document.images["c049"].src=correct.src; score1e++}
	if (!document.forms.qf.elements.q050.checked) {document.images["c050"].src=wrong.src; wnt = wnt+"e10"} else {document.images["c050"].src=correct.src; score1e++}
	if ( (tnr!="") || (wnt!="") )
	{
		if ( (wnt=="e1e2e3e4e5e6e7e8e9e10") && (tnr=="") )
			{ errorlist = errorlist + "#1e#real? "+params+"#apparently not attempted" }
		else
			{ errorlist = errorlist + "#1e#real? "+params+"#TNR: "+tnr+" WNT: "+wnt }
	}
}

<!-- Q2-3 EXTRA PARAMETERS -->
a1=(-1*p1-p2/9);
a2=Math.sqrt(p3);
a3=p4/p5;
a4=p6+p7/10;
a5=0;
a6=-1*p8/p9;
a7=Math.PI;
a8=p10;
a9=p11+p12/p13;
a10=-1*p14;

function checkQ2()
{
	params = "-"+p1+"."+p2+"r ? sqrt("+p3+") ? "+p4+"/"+p5+" ? "+p6+"."+p7+" ? 0 ? -"+p8+"/"+p9+" ? pi ? "+p10+" ? "+p11+"&"+p12+"/"+p13+" ? -"+p14;
	score2=0;
	cc=document.forms.qf.elements.q051.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a1+cc+a2))
	{document.images["c051"].src=correct.src; score2++} else {document.images["c051"].src=wrong.src; errorlist = errorlist + "#2a#-"+p1+"."+p2+"r ? sqrt("+p3+")#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
	cc=document.forms.qf.elements.q052.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a2+cc+a3))
	{document.images["c052"].src=correct.src; score2++} else {document.images["c052"].src=wrong.src; errorlist = errorlist + "#2b#sqrt("+p3+") ? "+p4+"/"+p5+"#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
	cc=document.forms.qf.elements.q053.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a3+cc+a4))
	{document.images["c053"].src=correct.src; score2++} else {document.images["c053"].src=wrong.src; errorlist = errorlist + "#2c#"+p4+"/"+p5+" ? "+p6+"."+p7+"#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
	cc=document.forms.qf.elements.q054.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a4+cc+a5))
	{document.images["c054"].src=correct.src; score2++} else {document.images["c054"].src=wrong.src; errorlist = errorlist + "#2d#"+p6+"."+p7+" ? 0#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
	cc=document.forms.qf.elements.q055.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a5+cc+a6))
	{document.images["c055"].src=correct.src; score2++} else {document.images["c055"].src=wrong.src; errorlist = errorlist + "#2e#0 ? -"+p8+"/"+p9+"#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
	cc=document.forms.qf.elements.q056.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a6+cc+a7))
	{document.images["c056"].src=correct.src; score2++} else {document.images["c056"].src=wrong.src; errorlist = errorlist + "#2f# -"+p8+"/"+p9+" ? pi#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
	cc=document.forms.qf.elements.q057.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a7+cc+a8))
	{document.images["c057"].src=correct.src; score2++} else {document.images["c057"].src=wrong.src; errorlist = errorlist + "#2g#pi ? "+p10+"#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
	cc=document.forms.qf.elements.q058.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a8+cc+a9))
	{document.images["c058"].src=correct.src; score2++} else {document.images["c058"].src=wrong.src; errorlist = errorlist + "#2h#"+p10+" ? "+p11+"&"+p12+"/"+p13+"#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
	cc=document.forms.qf.elements.q059.value; if (cc=="=") {cc="=="}; if ((cc==">" || cc=="==" || cc=="<") && eval(a9+cc+a10))
	{document.images["c059"].src=correct.src; score2++} else {document.images["c059"].src=wrong.src; errorlist = errorlist + "#2i#"+p11+"&"+p12+"/"+p13+" ? -"+p14+"#";
		if (cc=="")	{ errorlist = errorlist + "apparently not attempted" }
		else 		{ errorlist = errorlist + cc } }
}
function countless(v)
{
	lc=0;
	for (lcc=1; lcc<=10; lcc++) { if (eval("a"+lcc) < eval("a"+v)) {lc++} }
	return lc;
}

function countmore(v)
{
	mc=0;
	for (mcc=1; mcc<=10; mcc++) { if (eval("a"+mcc) > eval("a"+v)) {mc++} }
	return mc;
}

function checkQ3()
{
	score3=0;
	qap="#3#number in order: -"+p1+"."+p2+"r, sqrt("+p3+"), "+p4+"/"+p5+", "+p6+"."+p7+", 0, -"+p8+"/"+p9+", pi, "+p10+", "+p11+"&"+p12+"/"+p13+", -"+p14+"#";
	wa3="";
	for (qc=60; qc<=69; qc++)
	{
		min = 1+countless(qc-59);
		max = 10-countmore(qc-59);
		if (qc<69)		{ wa3=wa3+document.forms.qf.elements["q0"+qc].value+"/" }
		else		{ wa3=wa3+document.forms.qf.elements["q0"+qc].value }
		if (document.forms.qf.elements["q0"+qc].value>=min && document.forms.qf.elements["q0"+qc].value<=max)
			{ score3++; document.images["c0"+qc].src = correct.src; }
		else	{ document.images["c0"+qc].src = wrong.src; }
	}
	if (score3<10)	{ if (wa3!="/////////") { errorlist = errorlist + qap + wa3 } else { errorlist = errorlist + qap + "apparently not attempted" } }
}

function Ascending(p,q)	{ return (p-q) }
function Descending(p,q)	{ return (q-p) }

function checkQ4()
{
	score4a=0; score4b=0; score4c=0;
	if (document.forms.qf.elements["q070"].value == p16*100)
		{ score4a++; document.images["c070"].src = correct.src; }
	else	{ document.images["c070"].src = wrong.src;
		errorlist = errorlist+"#4a#value of "+p16+" in "+p15+p16+p17+p18+"#";
		if (document.forms.qf.elements["q070"].value=="") { errorlist = errorlist+"apparently not attempted" }
		else { errorlist = errorlist+document.forms.qf.elements["q070"].value } }
	ansarr = eval("["+p15+","+p16+","+p17+","+p18+"]");
	ansstr = ansarr.sort(Descending).join("");
	if (document.forms.qf.elements["q071"].value == ansstr)
		{ score4b++; document.images["c071"].src = correct.src; }
	else	{ document.images["c071"].src = wrong.src;
		errorlist = errorlist+"#4b#max rearrange of "+p15+","+p16+","+p17+","+p18+"#";
		if (document.forms.qf.elements["q071"].value=="") { errorlist = errorlist+"apparently not attempted" }
		else { errorlist = errorlist+document.forms.qf.elements["q071"].value } }
	ansstr = ansarr.sort(Ascending).join("");
	if (document.forms.qf.elements["q072"].value == ansstr)
		{ score4c++; document.images["c072"].src = correct.src; }
	else	{ document.images["c072"].src = wrong.src;
		errorlist = errorlist+"#4c#min rearrange of "+p15+","+p16+","+p17+","+p18+"#";
		if (document.forms.qf.elements["q071"].value=="") { errorlist = errorlist+"apparently not attempted" }
		else { errorlist = errorlist+document.forms.qf.elements["q071"].value } }
}

function checkQ5()
{
	score5=0;
	qu5 = p19+" <"; if (p21=="e") {qu5=qu5+"="}; qu5=qu5+" x <"; if (p22=="e") {qu5=qu5+"="}; qu5=qu5+" "+p20;
	ca1 = p19+"lt"+p21+"lt"+p22+p20;
	ca2 = p20+"gt"+p22+"gt"+p21+p19;
	ans = document.forms.qf.elements.q073.value+status("ineq1")+status("ineq2")+document.forms.qf.elements.q074.value;
	textans = document.forms.qf.elements.q073.value+" "+textstatus("ineq1")+" x "+textstatus("ineq2")+" "+document.forms.qf.elements.q074.value;
	if (ca1==ans || ca2==ans)
		{ score5++; document.images["c073"].src = correct.src; }
	else	{ document.images["c073"].src = wrong.src;
		if ( ans == "unsetunset" ) { errorlist = errorlist+"#5a#"+qu5+"#apparently not attempted" }
		else { errorlist = errorlist+"#5a#"+qu5+"#"+textans } }
	qu5 = p23+" <"; if (p25=="e") {qu5=qu5+"="}; qu5=qu5+" x <"; if (p26=="e") {qu5=qu5+"="}; qu5=qu5+" "+p24;
	ca1 = p23+"lt"+p25+"lt"+p26+p24;
	ca2 = p24+"gt"+p26+"gt"+p25+p23;
	ans = document.forms.qf.elements.q075.value+status("ineq3")+status("ineq4")+document.forms.qf.elements.q076.value;
	textans = document.forms.qf.elements.q075.value+" "+textstatus("ineq3")+" x "+textstatus("ineq4")+" "+document.forms.qf.elements.q076.value;
	if (ca1==ans || ca2==ans)
		{ score5++; document.images["c074"].src = correct.src; }
	else	{ document.images["c074"].src = wrong.src;
		if ( ans == "unsetunset" ) { errorlist = errorlist+"#5b#"+qu5+"#apparently not attempted" }
		else { errorlist = errorlist+"#5b#"+qu5+"#"+textans } }
	if (p29=="g") {qu5="x >"} else {qu5="x <"}; if (p28=="e") {qu5=qu5+"="}; qu5=qu5+" "+p27;
	ca = p29+p28+p27;
	ans = status("ineq5")+document.forms.qf.elements.q077.value;
	textans = "x "+textstatus("ineq5")+" "+document.forms.qf.elements.q077.value;
	if (ca==ans)
		{ score5++; document.images["c075"].src = correct.src; }
	else	{ document.images["c075"].src = wrong.src;
		if ( ans == "unset" ) { errorlist = errorlist+"#5c#"+qu5+"#apparently not attempted" }
		else { errorlist = errorlist+"#5c#"+qu5+"#"+textans } }
}

<!-- Q6 EXTRA PARAMETERS -->
b1=p30/p31; b2=p32/p33; b3=p34/p35; b4=p36/p37;

function checkQ6()
{
	score6=0; score6a=0;
	b1a=Math.floor(b1*10000000)/10000000; b1b=Math.round(b1*10000000)/10000000;
	b2a=Math.floor(b2*10000000)/10000000; b2b=Math.round(b2*10000000)/10000000;
	b3a=Math.floor(b3*10000000)/10000000; b3b=Math.round(b3*10000000)/10000000;
	b4a=Math.floor(b4*10000000)/10000000; b4b=Math.round(b4*10000000)/10000000;
	ans1=document.forms.qf.elements["q078"].value;
	ans2=document.forms.qf.elements["q079"].value;
	ans3=document.forms.qf.elements["q080"].value;
	ans4=document.forms.qf.elements["q081"].value;
	if (ans1==b1a || ans1==b1b)	{ score6++; score6a=1; document.images["c076"].src = correct.src; }
	else			{ document.images["c076"].src = wrong.src;
				errorlist = errorlist+"#6a#convert "+p30+"/"+p31+" to decimal ("+b1b+")#"
				if (ans1=="")	{ errorlist = errorlist+"apparently not attempted" }
				else		{ errorlist = errorlist+ans1 } }
	if (ans2==b2a || ans2==b2b)	{ score6++; document.images["c077"].src = correct.src; }
	else			{ document.images["c077"].src = wrong.src;
				errorlist = errorlist+"#6b#convert "+p32+"/"+p33+" to decimal ("+b2b+")#"
				if (ans2=="")	{ errorlist = errorlist+"apparently not attempted" }
				else		{ errorlist = errorlist+ans2 } }
	if (ans3==b3a || ans3==b3b)	{ score6++; document.images["c078"].src = correct.src; }
	else			{ document.images["c078"].src = wrong.src;
				errorlist = errorlist+"#6c#convert "+p34+"/"+p35+" to decimal ("+b3b+")#"
				if (ans3=="")	{ errorlist = errorlist+"apparently not attempted" }
				else		{ errorlist = errorlist+ans3 } }
	if (ans4==b4a || ans4==b4b)	{ score6++; document.images["c079"].src = correct.src; }
	else			{ document.images["c079"].src = wrong.src;
				errorlist = errorlist+"#6d#convert "+p36+"/"+p37+" to decimal ("+b4b+")#"
				if (ans4=="")	{ errorlist = errorlist+"apparently not attempted" }
				else		{ errorlist = errorlist+ans4 } }
}

function checkQ7()
{
	score7a=0; score7b=0; score7c=0; score7d=0; score7e=0; score7f=0; 
	if (fraceq("q082","q083",p44))
		{ score7a++; document.images["c080"].src = correct.src; }
	else	{ document.images["c080"].src = wrong.src;
		errorlist = errorlist+"#7a#convert "+p44+" to a fraction#"
		if ((document.forms.qf.elements.q082.value=="") && (document.forms.qf.elements.q083.value==""))
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q082.value+"/"+document.forms.qf.elements.q083.value } }
	if (fraceq("q084","q085",p47/100))
		{ score7b++; document.images["c081"].src = correct.src; }
	else	{ document.images["c081"].src = wrong.src;
		errorlist = errorlist+"#7b#convert "+p47+"% to a fraction#"
		if ((document.forms.qf.elements.q084.value=="") && (document.forms.qf.elements.q085.value==""))
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q084.value+"/"+document.forms.qf.elements.q085.value } }
	if (fraceq("q086","q087",p45))
		{ score7a++; document.images["c082"].src = correct.src; }
	else	{ document.images["c082"].src = wrong.src;
		errorlist = errorlist+"#7c#convert "+p45+" to a fraction#"
		if ((document.forms.qf.elements.q086.value=="") && (document.forms.qf.elements.q087.value==""))
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q086.value+"/"+document.forms.qf.elements.q087.value } }
	if (fraceq("q088","q089",p48/100))
		{ score7b++; document.images["c083"].src = correct.src; }
	else	{ document.images["c083"].src = wrong.src;
		errorlist = errorlist+"#7d#convert "+p48+"% to a fraction#"
		if ((document.forms.qf.elements.q088.value=="") && (document.forms.qf.elements.q089.value==""))
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q088.value+"/"+document.forms.qf.elements.q089.value } }
	if (fraceq("q090","q091",p46))                                    
		{ score7a++; document.images["c084"].src = correct.src; }
	else	{ document.images["c084"].src = wrong.src;
		errorlist = errorlist+"#7e#convert "+p46+" to a fraction#"
		if ((document.forms.qf.elements.q090.value=="") && (document.forms.qf.elements.q091.value==""))
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q090.value+"/"+document.forms.qf.elements.q091.value } }
	if (fraceq("q092","q093",p49/100))
		{ score7b++; document.images["c092"].src = correct.src; }
	else	{ document.images["c093"].src = wrong.src;
		errorlist = errorlist+"#7f#convert "+p49+"% to a fraction#"
		if ((document.forms.qf.elements.q092.value=="") && (document.forms.qf.elements.q093.value==""))
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q092.value+"/"+document.forms.qf.elements.q093.value } }

                                                
	if (document.forms.qf.elements.q094.value==Math.round(p38/p39*1000)/1000)
		{ score7c++; document.images["c086"].src = correct.src; }
	else	{ document.images["c086"].src = wrong.src;
		errorlist = errorlist+"#7g#convert "+p38+"/"+p39+" to a decimal#"
		if (document.forms.qf.elements.q094.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q094.value } }
	if (document.forms.qf.elements.q095.value==Math.round(p47/100*1000)/1000)
		{ score7d++; document.images["c087"].src = correct.src; }
	else	{ document.images["c087"].src = wrong.src;
		errorlist = errorlist+"#7h#convert "+p47+"% to a decimal#"
		if (document.forms.qf.elements.q095.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q095.value } }
	if (document.forms.qf.elements.q096.value==Math.round(p40/p41*1000)/1000)
		{ score7c++; document.images["c088"].src = correct.src; }
	else	{ document.images["c088"].src = wrong.src;
		errorlist = errorlist+"#7i#convert "+p40+"/"+p41+" to a decimal#"
		if (document.forms.qf.elements.q096.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q096.value } }
	if (document.forms.qf.elements.q097.value==Math.round(p48/100*1000)/1000)
		{ score7d++; document.images["c089"].src = correct.src; }
	else	{ document.images["c089"].src = wrong.src;
		errorlist = errorlist+"#7j#convert "+p48+"% to a decimal#"
		if (document.forms.qf.elements.q097.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q097.value } }
	if (document.forms.qf.elements.q098.value==Math.round(p42/p43*1000)/1000)
		{ score7c++; document.images["c090"].src = correct.src; }
	else	{ document.images["c090"].src = wrong.src;
		errorlist = errorlist+"#7k#convert "+p42+"/"+p43+" to a decimal#"
		if (document.forms.qf.elements.q098.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q098.value } }
	if (document.forms.qf.elements.q099.value==Math.round(p49/100*1000)/1000)
		{ score7d++; document.images["c091"].src = correct.src; }
	else	{ document.images["c091"].src = wrong.src;
		errorlist = errorlist+"#7l#convert "+p49+"% to a decimal#"
		if (document.forms.qf.elements.q099.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q099.value } }


	if (document.forms.qf.elements.q100.value==Math.round(p38/p39*10000)/100)
		{ score7e++; document.images["c092"].src = correct.src; }
	else	{ document.images["c092"].src = wrong.src;
		errorlist = errorlist+"#7m#convert "+p38+"/"+p39+" to a percentage#"
		if (document.forms.qf.elements.q100.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q100.value } }
	if (document.forms.qf.elements.q101.value==Math.round(p44*10000)/100)
		{ score7f++; document.images["c093"].src = correct.src; }
	else	{ document.images["c093"].src = wrong.src;
		errorlist = errorlist+"#7n#convert "+p44+" to a percentage#"
		if (document.forms.qf.elements.q101.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q101.value } }
	if (document.forms.qf.elements.q102.value==Math.round(p40/p41*10000)/100)
		{ score7e++; document.images["c094"].src = correct.src; }
	else	{ document.images["c094"].src = wrong.src;
		errorlist = errorlist+"#7o#convert "+p40+"/"+p41+" to a percentage#"
		if (document.forms.qf.elements.q102.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q102.value } }
	if (document.forms.qf.elements.q103.value==Math.round(p45*10000)/100)
		{ score7f++; document.images["c095"].src = correct.src; }
	else	{ document.images["c095"].src = wrong.src;
		errorlist = errorlist+"#7p#convert "+p45+" to a percentage#"
		if (document.forms.qf.elements.q103.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q103.value } }
	if (document.forms.qf.elements.q104.value==Math.round(p42/p43*10000)/100)
		{ score7e++; document.images["c096"].src = correct.src; }
	else	{ document.images["c096"].src = wrong.src;
		errorlist = errorlist+"#7q#convert "+p42+"/"+p43+" to a percentage#"
		if (document.forms.qf.elements.q104.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q104.value } }
	if (document.forms.qf.elements.q105.value==Math.round(p46*10000)/100)
		{ score7f++; document.images["c097"].src = correct.src; }
	else	{ document.images["c097"].src = wrong.src;
		errorlist = errorlist+"#7r#convert "+p46+" to a percentage#"
		if (document.forms.qf.elements.q105.value=="")
			{ errorlist = errorlist+"apparently not attempted" }
		else	{ errorlist = errorlist+document.forms.qf.elements.q105.value } }
}

var puwin;

function checkall()
{
	if (testchecked) {alert("You"+sq+"ve already checked this test - you can"+sq+"t check the same test twice.")}
	else
	{
	// pop up window
		puwin = window.open("","puwin","resizeable=no,menubar=no,scrollbars=no,height=160,width=240");
		if (!puwin)
		{
			alert('Your answers can not be checked because\nyou have disabled pop-up windows.\nPlease enable pop-ups and try again.\n\nIn Internet Explorer, go to Tools...\nPop-up Blocker...Pop-ip Blocker Settings\nand set the Filter Level to Medium');
		}
		else
		{
		puwin.document.open();
		puwin.document.write("<HTML><HEAD><TITLE>Marking test ...</TITLE></HEAD>");
		puwin.document.write("<BODY bgcolor="+dq+"#6464FF"+dq+" text="+dq+"#FFFF00"+dq+" link="+dq+"#000000"+dq+" alink="+dq+"#000000"+dq+" vlink="+dq+"#000000"+dq+">");
		puwin.document.write("<CENTER><FONT size="+dq+"+1"+dq+" face="+dq+"arial"+dq+"><B>");
		puwin.document.write("Your test is<BR>being marked by<BR>the computer.<BR><IMG SRC='clock.gif' border='0'><BR>Thank you.");
		puwin.document.write("</B></FONT></CENTER>");
		puwin.document.write("<FORM name="+dq+"puf"+dq+" method=post action="+dq+"http://www.bat400.com/cimtscripts/test_wronganswers_send.php"+dq+">");
		puwin.document.write("<input type="+dq+"hidden"+dq+" name="+dq+"errors"+dq+" value="+dq+"NONE"+dq+">");
		puwin.document.write("</FORM>");
		puwin.document.write("</BODY>");
		puwin.document.write("</HTML>");
		puwin.document.close();
	// check answers
		checkQ1();
		checkQ2();
		checkQ3();
		checkQ4();
		checkQ5();
		checkQ6();
		checkQ7();
	// submit wrong answers
		puwin.document.forms.puf.elements.errors.value=errorlist;
		setTimeout("puwin.document.forms.puf.submit()",1500);
		puwin.focus();
		testchecked=true;
		document.images["mark"].src=clicbutt.src;
		}
		
	}


//	window.focus();
}

<!-- IMAGE MANIPULATORS FOR INEQUALITY BUTTONS -->

ineqs = new Image();
ineqs.src = "ineqs.gif";
b_lt = new Image();
b_lt.src = "blt.gif";
b_lte = new Image();
b_lte.src = "blte.gif";
b_gt = new Image();
b_gt.src = "bgt.gif";
b_gte = new Image();
b_gte.src = "bgte.gif";

function status(buttonid)
{
	var result = "unset";
	if (document[buttonid].src == b_lt.src) {result = "lt"}
	if (document[buttonid].src == b_lte.src) {result = "lte"}
	if (document[buttonid].src == b_gt.src) {result = "gt"}
	if (document[buttonid].src == b_gte.src) {result = "gte"}
	return result;
}

function textstatus(buttonid)
{
	var result = "?";
	if (document[buttonid].src == b_lt.src) {result = "<"}
	if (document[buttonid].src == b_lte.src) {result = "<="}
	if (document[buttonid].src == b_gt.src) {result = ">"}
	if (document[buttonid].src == b_gte.src) {result = ">="}
	return result;
}

function clickbutton(buttonid,sect)
{
	if (document[buttonid].src != ineqs.src)
	{
		document[buttonid].src = ineqs.src;
	}
	else
	{
		document[buttonid].src = eval("b_"+sect+".src");
	}
	window.focus();
}


<!-- FEEDBACK WINDOW OPENER -->

function feedback()
{
if (!testchecked) {alert("You need to check the test before you can see a report.")}
else {
var fbwin = window.open("","fbwin","resizeable=no,toolbar=yes,menubar=yes,scrollbars=yes,height=320,width=640");
fbwin.document.open();
fbwin.document.write("<HTML><HEAD><TITLE>Report on (a) Number and Algebra (i) Real Number System</TITLE></HEAD>");
fbwin.document.write("<BODY ALINK=WHITE VLINK=WHITE LINK=WHITE>");
fbwin.document.write("<TABLE border=0 cellpadding=10 cellspacing=0 bgcolor=darkblue width=100%><TR><TD>");
fbwin.document.write("<CENTER><FONT SIZE=+1 FACE=arial COLOR=white>You can print this page by clicking on <B>Print</B> in the <B>File</B> menu or on the icon above</FONT></CENTER>");
fbwin.document.write("</TD></TR></TABLE><P>");

m1 = 0;
if ((score1a-wr1a)>0) {m1=m1+score1a-wr1a};
if ((score1b-wr1b)>6) {m1=m1+(score1b-wr1b-6)};
if ((score1c-wr1c)>0) {m1=m1+score1c-wr1c};
if ((score1d-wr1d)>1) {m1=m1+(score1d-wr1d-1)};
if (score1e>8) {m1=m1+(score1e-8)};

fbwin.document.write("<FONT FACE=ARIAL><CENTER>This is the summary of your results in the section:<BR>");
fbwin.document.write("<B><FONT size=+1>(a) Number and Algebra (i) Real Number System</FONT></FONT></B></CENTER><P>");
fbwin.document.write("<B>Question 1 : Types of numbers</B><BR>");
fbwin.document.write("<TABLE border=0 cellpadding=5 cellspacing=0>");
fbwin.document.write("<TR><TD valign=top><I>Natural numbers</I></TD><TD>");
if (score1a==0) {fbwin.document.write("You didn't identify the natural number in part (a). ")};
if (score1a==1) {fbwin.document.write("You correctly identified the natural number in part (a). ")};
if (wr1a>0) {fbwin.document.write("<BR>You incorrectly marked "+wr1a+" of the other numbers as natural numbers.</TD></TR>")};
fbwin.document.write("<TR><TD valign=top><I>Rational numbers</I></TD><TD>");
if (score1b==0) {fbwin.document.write("You didn't identify any of the 8 rational numbers in part (b). ")};
if (score1b>0 && score1b<8) {fbwin.document.write("You correctly identified "+score1b+" of the 8 rational numbers in part (b). ")};
if (score1b==8) {fbwin.document.write("You correctly identified all 8 of the rational numbers in part (b). ")};
if (wr1b>0) {fbwin.document.write("<BR>You incorrectly marked "+wr1b+" of the other numbers as rational numbers.</TD></TR>")};
fbwin.document.write("<TR><TD valign=top><I>Irrational numbers</I></TD><TD>");
if (score1c==0) {fbwin.document.write("You didn't identify either of the 2 irrational numbers in part (c). ")};
if (score1c==1) {fbwin.document.write("You correctly identified 1 of the 2 irrational numbers in part (c). ")};
if (score1c==2) {fbwin.document.write("You correctly identified both of the irrational numbers in part (c). ")};
if (wr1c>0) {fbwin.document.write("<BR>You incorrectly marked "+wr1c+" of the other numbers as irrational numbers.</TD></TR>")};
fbwin.document.write("<TR><TD valign=top><I>Integers</I></TD><TD>");
if (score1d==0) {fbwin.document.write("You didn't identify any of the three integers in part (d). ")};
if (score1d==1 || score1d==2) {fbwin.document.write("You correctly identified "+score1d+" of the 3 integers in part (d). ")};
if (score1d==3) {fbwin.document.write("You correctly identified all 3 of the integers in part (d). ")};
if (wr1d>0) {fbwin.document.write("<BR>You incorrectly marked "+wr1d+" of the other numbers as integers.</TD></TR>")};
fbwin.document.write("<TR><TD valign=top><I>Real numbers</I></TD><TD>");
if (score1e==0) {fbwin.document.write("You didn't identify any of the 10 real numbers in part (e). ")};
if (score1e>0 && score1e<10) {fbwin.document.write("You correctly identified "+score1e+" of the 10 real numbers in part (e). ")};
if (score1e==10) {fbwin.document.write("You correctly identified all 10 of the real numbers in part (e). ")};
fbwin.document.write("</TD></TR>");
fbwin.document.write("</TABLE>");
fbwin.document.write("<B>("+m1+"/9)</B>");

m2 = 0;
if (score2>6) {m2=m2+(score2-6)};

fbwin.document.write("<P>");
fbwin.document.write("<B>Question 2 : Inserting inequalities between numbers</B><BR>");
fbwin.document.write("<TABLE border=0 cellpadding=5 cellspacing=0>");
fbwin.document.write("<TR><TD valign=top>");
if (score2==0) {fbwin.document.write("You didn't enter any of the 9 inequalities in Question 2 correctly.")}
if (score2==9) {fbwin.document.write("You correctly entered all 9 of the inequalities in Question 2.")}
if (score2>0 && score2<9) {fbwin.document.write("You correctly entered "+score2+" of the 9 inequalities in Question 2.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("</TABLE>");
fbwin.document.write("<B>("+m2+"/3)</B>");

m3 = 0;
if (score3>7) {m3=m3+(score3-7)};

fbwin.document.write("<P>");
fbwin.document.write("<B>Question 3 : Numbering values in ascending order</B><BR>");
fbwin.document.write("<TABLE border=0 cellpadding=5 cellspacing=0>");
fbwin.document.write("<TR><TD valign=top>");
if (score3==0) {fbwin.document.write("You didn't number any of the 10 values in Question 3 correctly.")}
if (score3==10) {fbwin.document.write("You correctly numbered all 10 values in Question 3.")}
if (score3>0 && score3<10) {fbwin.document.write("You correctly numbered "+score3+" of the 10 values in Question 3.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("</TABLE>");
fbwin.document.write("<B>("+m3+"/3)</B>");

m4 = (score4b+score4c)*2;

fbwin.document.write("<P>");
fbwin.document.write("<B>Question 4 : Value of digits in a number</B><BR>");
fbwin.document.write("<TABLE border=0 cellpadding=5 cellspacing=0>");
fbwin.document.write("<TR><TD valign=top>");
q4num=(" "+p15+p16+p17+p18+".<BR>")
if (score4a==0) {fbwin.document.write("You didn't know the value of the <I>"+p16+"</I> in"+q4num)}
else {fbwin.document.write("You correctly stated the value of the <I>"+p16+"</I> in"+q4num)}
if (score4b==0) {fbwin.document.write("You didn't identify the largest value you can form from the digits of the number"+q4num)}
else {fbwin.document.write("You correctly stated the largest value you can form from the digits of the number"+q4num)}
if (score4c==0) {fbwin.document.write("You didn't identify the smallest value you can form from the digits of the number"+q4num)}
else {fbwin.document.write("You correctly stated the smallest value you can form from the digits of the number"+q4num)}
fbwin.document.write("</TD></TR>");
fbwin.document.write("</TABLE>");
fbwin.document.write("<B>("+m4+"/4)</B>");

m5 = score5*2;

fbwin.document.write("<P>");
fbwin.document.write("<B>Question 5 : Identifying inequalities expressed on a number line</B><BR>");
fbwin.document.write("<TABLE border=0 cellpadding=5 cellspacing=0>");
fbwin.document.write("<TR><TD valign=top>");
if (score5==0) {fbwin.document.write("You didn't identify any of the 3 inequalities in Question 5 correctly.")}
if (score5==3) {fbwin.document.write("You correctly identified all 3 of the inequalities in Question 5.")}
if (score5>0 && score5<3) {fbwin.document.write("You correctly identified "+score5+" of the 3 inequalities in Question 5.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("</TABLE>");
fbwin.document.write("<B>("+m5+"/6)</B>");

m6 = score6a+((score6-score6a)*2);

fbwin.document.write("<P>");
fbwin.document.write("<B>Question 6 : Writing fractions as decimals (which may be recurring)</B><BR>");
fbwin.document.write("<TABLE border=0 cellpadding=5 cellspacing=0>");
fbwin.document.write("<TR><TD valign=top>");
if (score6==0) {fbwin.document.write("You didn't write any of the 4 fractions in Question 6 correctly as decimals.")}
if (score6==4) {fbwin.document.write("You correctly wrote all 4 of the fractions in Question 6 as decimals.")}
if (score6>0 && score6<4) {fbwin.document.write("You correctly wrote "+score6+" of the 4 fractions in Question 6 as decimals.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("</TABLE>");
fbwin.document.write("<B>("+m6+"/7)</B>");

m7 = score7a+score7b+score7c+score7d+score7e+score7f;

fbwin.document.write("<P>");
fbwin.document.write("<B>Question 7 : Converting between fractions, decimals and percentages</B><BR>");
fbwin.document.write("<TABLE border=0 cellpadding=5 cellspacing=0>");
fbwin.document.write("<TR><TD valign=top><I>Decimal to Fraction</I></TD><TD>");
if (score7a==0) {fbwin.document.write("You didn't do any of these 3 conversions correctly.")}
if (score7a==3) {fbwin.document.write("You did all 3 of these conversions correctly.")}
if (score7a>0 && score7a<3) {fbwin.document.write("You did "+score7a+" of these 3 conversions correctly.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("<TR><TD valign=top><I>Percentage to Fraction</I></TD><TD>");
if (score7b==0) {fbwin.document.write("You didn't do any of these 3 conversions correctly.")}
if (score7b==3) {fbwin.document.write("You did all 3 of these conversions correctly.")}
if (score7b>0 && score7b<3) {fbwin.document.write("You did "+score7b+" of these 3 conversions correctly.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("<TR><TD valign=top><I>Fraction to Decimal</I></TD><TD>");
if (score7c==0) {fbwin.document.write("You didn't do any of these 3 conversions correctly.")}
if (score7c==3) {fbwin.document.write("You did all 3 of these conversions correctly.")}
if (score7c>0 && score7c<3) {fbwin.document.write("You did "+score7c+" of these 3 conversions correctly.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("<TR><TD valign=top><I>Percentage to Decimal</I></TD><TD>");
if (score7d==0) {fbwin.document.write("You didn't do any of these 3 conversions correctly.")}
if (score7d==3) {fbwin.document.write("You did all 3 of these conversions correctly.")}
if (score7d>0 && score7d<3) {fbwin.document.write("You did "+score7d+" of these 3 conversions correctly.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("<TR><TD valign=top><I>Fraction to Percentage</I></TD><TD>");
if (score7e==0) {fbwin.document.write("You didn't do any of these 3 conversions correctly.")}
if (score7e==3) {fbwin.document.write("You did all 3 of these conversions correctly.")}
if (score7e>0 && score7e<3) {fbwin.document.write("You did "+score7e+" of these 3 conversions correctly.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("<TR><TD valign=top><I>Decimal to Percentage</I></TD><TD>");
if (score7f==0) {fbwin.document.write("You didn't do any of these 3 conversions correctly.")}
if (score7f==3) {fbwin.document.write("You did all 3 of these conversions correctly.")}
if (score7f>0 && score7f<3) {fbwin.document.write("You did "+score7f+" of these 3 conversions correctly.")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("</TABLE>");
fbwin.document.write("<B>("+m7+"/18)</B>");

fbwin.document.write("<P>");
fbwin.document.write("<B>Summary</B><BR>");
fbwin.document.write("<TABLE border=0 cellpadding=5 cellspacing=0>");
fbwin.document.write("<TR><TD valign=top>");
totpc=Math.round((m1+m2+m3+m4+m5+m6+m7)/0.05)/10;
fbwin.document.write("You scored "+eval(m1+m2+m3+m4+m5+m6+m7)+" marks out of 50, which gives you a percentage score of "+totpc+"%<BR>");
if (totpc>83) {fbwin.document.write("This is excellent.  You have reached an acceptable standard for this section.<BR>")}
if (totpc>66 && totpc<83) {fbwin.document.write("You have reached an acceptable standard for this section, but you may benefit from more practice.<BR>")}
if (totpc<66) {fbwin.document.write("You will need some more practice on this section before you reach an acceptable level.<BR>")}
fbwin.document.write("</TD></TR>");
fbwin.document.write("</TABLE>");

fbwin.document.write("<P><TABLE border=0 cellpadding=10 cellspacing=0 bgcolor=darkblue width=100%><TR><TD>");
fbwin.document.write('<CENTER><FONT SIZE=+1 FACE=arial COLOR=white>Feel free to <A href="#" onClick="parent.window.close()">close</A> this window.</FONT></CENTER>');
fbwin.document.write("</TD></TR></TABLE>");

fbwin.document.write("</BODY></HTML>");
fbwin.document.close();
document.images["report"].src=clicbutt.src;
}
}

function ww(line) { document.write(line) }

function writetextinput(text_id,text_value,charsize,text_maxlength,pixelsize)
{
	if (isNS)
		{ ww('<INPUT type="text" name="'+text_id+'" value="'+text_value+'" size="'+charsize+'" maxlength="'+text_maxlength+'">') } 
	else
		{ ww('<INPUT type="text" name="'+text_id+'" value="'+text_value+'" size="'+charsize+'" STYLE="width: '+pixelsize+'px">') }
}
