-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathequationquiz.html
More file actions
61 lines (61 loc) · 1.37 KB
/
Copy pathequationquiz.html
File metadata and controls
61 lines (61 loc) · 1.37 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Equation Quiz | rowannerd</title>
<style>
body {
background-color: rgb(0, 10, 200);
font-family: sans-serif;
}
.green {
color: green;
}
</style>
</head>
<body class="green">
<div id="quiz"></div>
<button id="submit">Submit Quiz</button>
<div id="results"></div>
<script>
const quizContainer = document.getElementById('quiz');
const resultsContainer = document.getElementById('results');
const submitButton = document.getElementById('submit');
const myQuestions = [
{
question: "Who invented JavaScript?",
answers: {
a: "Douglas Crockford",
b: "Sheryl Sandberg",
c: "Brendan Eich"
},
correctAnswer: "c"
},
{
question: "Which one of these is a JavaScript package manager?",
answers: {
a: "Node.js",
b: "TypeScript",
c: "npm"
},
correctAnswer: "c"
},
{
question: "Which tool can you use to ensure code quality?",
answers: {
a: "Angular",
b: "jQuery",
c: "RequireJS",
d: "ESLint"
},
correctAnswer: "d"
}
];
function buildQuiz(){}
function showResults(){}
// display quiz right away
buildQuiz();
// on submit, show results
submitButton.addEventListener('click', showResults);
</script>
</body>
</html>