[script] var pos = 0, test, test_status, question, choice, choices, chA, chB, chC, correct = 0; var questions = [ [ "What is 10 + 4?", "12", "14", "16", "B" ], [ "What is 20 - 9?", "7", "13", "11", "C" ], [ "What is 7 x 3?", "21", "24", "25", "A" ], [ "What is 8 / 2?", "10", "2", "4", "C" ] ]; function _(x){ return document.getElementById(x); } function renderQuestion(){ test = _("test"); if(pos >= questions.length){ test.innerHTML = "

You got "+correct+" of "+questions.length+" questions correct

"; _("test_status").innerHTML = "Test Completed"; pos = 0; correct = 0; return false; } _("test_status").innerHTML = "Question "+(pos+1)+" of "+questions.length; question = questions[pos][0]; chA = questions[pos][1]; chB = questions[pos][2]; chC = questions[pos][3]; test.innerHTML = "

"+question+"

"; test.innerHTML += " "+chA+"
"; test.innerHTML += " "+chB+"
"; test.innerHTML += " "+chC+"

"; test.innerHTML += ""; } function checkAnswer(){ choices = document.getElementsByName("choices"); for(var i=0; i