//TOTAL SOLUTIONS VARIABLE

var allquestions=45
var correctanswers=new Array()
correctanswers[1]='a' // PART 10
correctanswers[2]='b' 
correctanswers[3]='c' 
correctanswers[4]='b'
correctanswers[5]='b'
correctanswers[6]='b' // PART 11
correctanswers[7]='a'
correctanswers[8]='a'
correctanswers[9]='a'
correctanswers[10]='b'
correctanswers[11]='b' // PART 12
correctanswers[12]='c'
correctanswers[13]='b'
correctanswers[14]='c'
correctanswers[15]='b'
correctanswers[16]='c' // PART 13
correctanswers[17]='a' 
correctanswers[18]='c' 
correctanswers[19]='b'
correctanswers[20]='c'
correctanswers[21]='b' // PART 14
correctanswers[22]='c'
correctanswers[23]='b'
correctanswers[24]='b'
correctanswers[25]='b'
correctanswers[26]='b' // PART 15
correctanswers[27]='b' 
correctanswers[28]='a' 
correctanswers[29]='b'
correctanswers[30]='c'
correctanswers[31]='b' // PART 16
correctanswers[32]='b'
correctanswers[33]='c'
correctanswers[34]='b'
correctanswers[35]='b'
correctanswers[36]='a' // PART 17
correctanswers[37]='b' 
correctanswers[38]='b' 
correctanswers[39]='a'
correctanswers[40]='b'
correctanswers[41]='a' // PART 18
correctanswers[42]='b'
correctanswers[43]='c'
correctanswers[44]='c'
correctanswers[45]='b'

// TOTAL CALCULATION

function countsolution(){
var incorrect=null
for (q=1;q<=allquestions;q++){
	var thequestion=eval("document.ingIngresso.question"+q)
	for (c=0;c<thequestion.length;c++){
		if (thequestion[c].checked==true)
		actualchoices[q]=thequestion[c].value
		}
		
	if (actualchoices[q]!=correctanswers[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="ing_test_ingresso_risultati_B.htm"
}

// TOTAL SOLUTION

function getsolution(){
var win2=window.open("","win2","width=200,height=350, scrollbars")
win2.focus()
win2.document.open()
win2.document.write('<title>Solutions Part B</title>')
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<center><h3>Solutions Part B</h3></center>')
win2.document.write('<center><font face="Arial">')
for (i=1;i<=allquestions;i++){
for (temp=0;temp<incorrect.length;temp++){
if (i==incorrect[temp])
wrong=1
}
if (wrong==1){
win2.document.write("Question "+i+"="+correctanswers[i].fontcolor("red")+"<br>")
wrong=0
}
else
win2.document.write("Question "+i+"="+correctanswers[i]+"<br>")
}
win2.document.write('</center></font>')
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5>")
win2.document.close()
}

