-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsubmitans.php
60 lines (40 loc) · 944 Bytes
/
submitans.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
<?php
include("dbConnect.php");
$res=$_REQUEST;
//echo(count($res)."<br>");
$mrks=0;
foreach($res as $a=>$b)
{
$count=0;
//echo($a."----".$b."<br>");
$qwer=mysql_query("select * from ques_info where quesid='$a'");
$asdf=mysql_fetch_array($qwer);
$c_id=$asdf['quizid'];
$correct_ans=$asdf['ans'];
if($correct_ans==$b)
{
$count++;
$mrks++;
}
else
{
}
mysql_query("INSERT INTO result_info(uid, quizid, marks,date) VALUES ('00', '$c_id','$count',now())");
}
?>
<?php include 'header.php'; ?>
<div class="container">
<div id="adminTopDiv">
<?php
include("userMenu.php");
?>
</div><!--end of topDiv-->
<div id="adminBottomDiv">
<?php
echo("<h1 align='center'>");
echo("Your Total Marks :  ".$mrks);
echo("</h1>");
?>
</div>
</div>
<?php include 'footer.php'; ?>