-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
150 lines (130 loc) · 4.76 KB
/
main.js
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
function prox1() {
document.getElementById("start").style.display = "none";
document.getElementById("go").style.display = "none";
document.getElementById("quiz1").style.visibility = "visible";
}
function prox2() {
document.getElementById("quiz1").style.display = "none";
document.getElementById("quiz2").style.visibility = "visible";
}
function prox3() {
document.getElementById("quiz2").style.display = "none";
document.getElementById("quiz3").style.visibility = "visible";
}
function prox4() {
document.getElementById("quiz3").style.display = "none";
document.getElementById("quiz4").style.visibility = "visible";
}
function prox5() {
document.getElementById("quiz4").style.display = "none";
document.getElementById("quiz5").style.visibility = "visible";
}
function prox6() {
document.getElementById("quiz5").style.display = "none";
document.getElementById("quiz6").style.visibility = "visible";
}
function prox7() {
document.getElementById("quiz6").style.display = "none";
document.getElementById("quiz7").style.visibility = "visible";
}
function prox8() {
document.getElementById("quiz7").style.display = "none";
document.getElementById("quiz8").style.visibility = "visible";
}
function prox9() {
document.getElementById("quiz8").style.display = "none";
document.getElementById("quiz9").style.visibility = "visible";
}
function prox10() {
document.getElementById("quiz9").style.display = "none";
document.getElementById("quiz10").style.visibility = "visible";
document.getElementById("submeter").style.visibility = "visible";
}
function terminei() {
document.getElementById("quiz10").style.display = "none";
document.getElementById("submeter").style.display = "none";
let question1 = [...document.getElementsByName('question1')].filter(el => el.checked)[0]
let question2 = [...document.getElementsByName('question2')].filter(el => el.checked)[0]
let question3 = [...document.getElementsByName('question3')].filter(el => el.checked)[0]
let question4 = [...document.getElementsByName('question4')].filter(el => el.checked)[0]
let question5 = [...document.getElementsByName('question5')].filter(el => el.checked)[0]
let question6 = [...document.getElementsByName('question6')].filter(el => el.checked)[0]
let question7 = [...document.getElementsByName('question7')].filter(el => el.checked)[0]
let question8 = [...document.getElementsByName('question8')].filter(el => el.checked)[0]
let question9 = [...document.getElementsByName('question9')].filter(el => el.checked)[0]
let question10 = [...document.getElementsByName('question10')].filter(el => el.checked)[0]
let = correct = 0;
let = wrong = 0;
if (question1?.value === "JavaScript") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question2?.value === "6") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question3?.value === "As propriedades da última classe definida têm prioridade sobre as outras") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question4?.value === "Design que o utilizador não nota") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question5?.value === "Prototype") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question6?.value === "Erro") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question7?.value === "Os valores dos hashes têm que ser únicos, mas as chaves podem ser repetidas") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question8?.value === "Todas as anteriores") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question9?.value === "Trabalha com front end e back end") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
if (question10?.value === "A confusion matrix mostra os resultados do testing.") {
console.log('Correct Answer')
correct++;
} else {
console.log('Wrong Answer')
wrong++;
}
document.getElementById("mostrar").style.visibility = "visible";
document.getElementById("certa").innerHTML += `<p>ACERTOU ${correct} / 10.</p>`;
}