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

//Enter the solutions corresponding to each question:
var correctchoices=new Array()
correctchoices[1]='b' 
correctchoices[2]='b' 
correctchoices[3]='e'
correctchoices[4]='a'
correctchoices[5]='e'
correctchoices[6]='d'

/////Don't edit beyond here//////////////////////////

function gradeit(){
var incorrect=null
for (q=1;q<=totalquestions;q++){
	var thequestion=eval("document.myquiz3.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
document.myquiz3.submit();
}


function showsolution(){
var win2=window.open("","win2","toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,width=750,height=550")
win2.focus()
win2.document.open()
win2.document.write('<title>Solution</title></head>')
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solution to Quiz</h3></center>')
win2.document.write('<center><font face="Arial" > ')
win2.document.write('<center><h5>')
win2.document.write('<table><tr><td>')
win2.document.write('<table><tr><td width=150 bgcolor=#EFEFEF>')
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("<h5>Question "+i+"="+correctchoices[i].fontcolor("red")+"</h5>"+"</td>"+"</tr>"+"<tr>"+"<td bgcolor=#EFEFEF>")
wrong=0
}
else
win2.document.write("<h5>Question "+i+"="+correctchoices[i]+"</h5>"+"</td>"+"</tr>"+"<tr>"+"<td bgcolor=#EFEFEF>")
}
win2.document.write('</center></font>')
win2.document.write('</td></tr>')
win2.document.write('</table></td><td width=600><table><tr>')
win2.document.write('<td bgcolor=#EFEFEF> <h5><a href=http://www.bu.edu/showme/3choose/3-02.html>Navigation links...to subscription databases are found ...</a></h5></td></tr> ')
win2.document.write('<td bgcolor=#EFEFEF> <h5> <a href=http://www.bu.edu/showme/3choose/3-10.html>All Research Guides are available:</a></h5></td></tr> ')
win2.document.write('<td bgcolor=#EFEFEF> <h5><a href=http://www.bu.edu/showme/3choose/3-06.html>Subscription databases can be found in ...</a></h5></td></tr> ')
win2.document.write('<td bgcolor=#EFEFEF>  <h5><a href=http://www.bu.edu/showme/3choose/3-04.html>eResources are listed under:</a></h5></td></tr> ')
win2.document.write('<td bgcolor=#EFEFEF>  <h5><a href=http://www.bu.edu/showme/3choose/3-12.html>Branch libraries include all...except:</a></h5></td></tr> ')
win2.document.write('<td bgcolor=#EFEFEF> <h5><a href=http://www.bu.edu/showme/3choose/3-14.html>Library users can find help...</a></h5></td></tr> ')
win2.document.write('</td></tr></table></table>')
win2.document.write('</br>')
win2.document.write('</h5>')
win2.document.write("<font size=4>Note: The questions in <b><font color=red>red</font></b> are the ones you have incorrectly answered. Still puzzled? Click the letter link to go to the ShowMe section discussing this concept.</font>")
win2.document.close()
}

