//Enter total number of questions:
var totalquestions=10

//Enter the solutions corresponding to each question:
var correctchoices=new Array()
correctchoices[1]='c' //question 1 solution
correctchoices[2]='a' //question 2 solution, and so on.
correctchoices[3]='b'
correctchoices[4]='d'
correctchoices[5]='a'
correctchoices[6]='c'
correctchoices[7]='b'
correctchoices[8]='a'
correctchoices[9]='d'
correctchoices[10]='c'

/////Don't edit beyond here//////////////////////////

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 accepteerd geen cookies. Pas uw browser-settingen aan s.v.p.")
else
window.location="results.htm"
}


function showsolution(){
var win2=window.open("","win2","width=200,height=350, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<title>Oplossingen</title>')
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><font face="Verdana" font size="2" font color="#3B5779"><h5>Oplossingen van de Quiz:</h5></font></center>')
win2.document.write('<center><font face="Verdana" font size="2">')
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("Vraag "+i+"="+correctchoices[i].fontcolor("red")+"<br>")
wrong=0
}
else
win2.document.write("Vraag "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center><font face="Verdana" font size="1"></font>')
win2.document.write("<h6>Note: De oplossingen in het rood zijn de antwoorden die u verkeerd heeft beantwoord.</h6><p align='center'><small><a href='http://www.eaglewatch.nl' target='_new'>Eaglewatch</a></small>")
win2.document.close()
}

