-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
130 lines (105 loc) · 4.43 KB
/
index.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
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
128
129
130
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<link href="styles.css" rel="stylesheet">
<title>Trivia!</title>
<script>
// TODO: Add code to check answers to questions
/*function correct()
{
document.querySelector("mcq1").textContent = 'correct';
document.querySelector("mcq1").style.fontcolour = 'green';
}
function wrong()
{
document.querySelector("mcq1").textContent = 'incorrect';
document.querySelector("mcq1").style.fontcolour = 'red';
}
function reset_button_color()
{
document.querySelector('#correct').style.backgroundColor = '#d9edff';
document.querySelector('#wrong-1').style.backgroundColor = '#d9edff';
document.querySelector('#wrong-2').style.backgroundColor = '#d9edff';
}
*/
/*function clicked()
{
document.querySelector("1D").style.backgroundColor = #ff0000;
document.querySelector("2B").style.backgroundColor = 'green';
document.querySelector("1A").style.backgroundColor = 'red';
document.querySelector("2A").style.backgroundColor = 'red';
document.querySelector("1B").style.backgroundColor = 'red';
document.querySelector("1C").style.backgroundColor = 'red';
document.querySelector("2C").style.backgroundColor = 'red';
document.querySelector("2D").style.backgroundColor = 'red';
}*/
function truee(event)
{
var i = event.target;
if(i.innerHTML == 'correct')
{
document.getElementById(i.id).style.background = '#a1fc56';
alert('Correct!');
}
else if(i.innerHTML == 'incorrect')
{
document.getElementById(i.id).style.background = '#fc797c';
alert('Incorrect');
}
}
function response()
{
let l = document.querySelector('#E11').value;
if (l == 'Admin')
{
alert('Correct!');
}
else
{
alert('Incorrect');
}
}
</script>
</head>
<body>
<div class="jumbotron">
<h1>Trivia...!!!</h1>
</div>
<div class="container">
<div class="section">
<h2>Part 1: Multiple Choice </h2>
<hr>
<!-- TODO: Add multiple choice question here -->
<h3>
<b>(1). </b>Add multiple choice question here !!
</h3>
<button onclick="truee(event)" id="A1" class="forbutton">incorrect</button>
<button onclick="truee(event)" id="B1" class="forbutton">incorrect</button>
<button onclick="truee(event)" id="C1" class="forbutton">incorrect</button>
<button onclick="truee(event)" id="D1" class="forbutton">correct</button>
<h3>
<b>(1). </b>Add multiple choice question here !!
</h3>
<button onclick="truee(event)" id="A2" class="forbutton">incorrect</button>
<button onclick="truee(event)" id="B2" class="forbutton">correct</button>
<button onclick="truee(event)" id="C2" class="forbutton">incorrect</button>
<button onclick="truee(event)" id="D2" class="forbutton">incorrect</button>
</div>
<div class="section">
<h2>Part 2: Free Response</h2>
<hr>
<!-- TODO: Add free response question here -->
<div class="section">
<h3>
<b>(1). </b>Add free reaponse question here !!
</h3>
<form onsubmit="response(); return false">
<input id="E11" placeholder="Admin" type="text"/>
<input type="submit" class="forbutton"/>
</form>
</div>
</div>
</div>
</body>
</html>