• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

examination system : countdown timer ?

 
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am building a examination system. But I don't know how to implement a timer / clock.

When user is taking an exam, he should have a countdown timer. How to do this ? how to remember the time between jsp pages ? seperate thread to countdown time in server side ?

Thanks in advance .
 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about this...

When the user starts the exam create a Date object representing when the exam ends, then save it in the session.

For every request (inc the first) create another Date object representing the current time and save it in the session

Create an applet clock that shows the time difference between the current and the exam end date objects - thats your time left on the exam.

Easy peasy...
[ October 05, 2005: Message edited by: Daniel Rhoades ]
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, if you have the exam sent at one go, that is if the user doesn't have to submit every question, but submits the answers all at once, you have to set the timer in a javascript as depicted here
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic