-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquizPage.html
92 lines (86 loc) · 4.92 KB
/
quizPage.html
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
<!--Created by Meet Patel (201801415). All rights reserved :P -->
<!DOCTYPE html>
<html>
<head>
<title>Quiz | Questions</title>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Lato:400i" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Maven+Pro:500" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Istok+Web" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Overpass:600" rel="stylesheet">
<link rel="stylesheet" href="style1.css">
<link rel='shortcut icon' href='Images/StudioQ-Logo.png' type='image/x-icon'>
<link rel='icon' href='Images/StudioQ-Logo.png' type='image/x-icon'>
<style>
html {
scroll-behavior: smooth;
}
</style>
<script>
var isValidSession = localStorage.getItem("isValidSession");
if(isValidSession == false){
alert("Quiz cannot be accessed directly. Redirecting to form page..."); //Makes quiz inaccessible directly via URL of quizPage.html
javascript:window.location='index.html';
}
function startTimer(duration, display) {
var timer = duration, minutes, seconds;
setInterval(function () {
minutes = parseInt(timer / 60, 10)
seconds = parseInt(timer % 60, 10);
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
display.textContent = minutes + ":" + seconds + " Minutes left";
if (--timer < 0) {
//timer = duration;
if(timer<0 && timer>-2)showScores();
document.getElementById("time").style.visibility = "hidden";
document.getElementById("creditfooter").style.fontSize = "40px";
}
}, 1000);
}
window.onload = function () {
var twoMinute = 60 * 2,
display = document.querySelector('#time');
startTimer(twoMinute, display);
};
</script>
</head>
<body>
<header><h1>Quiz</h1></header>
<div id="div2">
<p id="question" align="middle" style="font-size: 35px; padding: 5px 20px 5px 20px; font-family: 'Maven Pro', sans-serif;"></p>
<div class="buttons" id="options" style="font-family: 'Overpass', sans-serif;">
<button id="btn0" style="font-family: 'Overpass', sans-serif;"><span id="choice0"></span></button>
<button id="btn1" style="font-family: 'Overpass', sans-serif;"><span id="choice1"></span></button>
<button id="btn2" style="font-family: 'Overpass', sans-serif;"><span id="choice2"></span></button>
<button id="btn3" style="font-family: 'Overpass', sans-serif;"><span id="choice3"></span></button>
</div>
<hr style="margin-top: 30px; margin-left: 50px; margin-right: 50px;">
<p id="questionStatus">Question 1 of 5</p>
<p id="personPlaying"></p>
<span id="time" style="font-family: 'Istok Web', sans-serif;">2:00 Minutes</span>
<button id="leaderboardBtn" onclick="showLeaderboard();" style="color: rgb(155, 190, 255); background-color: rgba(99, 99, 99, 0.315); border-radius: 3%; font-size: 30px; margin-left: 25%; visibility: hidden;">Show Leaderboards</button>
<div id="statusDots">
<span class="dot" id="dot1">1</span>
<span class="dot" id="dot2">2</span>
<span class="dot" id="dot3">3</span>
<span class="dot" id="dot4">4</span>
<span class="dot" id="dot5">5</span><br>
<span class="dot" id="dot6">6</span>
<span class="dot" id="dot7">7</span>
<span class="dot" id="dot8">8</span>
<span class="dot" id="dot9">9</span>
<span class="dot" id="dot10">10</span>
</div>
<script src="Scripts/form.js"></script>
<script src="Scripts/objects.js"></script>
<script src="Scripts/main.js"></script>
</div> <br>
<a href="index.html" id="playAgain" style="text-decoration: none;"></a>
<p id="feedback"></p>
<footer style="clear: both;
position: relative;
height: 20px;
margin-top: -16px; font-size: 20px; color: dimgrey;" id="creditfooter">Developed and maintained by Meet Patel. <a href="https://github.com/meet59patel" target="_blank"><img src="./Images/gitico.png" height="35" width="40"></a><a href="https://www.facebook.com/Meet100Patel" target="_blank"><img src="./Images/fbico.png" height="36" width="36"></a><a href="https://www.instagram.com/meet100patel/" target="_blank"><img src="./Images/instaico.png" height="39" width="45"></a></footer>
</body>
</html>