I had modified this from its original code. It was working before, but now it's not. I can't figure out what I'm missing here.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Dinosaur Quiz</title>

<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS

//Question Scoring Function
function scoreQuestions(number, answer) {
	switch (number) {
		case 1:
			if (answer == 'b')
				window.alert("Correct Answer");
			else 
				window.alert("Incorrect Answer");
			break;
		case 2:
			if (answer == 'b')
				window.alert("Correct Answer");
			else 
				window.alert("Incorrect Answer");
			break;
		case 3:
			if (answer == 'c')
				window.alert("Correct Answer");
			else 
				window.alert("Incorrect Answer");
			break;
		case 4:
			if (answer == 'd')
				window.alert("Correct Answer");
			else 
				window.alert("Incorrect Answer");
			break;
		case 5:
			if (answer == 'a')
				window.alert("Correct Answer");
			else 
				window.alert("Incorrect Answer");
			break;
}

// STOP HIDING FROM INCOMPATIBLE BROWSERS-->
</script>

</head>
<body>

<h1>Dinosaur Quiz</h1>
<p>Answer all of the questions on the quiz, then select the Score button to grade the quiz. </p>
<form action="">
<p><b>1. What dinosaur was the heaviest?</b></p>
<p><input type="radio" name="question1" value="a"
     onclick="scoreQuestions(1, 'a')" />Tyrannosaurus<br />
<input type="radio" name="question1" value="b"
     onclick="scoreQuestions(1, 'b')" />Brachiosaurus<br /> <!-- correct answer -->
<input type="radio" name="question1" value="c"
     onclick="scoreQuestions(1, 'c')" />Brontosaurus<br />
<input type="radio" name="question1" value="d"
     onclick="scoreQuestions(1, 'd')" />Diplodocus</p>
<p><b>2. When did dinosaurs become extinct?</b></p>
<p><input type="radio" name="question2" value="a"
     onclick="scoreQuestions(2, 'a')" />1 billion years ago<br />
<input type="radio" name="question2" value="b"
     onclick="scoreQuestions(2, 'b')" />65 million years ago<br /> <!-- correct answer -->
<input type="radio" name="question2" value="c"
     onclick="scoreQuestions(2, 'c')" />10 million years ago<br />
<input type="radio" name="question2" value="d"
     onclick="scoreQuestions(2, 'd')" />15,000 years ago</p>
<p><b>3. Which of these is not a dinosaur?</b></p>
<p><input type="radio" name="question3" value="a"
     onclick="scoreQuestions(3, 'a')" />Megalosaurus<br />
<input type="radio" name="question3" value="b"
     onclick="scoreQuestions(3, 'b')" />Apatosaurus<br />
<input type="radio" name="question3" value="c"
     onclick="scoreQuestions(3, 'c')" />Pterodactyl<br />  <!-- correct answer -->
<input type="radio" name="question3" value="d"
     onclick="scoreQuestions(3, 'd')" />Triceratops</p>
<p><b>4. In which period did the Diplodocus live?</b></p>
<p><input type="radio" name="question4" value="a"
     onclick="scoreQuestions(4, 'a')" />Early Cretaceous<br />
<input type="radio" name="question4" value="b"
     onclick="scoreQuestions(4, 'b')" />Early Triassic<br />
<input type="radio" name="question4" value="c"
     onclick="scoreQuestions(4, 'c')" />Late Triassic<br />
<input type="radio" name="question4" value="d"
     onclick="scoreQuestions(4, 'd')" />Late Jurassic</p> <!-- correct answer -->
<p><b>5. Which of the following dinosaurs was a carnivore?</b></p>
<p><input type="radio" name="question5" value="a"
	onclick="scoreQuestions(5, 'a')" />Tyrannosaurus<br />  <!-- correct answer -->
<input type="radio" name="question5" value="b"
	onclick="scoreQuestions(5, 'b')" />Triceratops<br />
<input type="radio" name="question5" value="c"
	onclick="scoreQuestions(5, 'c')" />Stegosaurus<br />
<input type="radio" name="question5" value="d"
	onclick="scoreQuestions(5, 'd')" />Brontosaurus</p>

</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Dinosaur Quiz</title>

<script type="text/javascript">


//Question Scoring Function
function scoreQuestions(number, answer) {
    switch (number) {
        case 1:
            if (answer == 'b')
                window.alert("Correct Answer");
            else 
                window.alert("Incorrect Answer");
            break;
        case 2:
            if (answer == 'b')
                window.alert("Correct Answer");
            else 
                window.alert("Incorrect Answer");
            break;
        case 3:
            if (answer == 'c')
                window.alert("Correct Answer");
            else 
                window.alert("Incorrect Answer");
            break;
        case 4:
            if (answer == 'd')
                window.alert("Correct Answer");
            else 
                window.alert("Incorrect Answer");
            break;
        case 5:
            if (answer == 'a')
                window.alert("Correct Answer");
            else 
                window.alert("Incorrect Answer");
            break;
        } // You missed this ;)
}

</script>

</head>
<body>

<h1>Dinosaur Quiz</h1>
<p>Answer all of the questions on the quiz, then select the Score button to grade the quiz. </p>
<form action="">
<p><b>1. What dinosaur was the heaviest?</b></p>
<p><input type="radio" name="question1" value="a"
     onclick="scoreQuestions(1, 'a')" />Tyrannosaurus<br />
<input type="radio" name="question1" value="b"
     onclick="scoreQuestions(1, 'b')" />Brachiosaurus<br /> <!-- correct answer -->
<input type="radio" name="question1" value="c"
     onclick="scoreQuestions(1, 'c')" />Brontosaurus<br />
<input type="radio" name="question1" value="d"
     onclick="scoreQuestions(1, 'd')" />Diplodocus</p>
<p><b>2. When did dinosaurs become extinct?</b></p>
<p><input type="radio" name="question2" value="a"
     onclick="scoreQuestions(2, 'a')" />1 billion years ago<br />
<input type="radio" name="question2" value="b"
     onclick="scoreQuestions(2, 'b')" />65 million years ago<br /> <!-- correct answer -->
<input type="radio" name="question2" value="c"
     onclick="scoreQuestions(2, 'c')" />10 million years ago<br />
<input type="radio" name="question2" value="d"
     onclick="scoreQuestions(2, 'd')" />15,000 years ago</p>
<p><b>3. Which of these is not a dinosaur?</b></p>
<p><input type="radio" name="question3" value="a"
     onclick="scoreQuestions(3, 'a')" />Megalosaurus<br />
<input type="radio" name="question3" value="b"
     onclick="scoreQuestions(3, 'b')" />Apatosaurus<br />
<input type="radio" name="question3" value="c"
     onclick="scoreQuestions(3, 'c')" />Pterodactyl<br />  <!-- correct answer -->
<input type="radio" name="question3" value="d"
     onclick="scoreQuestions(3, 'd')" />Triceratops</p>
<p><b>4. In which period did the Diplodocus live?</b></p>
<p><input type="radio" name="question4" value="a"
     onclick="scoreQuestions(4, 'a')" />Early Cretaceous<br />
<input type="radio" name="question4" value="b"
     onclick="scoreQuestions(4, 'b')" />Early Triassic<br />
<input type="radio" name="question4" value="c"
     onclick="scoreQuestions(4, 'c')" />Late Triassic<br />
<input type="radio" name="question4" value="d"
     onclick="scoreQuestions(4, 'd')" />Late Jurassic</p> <!-- correct answer -->
<p><b>5. Which of the following dinosaurs was a carnivore?</b></p>
<p><input type="radio" name="question5" value="a"
    onclick="scoreQuestions(5, 'a')" />Tyrannosaurus<br />  <!-- correct answer -->
<input type="radio" name="question5" value="b"
    onclick="scoreQuestions(5, 'b')" />Triceratops<br />
<input type="radio" name="question5" value="c"
    onclick="scoreQuestions(5, 'c')" />Stegosaurus<br />
<input type="radio" name="question5" value="d"
    onclick="scoreQuestions(5, 'd')" />Brontosaurus</p>

</form>
</body>
</html>

You missed '}' after your switch statement mate :)

Ah, thanks so much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.