-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavascript.js
More file actions
74 lines (67 loc) · 2.32 KB
/
javascript.js
File metadata and controls
74 lines (67 loc) · 2.32 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
72
73
74
//Insert here the question number of the "Question were the Points should be displayed"
var PointScreen = 60;
//Ignore! Just for the math
var score = 1;
var points = 0;
//Go
document.getElementById("go").onclick = function() {
document.getElementById("go").style.display="none";
document.getElementById("question"+score).style.display="block";
document.getElementById("DevCodes").style.display="none";
document.getElementById("Entwicklermist").style.display="none";
};
//Check Answers
function rightAnswer (el){
$ (".right").css("color","#61D134");
$ (".wrong").css("color","#ED184A");
setTimeout(function(){
$ (".right").css("color","#000000");
$ (".wrong").css("color","#000000");
document.getElementById("question"+score).style.display="none";
score++;
points++;
console.log(score);
document.getElementById("question"+score).style.display="inline";
}
,1250);
}
function wrongAnswer (el){
$ (".right").css("color","#61D134");
$ (".wrong").css("color","#ED184A");
setTimeout(function(){
$ (".right").css("color","#000000");
$ (".wrong").css("color","#000000");
document.getElementById("question"+score).style.display="none";
score++;
console.log(score);
document.getElementById("question"+score).style.display="inline";
}
,750);
}
//See Points
document.getElementById("seePoints").onclick = function () {
if (score == PointScreen) {
document.getElementById("seePoints").style.display="none";
window.alert("Du hast " + points + " von " + score + "Fragen richtig beantwortet.");
document.getElementById("backHome").style.display="block";
};
};
//Cheats
function showCheats () {
console.log("Ihr wollt mich doch verarschen!");
document.getElementById("DevCodes").style.display="block";
document.getElementById("Entwicklermist").style.display="none";
};
function checkTheCode (){
var pointsWish = document.getElementById("pointsWish").value;
var questionWish = document.getElementById("questionWish").value;
var checkCode = document.getElementById("checkCode").value;
if (checkCode == 31415926) {
document.getElementById("question"+questionWish).style.display="block";
document.getElementById("go").style.display="none";
document.getElementById("DevCodes").style.display="none";
score = questionWish;
points = pointsWish;
console.log(score);
}
};