forked from rimmi21-zz/quiz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grade.php
127 lines (94 loc) · 2.86 KB
/
grade.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="https://fonts.googleapis.com/css?family=Fascinate+Inline|Kalam" rel="stylesheet">
<title>Your score</title>
<style>
body {
text-align: center;
width: 100%;
margin: 0 auto;
padding: 0px;
font-family: helvetica;
animation: back_animate 25s infinite linear;
}
#page-wrap {
background: #fff;
color: black;
}
h1 {
margin-top: 200px;
color: black;
font-size: 44px;
font-family: 'Fascinate Inline', cursive;
}
h3 {
font-family: 'Kalam', cursive;
}
@keyframes back_animate {
0% {
background-color: #0B2161;
}
10% {
background-color: #BE81F7;
}
20% {
background-color: #170B3B;
}
30% {
background-color: #81F7D8;
}
40% {
background-color: #088A68;
}
50% {
background-color: #5882FA;
}
60% {
background-color: #424242;
}
70% {
background-color: #3B240B;
}
80% {
background-color: #FF8000;
}
90% {
background-color: #ACFA58;
}
100% {
background-color: #298A08;
}
}
</style>
</head>
<body>
<div id="page-wrap">
<h1>Score Card </h1>
<h3>Thank you dear user, for taking up this quiz. I hope you had a beautiful experience with such funny
questions !!</h3>
<h2>Here's what you got-</h2><br><br>
<?php
error_reporting(E_ALL ^ E_NOTICE);
$answer1 = $_POST['question-1-answers'];
$answer2 = $_POST['question-2-answers'];
$answer3 = $_POST['question-3-answers'];
$answer4 = $_POST['question-4-answers'];
$answer5 = $_POST['question-5-answers'];
$totalCorrect = 0;
if ($answer1 == "B") {$totalCorrect++;}
if ($answer2 == "A") {$totalCorrect++;}
if ($answer3 == "C") {$totalCorrect++; }
if ($answer4 == "D") {$totalCorrect++;}
if ($answer5 == "D") {$totalCorrect++; }
//print_r($totalCorrect);
//echo($totalCorrect);
//echo " correct out of 5";
echo "<div id = 'results'>$totalCorrect / 5 correct</div>";
?><br><br>
</div><br><br>
</body><br><br>
</html>