disable refresh

Results 1 to 2 of 2

Thread: disable refresh

  1. #1
    Join Date
    Dec 1969

    Default disable refresh

    I have programmed an on line test in ASP. I have set the the time for each question which is 30 seconds, after 30 seconds the next question is displayed. I have programmed this in java script. The problem is with the refresh button, If the user submit refresh button, the timer starts from the beginning. I have solved the problem for back button but refresh button problem is still there. Can any one help.<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: disable refresh

    I am not sure if this will be OK with the rules of your application, but ...<BR><BR>If you catch the time on the server, save it in a session variable along with a session variable that stores the current question. You could time how long it take to answer a question server side. If a user hits refresh and the session variable for the question number is the same as the current one on the page don&#039;t update the time in your other session variable.<BR><BR>The code might look something like this (i am not testing it so if it doesn&#039;t work I am sorry):<BR><BR>currentQuestion = 1 <BR>If session("currentQuestion") &#060;&#062; currentQuestion Then<BR>session("currentTime") = time()<BR>ElseIf session("currentQuestion") = currentQuestion and session("currentTime") + 30 &#060; time() Then<BR>&#039;Go to next question<BR>End If<BR><BR>Hope this is a help to you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts