views:

2257

answers:

8

I am developing an online exam using JSP/Servlets which is nearing completion. I'm planning to add timer function for the entire exam that shows elapsed time in minutes. How do I implement this with a fool-proof technique to implement this, because using javascript would mean that the user can turn off the feature in the browser. Any help on this would be highly appreciated.

+1  A: 

Server Side

Store the time elapsed in the users session.

Your pages can display the time remaining in javascript, People can mess with the javascript but they have no capability of messing with your timing logic always get the time remaining from server.

Current Time - Start Time on all answers etc

Paul Whelan
+5  A: 

Record the time that the user started and finished on the server. The user will have to press a button to indicate that they've started the exam, which can trigger the server to stamp the start time; when the final answer is submitted, the server can record the total time taken.

Ewen Cartwright
A: 

You can make javascript a requirement in the user's browser, and use javascript+AJAX - every minute, get the updated time from the server or make sure the times are synchronised.

trex279
you can make javascript a requirement OR use ajax???? huh?
Vinko Vrsalovic
my bad... meant 'and'
trex279
+2  A: 

At Terracotta, we recently developed a reference web application for online exam-taking. We also implemented a client-side timer with Javascript and the code is open-source if you'd like to take a look.

The main page for the docs and live demo is http://reference.terracotta.org

The project source for the last release is here: http://svn.terracotta.org/svn/forge/projects/exam/tags/release-1.0.1/

The actual Javascript timer code is here. Hopefully that's enough pointers to go on.

Alex Miller
A: 

is there any sample for php ?

A: 

hai i am planning to do online project in java can u plzzzzzz help me plz i need help u can send me to [email protected] plzzz help

Are u going to do Online exam web application or some other project?please provide full details....
BlackPanther
+2  A: 

Better You trace exam starting time and store it into server.In client side you can use the count down timer.If they disable the javascript it affects the timer running in client.

A: 

Hello Alex from Terracota. I couldn't get the javascript mentioned by you working.Here's the link that you had given http://svn.terracotta.org/svn/forge/projects/exam/tags/release-1.0.1/src/main/webapp/js/examTimer.js

Can you pls provide a complete working code(along with html and javascript tags,etc)

Hemant