/***********************************************
* 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
***********************************************/

//Last Updated 2 March 03

//Enter total number of questions:
var totalquestions=5

//Enter the solutions corresponding to each question:
var correctchoices=new Array()
correctchoices[1]='b' //question 1 solution
correctchoices[2]='a' //question 2 solution, and so on.
correctchoices[3]='d'
correctchoices[4]='b'
correctchoices[5]='d'

/////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("Unfortunately your browser does not accept cookies. You can easily adjust your browser settings so that cookies are available.  For more help with enabling cookies, search for 'cookies' on this site or go to the help section.")
else
window.location="kitschchallenge_results.html"
}


function showsolution(){
var win2=window.open("","win2","width=200,height=350, scrollbars=0")
win2.focus()
win2.document.open()
win2.document.write('<title>Kitsch Challenge | Solution</title>')
win2.document.write('<BODY BACKGROUND="../furniture/background.gif" BGCOLOR="#000000">')
win2.document.write('<h3><FONT FACE=Arial>Kitsch Challenge Solution</FONT></h3>')
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("Question "+i+"="+correctchoices[i].fontcolor("red")+"<br>")
wrong=0
}
else
win2.document.write("Question "+i+"="+correctchoices[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<BR><BR><FONT FACE=Arial>The solutions marked in <FONT COLOR=red>red</FONT> are the ones to the questions you had incorrectly answered.</FONT>")
win2.document.close()
}
