Update
This commit is contained in:
@@ -8,15 +8,9 @@
|
||||
|
||||
</style>
|
||||
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
<body>
|
||||
<!--
|
||||
//button
|
||||
//<input type="number" id="n" min="1" max="20">
|
||||
//<button id="get-questions" onclick="listener()"></button>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<div id="screen1">
|
||||
Anzahl fragen:
|
||||
@@ -54,6 +48,10 @@
|
||||
var answer1 = document.getElementById("answer1");
|
||||
var answer2 = document.getElementById("answer2");
|
||||
|
||||
//buttons zuweisen
|
||||
answer0.addEventListener('click', answerQuestion);
|
||||
answer1.addEventListener('click', answerQuestion);
|
||||
answer2.addEventListener('click', answerQuestion);
|
||||
|
||||
//Start game
|
||||
function listener() {
|
||||
@@ -68,7 +66,6 @@ function listener() {
|
||||
|
||||
var right = document.getElementById('right');
|
||||
var total = document.getElementById('total');
|
||||
|
||||
}
|
||||
|
||||
//Start a new game
|
||||
@@ -79,7 +76,6 @@ function newGame() {
|
||||
|
||||
function showQuestion() {
|
||||
var question = questions[currentQuestion];
|
||||
|
||||
|
||||
questionDiv.innerHTML = question.question;
|
||||
answer0.innerHTML = question.answers[0];
|
||||
@@ -115,7 +111,6 @@ function answerQuestion(event) {
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
|
||||
function showResult() {
|
||||
|
||||
screen2.style.display = "none";
|
||||
@@ -125,11 +120,6 @@ function showResult() {
|
||||
total.innerHTML = questions.length;
|
||||
}
|
||||
|
||||
//buttons zuweisen
|
||||
answer0.addEventListener('click', answerQuestion);
|
||||
answer1.addEventListener('click', answerQuestion);
|
||||
answer2.addEventListener('click', answerQuestion);
|
||||
|
||||
function getQuestions() {
|
||||
var request = new XMLHttpRequest();
|
||||
|
||||
|
Reference in New Issue
Block a user