<?
$db_name = "ohrats_net";
$table_name = "quiz2";
$connection = @mysql_connect("localhost", "xxx", "xxx")
or die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection)
or die("Couldn't select database.");
$sql = "SELECT * FROM $table_name WHERE quiz2_id = \"$quiz2_id\"
";
$result = @($sql,$connection) or die("Couldn't execute query.");
while ($row = mysql_fetch_array($result)) {
$quiz2_id = $row['quiz2_id'];
$username = $row['username'];
$password = $row['password'];
$quiz2_level = $row['quiz2_level'];
}
?>
<?
$db_name = "ohrats_net";
$table_name = "quiz";
$connection = @mysql_connect("localhost", "mharris", "firework")
or die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection)
or die("Couldn't select database.");
$sql = "SELECT *
FROM $table_name Where level = \"$quiz2_level\" ";
$result = @($sql,$connection) or die("Couldn't execute query.");
while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$question = $row['question'];
$a = $row['a'];
$b = $row['b'];
$c = $row['c'];
$correct = $row['correct'];
$newlevel = "$quiz2_level"+1;
$question_block .= "
<font face=arial>
<DL> $question
<DD> a) <INPUT TYPE=RADIO NAME=\"$a\" Value=\"a\"> $a
<DD> b) <INPUT TYPE=RADIO NAME=\"$b\" Value=\"b\"> $b
<DD> c) <INPUT TYPE=RADIO NAME=\"$c\" Value=\"c\"> $c</DL>
</font>
";
}
$level_block .= "
<font face=arial size=4>Level $quiz2_level</font><br><br>
<font face=arial>You are currently at Level $quiz2_level. In order to advance to the Level $newlevel, you must answer 8 out of the 10 questions correctly.</font>
<br>";
?>
<?
include("http://www.ohrats.net/includes/header.inc");
?>
<br><br>
<table width=750>
<tr>
<td valign=top width=125>
<?
include("http://www.ohrats.net/includes/main_categories.inc");
?>
<br><br>
<?
include("http://www.ohrats.net/tests/includes/sub_categories.inc");
?>
</td>
<td valign=top width=75><img src=http://www.ohrats.net/links/images/vertical_bar.jpg></td>
<td valign=top width=550>
<? echo "$level_block"; ?>
<br><br>
<form action="grading.php" method=post>
<input type=hidden name=quiz2_id value="$quiz2_id">
<? echo "$question_block"; ?>
<br>
<p align=right>
<input type=submit value=Submit Answers>
</font>
</td>
</tr>
</table>
<br><br>
<?
include("http://www.ohrats.net/includes/footer.inc");
?>