

//vul het totaal aantal vragen in:
var totalquestions=10

//vul de juiste oplossing in:
var correctchoices=new Array()
correctchoices[1]='c' //vraag 1 oplossing
correctchoices[2]='c' //vraag 2 oplossing, enz...
correctchoices[3]='c'
correctchoices[4]='d'
correctchoices[5]='a'
correctchoices[6]='b'
correctchoices[7]='a'
correctchoices[8]='b'
correctchoices[9]='b'
correctchoices[10]='d'

/////Hier niets veranderen!!!//////////////////////

function gradeit(){
var incorrect=null
for (q=1;q<=totalquestions;q++){
	var thequestion=eval("document.myquiz.question"+q)
	for (c=0;c<thequestion.length;c++){
		if (thequestion[c].checked==true)
		actualchoices[q]=thequestion[c].value
		}
		
	if (actualchoices[q]!=correctchoices[q]){ //process an incorrect choice
		if (incorrect==null)
		incorrect=q
		else
		incorrect+="/"+q
		}
	}

if (incorrect==null)
incorrect="a/b"
document.cookie='q='+incorrect
if (document.cookie=='')
alert("Uw browser ondersteunt geen cookies.Pas uw instellingen van uw browser aan.")
else
window.location="results1.html"
}


function showsolution(){
var win2=window.open("","win2","width=300,height=350, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<title>Oplossingen.</title>')
win2.document.write('<body bgcolor="#E2E2E2">')
win2.document.write('<center><h3>Oplossingen van test 2.</h3></center>')
win2.document.write('<center><font face="Arial">')
for (i=1;i<=totalquestions;i++){
for (temp=0;temp<incorrect.length;temp++){
if (i==incorrect[temp])
wrong=1
}
if (wrong==1){
win2.document.write("Oplossing "+i+"="+correctchoices[i].fontcolor("red")+"<br>")
wrong=0
}
else
win2.document.write("Oplossing "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Opmerking : De oplossingen in het rood zijn diegene die je fout hebt.</h5>")
win2.document.close()
}
