gabi456
asked on
stopwatch for online exam
Hello
I am developing an online exam that i need to show the user a clock ticking down in time (needs to show seconds also).
For example, the exam is 30mins so i need it to start at 30 then tick down and when it reaches 0 to show a message that the time is up.
Also the time needs to pulled from the DB of which each exam has a time field and that it needs to be pulled from there.
I am developing an online exam that i need to show the user a clock ticking down in time (needs to show seconds also).
For example, the exam is 30mins so i need it to start at 30 then tick down and when it reaches 0 to show a message that the time is up.
Also the time needs to pulled from the DB of which each exam has a time field and that it needs to be pulled from there.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could easily change the default value (line 124) to be 30 minutes (i.e., '30:00')
ASKER
I need it to be much more customized to my specific code eg, the timer starts automaticaly as the exam starts, no need for stop or start buttons etc...
That's easily done.
Make the "input" (line 214) be "readonly", like this:
<input type='text' id='clock' size='4' value='30:00' readonly>
and have the countdown start when the page is loaded, and if the timer expires, instead of displaying an alert() message, issue the submit.
Make the "input" (line 214) be "readonly", like this:
<input type='text' id='clock' size='4' value='30:00' readonly>
and have the countdown start when the page is loaded, and if the timer expires, instead of displaying an alert() message, issue the submit.