-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
71 lines (51 loc) · 1.52 KB
/
Copy pathmain.js
File metadata and controls
71 lines (51 loc) · 1.52 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
62
63
64
65
66
67
68
69
70
71
//Create an alert to notify of a correct answer
//============
//Create a variable to hold the value when
// clicked. For example, clicking correct answers
// on ans. 2 % 3 would give a total of 50%
//=============
//
//let button = document.getElementById("Iran");
//let percentCorrect =document.getElementById("Iran" + "Bacon");
//let questionOne = document.getElementById("Iran");
//let questionTwo = document.getElementById("Bacon");
//let questionThree =document.getElementById("hidingOnThePage");
//let questionFour =document.getElementById("white");
//function add() {
//let one =questionOne.click;
//let two = questionTwo.click;
//}
//questionOne.addEventListener("input", add);
//questionTwo.addEventListener("input", add);
//questionThree.addEventListener("input", add);
////questionFour.addEventListener("input", add);
//console.log
//var two =document.getElementById("Iran") + document.getElementById("white")
//console.log var("Hello");
///Iran.addEventListener("click", function() {
// console.log("25 %");
//});
//function Persia() {
//alert("Correct !");
//}
//function Bacon() {
//alert("Correct !");
//}
//function hidingOnThePage() {
//alert("Correct !");
//}
//function White() {
//alert("Correct !");
//}
//document.getElementById("Iran").addEventListener('click', function(){alert('HELLO');});
// END OF OLD CODE //
let score = 0;
let question = 0;
function answerQuestion(num) {
score += num;
question += 1
if (question === 4) {
score = score * 25
console.log(score + "%");
}
}