// Array constructor function for the three arrays defined below
function questionRecord(module, course, number, url, result, type, x, y, z){
	this.module = module;	// module
	this.course = course;		// course within module
	this.number = number;	// sequential number with course
	this.url = url;				// relative url of question
	this.result = result;		// -1: not attempted, 0: incorrect, 1: correct
	this.type = type;			// MCQ: multiple choice, MRQ: multiple response, SA: short answer, NUM: numerical
	this.x = x;				// slot available for further development
	this.y = y;				// slot available for further development
	this.z = z;				// slot available for further development
}

// Array with data for each question
var question = new Array();
question[0]=new questionRecord("","","","","","","","");
question[1]=new questionRecord("OBE12-wav","doppler1","1","questions/Q1-1.htm","-1","MCQ", "","","");
question[2]=new questionRecord("OBE12-wav","doppler1","2","questions/Q1-2.htm","-1","MCQ", "","","");
question[3]=new questionRecord("OBE12-wav","doppler1","3","questions/Q1-3.htm","-1","NUM", "","","");
question[4]=new questionRecord("OBE12-wav","doppler1","4","questions/Q1-4.htm","-1","NUM", "","","");
question[5]=new questionRecord("OBE12-wav","doppler2","5","questions/Q1-5.htm","-1","MCQ", "","","");
question[6]=new questionRecord("OBE12-wav","doppler2","6","questions/Q1-6.htm","-1","MCQ", "","","");
question[7]=new questionRecord("OBE12-wav","doppler2","7","questions/Q1-7.htm","-1","NUM", "","","");
question[8]=new questionRecord("OBE12-wav","colour","8","questions/Q2-1.htm","-1","SA", "","","");
question[9]=new questionRecord("OBE12-wav","colour","9","questions/Q2-2.htm","-1","SA", "","","");
question[10]=new questionRecord("OBE12-wav","colour","10","questions/Q2-3.htm","-1","MRQ", "","","");
question[11]=new questionRecord("OBE12-wav","colour","11","questions/Q2-4.htm","-1","MCQ", "","","");
question[12]=new questionRecord("OBE12-wav","colour","12","questions/Q2-5.htm","-1","MRQ", "","","");
question[13]=new questionRecord("OBE12-wav","colour","13","questions/Q2-6.htm","-1","MCQ", "","","");
question[14]=new questionRecord("OBE12-wav","colour","14","questions/Q2-7.htm","-1","SA", "","","");
question[15]=new questionRecord("OBE12-wav","colour","15","questions/Q2-8.htm","-1","EA", "","","");
question[16]=new questionRecord("OBE12-wav","colour","16","questions/Q2-9.htm","-1","MCQ", "","","");
question[17]=new questionRecord("OBE12-wav","colour","17","questions/Q2-10.htm","-1","MCQ", "","","");
question[18]=new questionRecord("OBE12-wav","diffraction","18","questions/Q3-1.htm","-1","MCQ", "","","");
question[19]=new questionRecord("OBE12-wav","diffraction","19","questions/Q3-2.htm","-1","MRQ", "","","");
question[20]=new questionRecord("OBE12-wav","diffraction","20","questions/Q3-3.htm","-1","MCQ", "","","");
question[21]=new questionRecord("OBE12-wav","diffraction","21","questions/Q3-4.htm","-1","MCQ", "","","");
question[22]=new questionRecord("OBE12-wav","diffraction","22","questions/Q3-5.htm","-1","MCQ", "","","");
question[23]=new questionRecord("OBE12-wav","diffraction","23","questions/Q3-6.htm","-1","MCQ", "","","");
question[24]=new questionRecord("OBE12-wav","diffraction","24","questions/Q3-8.htm","-1","NUM", "","","");
question[25]=new questionRecord("OBE12-wav","diffraction","25","questions/Q3-9.htm","-1","MCQ", "","","");
question[26]=new questionRecord("OBE12-wav","diffraction","26","questions/Q3-10.htm","-1","MCQ", "","","");
question[27]=new questionRecord("OBE12-wav","diffraction","27","questions/Q3-12.htm","-1","SA", "","","");
question[28]=new questionRecord("OBE12-wav","diffraction","28","questions/Q3-13.htm","-1","SA", "","","");
question[29]=new questionRecord("OBE12-wav","diffraction","29","questions/Q3-14.htm","-1","MCQ", "","","");
question[30]=new questionRecord("OBE12-wav","diffraction","30","questions/Q3-15.htm","-1","NUM", "","","");
question[31]=new questionRecord("OBE12-wav","debroglie","31","questions/Q4-1.htm","-1","SA", "","","");
question[32]=new questionRecord("OBE12-wav","debroglie","32","questions/Q4-2.htm","-1","NUM", "","","");
question[33]=new questionRecord("OBE12-wav","debroglie","33","questions/Q4-3.htm","-1","MCQ", "","","");
question[34]=new questionRecord("OBE12-wav","debroglie","34","questions/Q4-4.htm","-1","MCQ", "","","");
question[35]=new questionRecord("OBE12-wav","debroglie","35","questions/Q4-5.htm","-1","MRQ", "","","");
//question[36]=new questionRecord("OBE12-wav","debroglie","36","questions/Q4-6.htm","-1","MCQ", "","","");

// end of array
var correct = '<img src="graphics/Correct.gif">';
var wrong = '<img src="graphics/Wrong.gif">';
var questionNumber = 0;			// number of question as displayed on the page
var questionIndex = 0;			// position of question in the question array
//*****************************************************************
// The function below calls up a question with index "n" in the array found in questions.js
function callQuestion(n){
	questionIndex = n;
	//alert(questionIndex);
	location.href = question[n].url;
}