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.
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
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.
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.
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.
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
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)