Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disabling Refresh Button

 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello i am having an a web page on which conducts online exam.I have used the following javascript for creating a time exam count down time




Now my problem here is that when i click refresh button the timer resets itself and that is WRONG because that will give the users extra time to finsh the exam paper.
I googled and all they were suggesting me is to handle it using session rather then disabling.
Any suggestions please ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luckily, you can't. Please read InterfaceDesignersRule1. You shouldn't be trying to stick your fingers where they don't belong.

Keep track of the timer in the session as you've already discovered.
 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Luckily, you can't. Please read InterfaceDesignersRule1. You shouldn't be trying to stick your fingers where they don't belong.

Keep track of the timer in the session as you've already discovered.



could you please elaborate how would things work by putting the timer in session.
Thanks
 
Sagar Shroff
Ranch Hand
Posts: 209
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone please help !? IS There no 1 with a solution to my problem ??
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PatienceIsAVirtue. It's a weekend right now.
 
Paul Clapham
Sheriff
Pie
Posts: 20958
31
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Come on, it's not that hard. Whatever generates that page will also put the current time into the session. That's the basis for your timer. If you need to notify the user immediately when the timer expires, you can send an AJAX request every second which compares the current time to the time in the session and see if it's expired.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic