/***********************************************
* JavaScriptKit.com Multiple Choice Quiz Script (http://www.javascriptkit.com)
* Copyright 2003 JavaScript Kit- http://www.javascriptkit.com
* This notice and footnote must stay intact for use
* Visit JavaScript Kit (http://www.javascriptkit.com/) for full source code
***********************************************/

//Enter total number of questions:
var totalquestions=39

//Enter the solutions corresponding to each question:
var correctchoices=new Array()
correctchoices[1]='B' //question 1 solution
correctchoices[2]='D' //question 2 solution, and so on.
correctchoices[3]='C'
correctchoices[4]='D'
correctchoices[5]='A'
correctchoices[6]='A'
correctchoices[7]='C'
correctchoices[8]='A'
correctchoices[9]='D'
correctchoices[10]='C'
correctchoices[11]='D'
correctchoices[12]='A'
correctchoices[13]='C'
correctchoices[14]='D'
correctchoices[15]='D'
correctchoices[16]='B'
correctchoices[17]='C'
correctchoices[18]='D'
correctchoices[19]='C'
correctchoices[20]='D'
correctchoices[21]='C'
correctchoices[22]='D'
correctchoices[23]='A'
correctchoices[24]='D'
correctchoices[25]='A'
correctchoices[26]='C'
correctchoices[27]='A'
correctchoices[28]='A'
correctchoices[29]='B'
correctchoices[30]='B'
correctchoices[31]='C'
correctchoices[32]='C'
correctchoices[33]='C'
correctchoices[34]='B'
correctchoices[35]='B'
correctchoices[36]='B'
correctchoices[37]='C'
correctchoices[38]='C'
correctchoices[39]='B'

/////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("Your browser does not accept cookies. Please adjust your browser settings.")
else
window.location="results.htm"
}


function showsolution(){
var win2=window.open("","win2","width=700,height=600, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<title>Solution</title>')
win2.document.write('<link rel="stylesheet" type="text/css" href="../../css/index.css" media="all"/>')
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<left><h3>Solution to Quiz</h3></center>')
win2.document.write('<left><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(""+i+"="+correctchoices[i].fontcolor("red")+"&nbsp; &nbsp; ")
wrong=0
}
else
win2.document.write(""+i+"="+correctchoices[i]+"&nbsp; &nbsp; ")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.")
win2.document.close()
}
