function qrq1a(){
	
	var correct_answer = "The answer is 'show tables from BioStudy\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q1.a.value == "show tables from BioStudy;"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq1b(){
	
	var correct_answer = "The answer is 'show keys from CurrentBioStudy\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q1.b.value == "show keys from CurrentBioStudy;"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq1c(){
	
	var correct_answer = "The answer is 'show columns from CurrentBioStudy\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q1.c.value == "show columns from CurrentBioStudy;"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq1d(){
	
	var correct_answer = "The answer is 'show databases\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q1.d.value == "show databases;"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq2a(){
	
	var correct_answer = "select SecYear, section, DragExpWeek<br>from LabSection<br>where CatalogNumber = \'Phys201\' and DragExpWeek >2\;.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if ((document.q2.a1.value==", section, DragExpWeek") && (document.q2.a2.value=="= \'Phys201\'") && (document.q2.a3.value=="and")&&(document.q2.a4.value == "> 2\;")){
		new_window.document.write("<b>Congratulations, you filled in each blank correctly. The entire correct answer is:</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you filled in one or more of the blanks incorrectly.  The entire correct answer is:</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq2b(){
	
	var correct_answer = "select *<br>from LabSection<br>where CatalogNumber like 'Phys2%'\;";
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if ((document.q2.b1.value == "*")&&(document.q2.b2.value=="like")&&(document.q2.b3.value=="%")){
		new_window.document.write("<b>Congratulations, you filled in each blank correctly.  The entire correct answer is :</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you filled in one or more of the blanks incorrectly.  The entire correct answer is:</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq2c(){
	
	var correct ="null\;";
		
		if (document.q2.c1.value=="null\;") {
			RightWindow = window.open('','RightWindow','toolbar=no,location=no,width=450,height=100');
			var congrats = "<html><head><title>Quick Review Question Answer</title></head><body bgcolor=\"#E1E5BE\"><font size=4>You are correct! <i> " + correct + " </i> is the correct answer. " + " </font>\n<br><br>\n<form name=\"form\"><input type=\"button\" name=\"button\" value=\"Close this window\" onClick=\"window.close();\"></form><script language=\"JavaScript\">document.form.button.focus();document.form.button.select();</script></body></html>";
			RightWindow.document.write(congrats);
		} else {
			WrongWindow = window.open('','WrongWindow','toolbar=no,location=no,width=450,height=100');
			var sorry = "<html><head><title>Quick Review Question Answer</title></head><body bgcolor=\"#E1E5BE\"><font size=4>You are incorrect - The correct answer is: <i>" + correct + "</i>." + " </font>\n<br><br>\n<form name=\"form\"><input type=\"button\" name=\"button\" value=\"Close this window\" onClick=\"window.close();\"></form><script language=\"JavaScript\">document.form.button.focus();document.form.button.select();</script></body></html>";
			WrongWindow.document.write(sorry);				
		}
	}


function qrq3a(){
	
	var correct_answer = "The answer is 'select DragExpWeek from LabSection\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q3.a.value == "select DragExpWeek from LabSection;"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq3b(){
	
	var correct_answer = "The answer is 'where SecYear > 1995\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q3.b.value == "where SecYear > 1995\;"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq3c(){
	
	var correct_answer = "The answer is 'select * from LabSection\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q3.c.value == "select * from LabSection;"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq3d(){
	
	var correct_answer = "The answer is 'order by SecYear'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q3.d.value == "order by SecYear"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq3e(){
	
	var correct_answer = "The answer is 'where CatalogueNumber = \'BIO%\' '.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q3.e.value == "where CatalogueNumber = \'BIO%\'"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq4a(){
	
	var correct_answer = "The answer is 'select EventTime, event'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q4.a.value == "select EventTime, event"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq4b(){
	
	var correct_answer = "The answer is 'from session, EventCode'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q4.b.value == "from session, EventCode"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq4c(){
	
	var correct_answer = "The answer is 'where EventNumber = code'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q4.c.value == "where EventNumber = code"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq4d(){
	
	var correct_answer = "The entire correct answer is: <br><br>select EventTime, event <br>from session, EventCode <br>where EventNumber = code\;<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq4e(){
	
	var correct_answer = "The answer is 'where session.code = EventCode.code'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q4.e.value == "where session.code = EventCode.code"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq5a(){
	
	var correct_answer = "The answer is 'select CatalogNumber, avg(DragExpWeek) from LabSection group by CatalogNumber\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q5.t1.value == "select CatalogNumber, avg(DragExpWeek) from LabSection group by CatalogNumber\;"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 

function qrq6(){
	
	var correct_answer = "The answer is 2 * Pi() * radius from mushroom\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q67.six.value == "2 * Pi() * radius"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
}


function qrq7a(){
	
	var correct_answer = "The answer is 'sqrt(2 * G * M / R)\;'.<br>";
		
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q67.sevena.value == "sqrt(2 * G * M / R);"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
}


function qrq7b(){
	
	var correct_answer = "The answer is 'select max(R) from planet'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q67.sevenb.value == "select max(R) from planet"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
}

function qrq67total(){
	
	var correct_answer = "The answer is 'select PlanetName, sqrt(2 * G * M / R) from planet where R > (select max(R) from planet)\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
}

function ex3ans(){
	
	var correct_answer = "The answer is 'select ExpNumber, SoluteMass * Kf * 1000 / (ChemExperiment.SolventMass * FP) from ChemExperiment, ChemSolvent where ChemExperiment.SolventName = ChemSolvent.SolventName\;'.<br>";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
}


function qrq9a(){
	
	var correct_answer = "insert into GradeTbl<br>(select LastName, FirstName, StudentId, StudentGrade<br>from student)\;";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q9.qrq9.value == "insert into GradeTbl"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.  The entire correct answer is:</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.  The entire correct answer is:</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 



function qrq9b(){
	
	var correct_answer = "insert into EscapeTbl(Name, Vel)<br>(select PlanetName, sqrt(2 * G * M / R)<br>from planet<br>where R > (select max(R) from planet));";
	
	var new_window = window.open(" ", "new_window", "height=200,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if ((document.q9.qrq9b1.value == "insert into")&&(document.q9.qrq9b2.value=="(Name, Vel)")){
		new_window.document.write("<b>Congratulations, you answered the question correctly.  The entire correct answer is:</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.  The entire correct answer is:</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
} 



/*
function qrq2(number){
	
	var correct_answer = new Array;
	correct_answer[0] = "";
	correct_answer[1] = "The answer is Euler estimate at current time step.<br>";
	correct_answer[2] = "The answer is EPC estimate at previous time step.<br>";
	correct_answer[3] = "The answer is Derivative of function at EPC estimate for the previous time.<br>";
	correct_answer[4] = "The answer is EPC estimate at current time step.<br>";
	correct_answer[5] = "The answer is Derivative of function at Euler estimate for current time step.<br>";
	correct_answer[6] = "The answer is Average of derivatives of function at previous EPC estimate and current Euler estimate.<br>";

	var correct = 0;
	
	if (number == 1) {
		if (document.q2.answer[8].checked == true){
			correct = 1;
		} else {
			correct = 0;
		} 
	}

	if (number == 2) {
		if (document.q2.answer[17].checked == true){
			correct = 1;
		} else {
			correct = 0;
		} 
	}

	if (number == 3) {
		if (document.q2.answer[23].checked == true){
			correct = 1;
		} else {
			correct = 0;
		} 
	}

	if (number == 4) {
		if (document.q2.answer[36].checked == true){
			correct = 1;
		} else {
			correct = 0;
		} 
	}

	if (number == 5) {
		if (document.q2.answer[44].checked == true){
			correct = 1;
		} else {
			correct = 0;
		} 
	}

	if (number == 6) {
		if (document.q2.answer[50].checked == true){
			correct = 1;
		} else {
			correct = 0;
		} 
	}


	
	var new_window = window.open(" ", "new_window", "height=250,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");

	if (correct == 1){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer[number]);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");	
}


function qrq3(){
	
	var correct_answer = "The answer is -0.0002 because<br> 550e0.1 / 5 - 50 = 511.111 and <br>(511.11 - 511.111) / 511.11 = 0.000002 = -0.0002%";
	
	var new_window = window.open(" ", "new_window", "height=250,width=450");
	new_window.document.write("<html><head><title>Quick Review Questions</title></head><body bgcolor=\"#E1E5BE\">");
	
	if (document.q3.answer.value == "-0.0002%"){
		new_window.document.write("<b>Congratulations, you answered the question correctly.</b><br>");
	} else {
		new_window.document.write("<b>Sorry, you answered the question incorrectly.</b><br>");
	}
	new_window.document.write(correct_answer);
	new_window.document.write("<center><form><input type=button value=\"Close\" onClick=\"self.close();\"></form></center>");
}
*/