/***********************************************
* 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=15;

//Enter the solutions corresponding to each question:
var correctchoices=new Array();
correctchoices[1]='C'; //question 1 solution
correctchoices[2]='A'; //question 2 solution, and so on.
correctchoices[3]='B';
correctchoices[4]='C';
correctchoices[5]='False';
correctchoices[6]='B';
correctchoices[7]='scatternet';
correctchoices[8]='D';
correctchoices[9]='D';
correctchoices[10]='C';
correctchoices[11]='2.4'; 
correctchoices[12]='B';
correctchoices[13]='A';
correctchoices[14]='D';
correctchoices[15]='True';

/////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;
	}

              var thequestion7=eval("document.myquiz.question7");
              actualchoices[7]=thequestion7.value.toLowerCase();
	
	var thequestion11=eval("document.myquiz.question11");
              actualchoices[11]=thequestion11.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_Bluetooth_01.htm";
}


function showsolution(){
var win2=window.open("","win2","width=400,height=450, scrollbars");
win2.focus();
win2.document.open();
win2.document.write('<title>Bluetooth Basic Quiz Solution</title>');
win2.document.write('<body bgcolor="#FFFFFF">')
win2.document.write('<h4>Bluetooth Basic Quiz Solution</h4>');
win2.document.write('<font face="Verdana">');
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('</font>');
win2.document.write("<h5>Note: The solutions in red are the ones to the questions you had incorrectly answered.</h5><p align='left'><font style='font-size: 6pt'>Powered by <a href='http://www.javascriptkit.com' target='_new'>JavaScriptKit.com</a></font>");
win2.document.close();
}
