pauldboughter Posted February 15, 2010 Share Posted February 15, 2010 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;} Link to comment Share on other sites More sharing options...
jeffman Posted February 15, 2010 Share Posted February 15, 2010 Look at setInterval and setTimeout Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.