-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathviewans.php
49 lines (49 loc) · 1.05 KB
/
viewans.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
<?php include 'inc/header.php'; ?>
<?php
Session::checkSession();
$total = $exm->getTotalRows();
?>
<div class="main">
<h1>All Question & Ans: <?php echo $total; ?></h1>
<div class="viewans">
<table>
<?php
$getQues = $exm->getQueByOrder();
if ($getQues) {
while ($question = $getQues->fetch_assoc()) {
?>
<tr>
<td colspan="2">
<h3>Que <?php echo $question['quesNo']; ?>: <?php echo $question['ques']; ?></h3>
</td>
</tr>
<?php
$number = $question['quesNo'];
$answer = $exm->getAnswer($number);
if ($answer) {
while ($result = $answer->fetch_assoc()) {
?>
<tr>
<td>
<input type="radio"
<?php
if ($result['rightAns'] == '1') { ?>
checked = "checked"
<?php } ?>
/>
<?php
if ($result['rightAns'] == '1') {
echo "<span style='color:blue'>".$result['ans']."</span>";
} else {
echo $result['ans'];
}
?>
</td>
</tr>
<?php } } ?>
<?php } } ?>
</table>
<a href="starttest.php">Start Again</a>
</div>
</div>
<?php include 'inc/footer.php'; ?>