Fix what is wrong with the code it needs to have.

1. 4 Questions Anything appropriate
2. It needs to say "Correct" when the answer is correct and it needs to say "Sorry, Try Again" when it is wrong.
3. and it needs a next button when you get it correct and it needs to go on to the next and when you are done with the quiz it needs to have what your score is and a restart button
4. put buttons that have the answer and buttons that have random answers that are not right
```html
<!DOCTYPE html>
<html>
<head>
<script>
var tries = 2;

```javascript
function next() {
// Clear the input field and result message
document.getElementById('answer').value = "";
document.getElementById('result').innerHTML = "";
// Hide the next button again
document.getElementById('nextBtn').style.display = 'none';
}
var answer = document.getElementById("answer").value;
if (answer === "correct") {
document.getElementById("result").innerHTML = "Correct!";
document.getElementById("nextBtn").style.display = "block";
} else {
tries++;
if (tries < 2) {
document.getElementById("result").innerHTML = "Try again";
} else {
document.getElementById("result").innerHTML =
"The correct answer is: correct";
document.getElementById("nextBtn").style.display = "block";
}
}
}

function next() {
// Logic for moving on to the next question
}
</script>
</head>
<body>
<input type="text" id="answer" />
<button onclick="checkAnswer()">Submit</button>
<p id="result"></p>
<button id="nextBtn" style="display: none" onclick="next()">Next</button>
</body>
</html>

<!DOCTYPE html>

<html>
<head>
<script>
var tries = 2;
var score = 0;
var currentQuestion = 1;

function checkAnswer(answer) {
if (answer === "correct") {
document.getElementById("result").innerHTML = "Correct!";
document.getElementById("nextBtn").style.display = "block";
score++;
} else {
tries++;
if (tries < 2) {
document.getElementById("result").innerHTML = "Sorry, Try Again";
} else {
document.getElementById("result").innerHTML = "The correct answer is: correct";
document.getElementById("nextBtn").style.display = "block";
}
}
}

function next() {
// Logic for moving on to the next question
currentQuestion++;
if(currentQuestion <= 4) {
document.getElementById('question').innerHTML = `Question ${currentQuestion}: What is the capital of France?`;
document.getElementById('answer').value = "";
document.getElementById('result').innerHTML = "";
document.getElementById('nextBtn').style.display = 'none';
} else {
document.getElementById('question').innerHTML = `Quiz Complete. Your score is ${score}/4`;
document.getElementById('answer').style.display = 'none';
document.getElementById('result').style.display = 'none';
document.getElementById('nextBtn').style.display = 'none';
}
}
</script>
</head>
<body>
<h3 id="question">Question 1: What is 2 + 2?</h3>
<input type="text" id="answer" />
<button onclick="checkAnswer(answer.value)">Submit</button>
<p id="result"></p>
<button id="nextBtn" style="display: none" onclick="next()">Next</button>
</body>
</html>