Help With Simple Quiz

The user is supposed to answer the 4 questions and then a pop-up appears telling the user if they have passed or not. I can’t figure out why this is not working correctly. The working website page is here:

Any help would be really appreciated?

<script type = “text/javascript”>

function validate(myForm) {

var allQuestions = new Array(Quiz.q1,

return checkAnswers(allQuestions);

function checkAnswers(allQuestions){
var totalScore = 0; //initialize to 0

for (var i in allQuestions) {
var temp = allQuestions[i];

for (var j = 0; j &lt; temp.length; j++) {

//if the correct one is chosen then add 1 to total score
  if (temp[j].value == "correct" && temp[j].checked == true) {


//if the total percentage is more than 75%
if ((totalScore/allQuestions.length) >= .75) {

alert("Congratulations! Your score of " + totalScore +
 " out of " + allQuestions.length + " is very good!");
 return true;

//otherwise alert and return false
alert(“You must get at least 75% correct to pass!”);
return false;

// –>


<!–HTML Code Start–>

<div id=“container”>
<div id=“header”>

<div id=“navigation”>
<li><a href=“…/index.html”>Home</a></li>
<li>Wine Facts</li>
<li><a href=“quiz.html”>Wine Quiz</a></li>

<!–unique html page elements–>
<div id=“content1”>
<div class=“position”>
<div class=“form”>
<h3>Wine Quiz</h3>

		&lt;form name="Quiz"&gt;

		Question 1: Which of these is a letter?&lt;br&gt;
		&lt;input type="radio" name="q1" value="correct"&gt;A&lt;br&gt;
		&lt;input type="radio" name="q1"&gt;1&lt;br&gt;
		&lt;input type="radio" name="q1"&gt;#&lt;br&gt;
		&lt;input type="radio" name="q1"&gt;None of the Above&lt;br&gt;
		Question 2: Which of these is a number?&lt;br&gt;
		&lt;input type="radio" name="q2"&gt;A&lt;br&gt;
		&lt;input type="radio" name="q2" value="correct"&gt;1&lt;br&gt;
		&lt;input type="radio" name="q2"&gt;#&lt;br&gt;
		&lt;input type="radio" name="q2"&gt;None of the Above&lt;br&gt;
		Question 3: Which of these is a symbol?&lt;br&gt;
		&lt;input type="radio" name="q3"&gt;A&lt;br&gt;
		&lt;input type="radio" name="q3"&gt;1&lt;br&gt;
		&lt;input type="radio" name="q3" value="correct"&gt;#&lt;br&gt;
		&lt;input type="radio" name="q3"&gt;None of the Above&lt;br&gt;
		Question 4: Which of these is a comma?&lt;br&gt;
		&lt;input type="radio" name="q4"&gt;A&lt;br&gt;
		&lt;input type="radio" name="q4"&gt;1&lt;br&gt;
		&lt;input type="radio" name="q4"&gt;#&lt;br&gt;
		&lt;input type="radio" name="q4" value="correct"&gt;None of the Above&lt;br&gt;
        &lt;input name="button" type="Submit" onClick="return checkAnswers()" /&gt;


<div id=“footer”>
<li>Contact | Terms | Privacy</li>

The form submit button is executing the wrong function.

Instead of returning the result from checkAnswers you should instead return the result from the validate function.