-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrainbusters.php
108 lines (98 loc) · 3.78 KB
/
brainbusters.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
<?php
// Include the configuration file and autoload file from the composer.
require_once 'assets/config/config.php';
require_once "vendor/autoload.php";
// Import the ErrorHandler and Database classes from the PhotoTech namespace.
use PhotoTech\ErrorHandler;
use PhotoTech\Database;
/*
* Brain Busters 1.0 βeta
* Created by John Pepp
* on June 30, 2023
* Updated by John Pepp
* on July 2, 2023
*/
// Instantiate the ErrorHandler class
$errorHandler = new ErrorHandler();
// Set the exception handler to use the handleException method from the ErrorHandler instance
set_exception_handler([$errorHandler, 'handleException']);
// Create a new instance of the Database class
$database = new Database();
// Create a PDO instance using the Database class's method
$pdo = $database->createPDO();
?>
<!doctype html>
<html lang="en">
<head>
<!-- Meta tags for responsiveness -->
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=yes, initial-scale=1.0">
<!-- Title of the web page -->
<title>Brain Busters</title>
<!-- Link to the external CSS file -->
<link rel="stylesheet" media="all" href="assets/css/brainbusters.css">
</head>
<body>
<header class="nav">
<!-- Input and label for the mobile navigation bar -->
<input type="checkbox" class="nav-btn" id="nav-btn">
<label for="nav-btn">
<span></span>
<span></span>
<span></span>
</label>
<!-- Navigation links -->
<nav class="nav-links" id="nav-links">
<!-- Generating regular navigation links with a method from the Database class -->
<?php $database->regular_navigation(); ?>
</nav>
<!-- Website name -->
<div class="name-website">
<h1 class="webtitle">The Photo Tech Guru</h1>
</div>
</header>
<main id="content" class="main">
<div id="quiz" class="displayMessage">
<!-- Main game section, initially hidden -->
<div id="mainGame" style="display: none;">
<!-- Current question and score information -->
<div id="current" class="info-bar">
<p>Current question is <span id="currentQuestion" data-record=""></span></p>
<p>Your score: <span id="score">0</span></p>
</div>
<!-- Section for displaying the question and answers -->
<div id="triviaSection">
<div id="questionBox">
<h2 id="question"></h2>
<div id="answers">
<button class="buttonStyle" id="ans1"></button>
<button class="buttonStyle" id="ans2"></button>
<button class="buttonStyle" id="ans3"></button>
<button class="buttonStyle" id="ans4"></button>
</div>
<!-- Area for showing whether the answer was correct or not -->
<p id="result"></p>
</div>
<!-- Next button for moving to the next question -->
<button id="next" class="nextBtn">Next</button>
</div>
</div>
<!-- Selector for choosing the category of questions -->
<div id="categorySelector">
<label for="category">Choose a category:</label>
<select id="category" name="category">
<option value="">--Please choose a category--</option>
<option value="lego">LEGO</option>
<option value="photography">Photography</option>
<option value="space">Space</option>
<option value="movie">Movies</option>
<option value="sport">Sports</option>
</select>
</div>
</div>
</main>
<!-- Link to the external JavaScript file -->
<script src="assets/js/brainbusters.js"></script>
</body>
</html>