-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplayques.php
132 lines (86 loc) · 2.89 KB
/
displayques.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php session_start(); ?>
<?php
if(isset($_REQUEST["qid"]))
{
$quizidd=$_REQUEST["qid"];
}
?>
<?php
if(isset($_SESSION['usertype']))
{
$USERID=$_SESSION['usertype'];
}
?>
<?php include 'header.php'; ?>
<div class="container">
<div id="adminTopDiv">
<?php
include("userMenu.php");
?>
</div><!--end of topDiv-->
<div id="adminBottomDiv">
<?php
$con=@mysql_connect("127.0.0.1","root","");
@mysql_select_db("digitalexam",$con);
$rs=mysql_query("select quesid, question, opt1, opt2, opt3, opt4 from ques_info where quizid=$quizidd ") or die("Database error");
echo("<h2 align='center'>Quiz Name</h2>");
echo("<form action='submitans.php'>");
echo("<table border='1' id='quiztable' cellpadding='10px' cellspacing='0px' style=font-size:18px >");
$sl=0;
while($row=mysql_fetch_array($rs))
{
$sl++;
echo("<tr style=font-weight:bold >");
echo("<td width='50px'>");
echo($sl);
echo("</td>");
echo("<td > ");
echo($row['question']);
echo("</td>");
echo("</tr>");
$qsid=$row["quesid"];
echo("<tr>");
echo("<td>");
echo("<input type='radio' name='$qsid' value='1' >");
echo("</td>");
echo("<td>") ;
echo($row['opt1']);
echo("</td>");
echo("</tr>");
echo("<tr>");
echo("<td>");
echo("<input type='radio' name='$qsid' value='2' >");
echo("</td>");
echo("<td>") ;
echo($row['opt2']);
echo("</td>");
echo("</tr>");
echo("<tr>");
echo("<td>");
echo("<input type='radio' name='$qsid' value='3' >");
echo("</td>");
echo("<td>") ;
echo($row['opt3']);
echo("</td>");
echo("</tr>");
echo("<tr>");
echo("<td>");
echo("<input type='radio' name='$qsid' value='4' >");
echo("</td>");
echo("<td>") ;
echo($row['opt4']);
echo("</td>");
echo("</tr>");
echo("<tr >");
echo("<td colspan='2'>");
echo("<hr id='quedisHR'>");
echo("</td>");
echo("</tr>");
}
echo("</table>");
echo("<input type='submit' value='Submit' id='quesbtn1' width='60px'>");
echo("</form>");
?>
</div><!--end of bottomDiv-->
</div><!--end of container1-->
<?php include 'footer.php'; ?>