The problem is, that my buttons aren't working. I cant click on them.
All variables are correct and have a value. Can someone help me? Thanks
`
?>
<script>
var startTime = Date.now(); // Startzeit in Millisekunden
function checkAnswer(selectedOption) {
if (selectedOption == '<?php echo $answer; ?>') {
document.getElementById('result').innerHTML = 'CORRECT!';
var endTime = Date.now();
var elapsedTime = endTime - startTime;
//Time for the question, max 10 Sec., every Sec = 1000 Points.
var points = Math.max(0, 10000 - elapsedTime);
document.getElementById('result').innerHTML += '<br>Points: ' + points;
window.location.href = "quiz2.php?points=" + points;
<?php
$points = $_GET['points'];
$sql999 = "UPDATE games SET score = score + $points WHERE nickname = '$nickname'";
mysqli_query($conn, $sql999);
?>
} else {
// Submitted a incorrect answer
document.getElementById('result').innerHTML = 'Incorrect! The answer is: ' + '<?php echo $answer; ?>';
}
// Hide all questions and answers
document.getElementById('question').classList.add('hidden');
document.getElementById('option1').classList.add('hidden');
document.getElementById('option2').classList.add('hidden');
document.getElementById('option3').classList.add('hidden');
document.getElementById('option4').classList.add('hidden');
}
</script>
<?php