﻿charset="utf-8"

//Enter total number of questions:
var totalquestions=10

var correctchoices=new Array()
correctchoices[1]='c'
correctchoices[2]='a'
correctchoices[3]='c'
correctchoices[4]='b'
correctchoices[5]='d'
correctchoices[6]='a'
correctchoices[7]='c'
correctchoices[8]='b'
correctchoices[9]='b'
correctchoices[10]='d'

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="/quiz/quiz-bible5-answers.html"
}


function showsolution(){
var win2=window.open("","win2","width=200,height=350, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>quiz answers</title><meta http-equiv="content-style-type" content="text/css" /><link rel="stylesheet" type="text/css" href="/quiz/quiz.css" /><link rel="stylesheet" type="text/css" href="/common.css" /></head>')
win2.document.write('<body style="background:#FFFFFF"><div class="center" style="padding:0 10px 10px 10px">')
win2.document.write('<h3 style="font-size:16pt">answers</h3>')
win2.document.write('')
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("Question "+i+"="+correctchoices[i].fontcolor("red")+"<br>")
wrong=0
}
else
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('')
win2.document.write('<p class="smalltext" style="line-height:100%; text-align:left"><span style="color:red">Red</span> answers are incorrect.</p></div></body></html>')
win2.document.close()
}
