-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreview.php
61 lines (53 loc) · 1.72 KB
/
review.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
session_start();
if(!isset($_SESSION['login']))
{
echo '<script type="text/javascript">alert("Session expired, please login again");window.location=\'./index.php\';</script>';
}
extract($_POST);
extract($_SESSION);
include("database.php");
if($submit=='Finish')
{
mysql_query("delete from mst_useranswer where sess_id='" . session_id() ."'") or die(mysql_error());
unset($_SESSION[qn]);
header("Location: index2.php");
exit;
}
?>
<html>
<head>
<title>Online Quiz - Review Quiz </title>
<link href="admin.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="90EE90">
<?php
include("header.php");
echo "<h1 class=head1> Review Test Question</h1>";
if(!isset($_SESSION[qn]))
{
$_SESSION[qn]=0;
}
else if($submit=='Next Question' )
{
$_SESSION[qn]=$_SESSION[qn]+1;
}
$rs=mysql_query("select * from mst_useranswer where sess_id='" . session_id() ."'",$cn) or die(mysql_error());
mysql_data_seek($rs,$_SESSION[qn]);
$row= mysql_fetch_row($rs);
echo "<form name=myfm method=post action=review.php>";
echo "<table width=100%> <tr> <td width=30> <td> <table border=0>";
$n=$_SESSION[qn]+1;
echo "<tR><td><span class=style2>Que ". $n .": $row[2]</style>";
echo "<tr><td class=".($row[7]==1?'tans':'style8').">$row[3]";
echo "<tr><td class=".($row[7]==2?'tans':'style8').">$row[4]";
echo "<tr><td class=".($row[7]==3?'tans':'style8').">$row[5]";
echo "<tr><td class=".($row[7]==4?'tans':'style8').">$row[6]";
if($_SESSION[qn]<mysql_num_rows($rs)-1)
echo "<tr><td><input type=submit name=submit value='Next Question'></form>";
else
echo "<tr><td><input type=submit name=submit value='Finish'></form>";
echo "</table></table>";
?>
</body>
</html>