-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathresult.php
86 lines (72 loc) · 2.92 KB
/
result.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
<!-- Coded by https://beproblemsolver.com Visit for more such code -->
<?php
require_once("connect.php");
require_once("function.php");
session_start();
if (!isset($_SESSION['login_active'])) {
header("Location: index.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quiz</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<section class="main-section">
<nav class="navbar navbar-expand-lg bg-body-tertiary bg-dark" data-bs-theme="dark">
<div class="container-fluid">
<a class="navbar-brand" href="dashboard.php">Quiz</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="dashboard.php">Dashboard</a>
</li>
</ul>
<div class="d-flex">
<a class="btn btn-danger" href="logout.php">Logout</a>
</div>
</div>
</div>
</nav>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<?php if ($_SESSION['score'] == 0) : ?>
<div class="card my-2 p-3 text-center">
<div class="card-body">
<h5 class="card-title py-2 text-center">No Question Attempted</h5>
<button class="btn btn-warning">You Score is : <?php echo $_SESSION['score']; ?></button>
</div>
</div>
<?php else : ?>
<div class="card my-2 p-3 text-center">
<div class="card-body">
<h5 class="card-title py-2 text-center">You have attempted <?php echo $_SESSION['attempted']; ?> out of <?php echo totalquestion($conn); ?></h5>
<button class="btn btn-warning">You Score: <?php echo $_SESSION['score']; ?></button><span class="badge text-bg-primary">Answered <?php echo $_SESSION['score']; ?> Questions Successfully!</span>
</div>
</div>
<?php endif ?>
<div class="card my-2 p-3 text-center">
<div class="card-body">
<a class="btn btn-info" href="quiz.php">Reattempt Quiz</a>
</div>
</div>
</div>
</div>
</div>
</form>
</section>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
<!-- Coded by https://beproblemsolver.com Visit for more such code -->
</html>