-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathresult.php
More file actions
97 lines (64 loc) · 1.71 KB
/
Copy pathresult.php
File metadata and controls
97 lines (64 loc) · 1.71 KB
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
<?php include "db_conn.php"; ?>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$rightAnswer = 0;
$wrongAnswer = 0;
require_once('functions.php');
require_once('setting.php');
if (isset($_POST['submit'])){
foreach($_POST['response'] as $key => $value){
if($correctAnswerArray[$key] == $value){
$rightAnswer++;
} else {
$wrongAnswer++;
}
}
}
?>
<?php
echo file_get_contents("head.php");
?>
<?php
echo file_get_contents("header.php");
?>
<div class="container">
<!-- Jumbotron Header -->
<header class="jumbotron fp-jt">
<h1>Congratulations!</h1>
<div class="col-sm-6 col-md-6 text-right">
<div class="btn-group inline" role="group">
<a href="quiz.php" class="btn btn-danger">Try again</a>
</div>
</div>
</header>
<hr>
<!--Quiz -->
<div class="row">
<div class="col-lg-12">
<!-- //Display result-->
<h2>You had :</h2>
<?php
if ($rightAnswer > 0){ ?>
<h2><span class="label label-success"> <?php echo $rightAnswer; ?> correct answers</span></h2>
<?php }
if ($wrongAnswer > 0) { ?>
<h2><span class="label label-danger"><?php echo $wrongAnswer; ?> wrong answers</span></h2>
<?php
}
?>
</div>
</div>
</div>
<!-- /.row -->
<!-- Quiz-->
<!-- /.row -->
<hr>
</div>
<!-- Footer -->
<?php
echo file_get_contents("pagefooter.php");
?>
<?php
echo file_get_contents("footer.php");
?>