Jump to content

Calling Functions


pauldboughter
 Share

Recommended Posts

ok this is a 2 part issue...1. I am trying to increase the value of the quizclock in the quiz form by 1 using the seconds variable. Using the below script. I can't seem to get it to work. any ideas where I went wrong. <script type="text/javascript"> var seconds = 0 var clockId function runClock() { seconds = seconds + 1; document.quizform.quizclock.value = seconds; } </script>2. I am also trying to create a function called startClock() function that will start my web page clock. while adding the following commands. a. call the showQuiz() function to display the questions on the exam. This is what I came up with....<script type="text/javascript"> var seconds = 0 var clockId function runClock() { seconds = seconds + 1; document.quizform.quizclock.value = runClock(seconds); } function startClock() { showQuiz(); } </script>Here is the .js file that stores the functionsfunction showQuiz() { document.getElementById("quiztable").style.visibility="visible";}function hideQuiz() { document.getElementById("quiztable").style.visibility="hidden";}function gradeQuiz() { correct=0; if (document.quiz.q1[2].checked) correct++; if (document.quiz.q2[0].checked) correct++; if (document.quiz.q3[3].checked) correct++; if (document.quiz.q4[0].checked) correct++; if (document.quiz.q5[3].checked) correct++; document.getElementById("cor1").style.backgroundColor="yellow"; document.getElementById("cor2").style.backgroundColor="yellow"; document.getElementById("cor3").style.backgroundColor="yellow"; document.getElementById("cor4").style.backgroundColor="yellow"; document.getElementById("cor5").style.backgroundColor="yellow"; for (i=0; i<document.quiz.elements.length; i++) document.quiz.elements.disabled=true; return correct;}

Edited by Big Papa
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...