File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes need help for tracking  time? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "need help for tracking  time?" Watch "need help for tracking  time?" New topic
Author

need help for tracking time?

Shilpa sathaye
Greenhorn

Joined: May 31, 2006
Posts: 6
I am developing software apllication using java/jsp,servlets for online aptitude test. I have to track the time for once student loged in for test. Once the time is finished i have to make him exit from application. Since he we will be appearing the test the test screens will be dynamic.

What will be best way to keep track for time??

pls suggest.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

Originally posted by Shilpa sathaye:
pls suggest.


"pls" is not a word. Please use real words such as "please" when posting to the forums. Please read this for more info.
[ February 07, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Shilpa sathaye
Greenhorn

Joined: May 31, 2006
Posts: 6
I will take note of that.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

Aer you wanting to track the time on the client or on the server?
Philip Shanks
Ranch Hand

Joined: Oct 15, 2002
Posts: 189
Hi Shilpa,

Since this is a test situation, you will not want to penalize the test taker with network latency, server response times and page loads eating up their time. I recommend having a cumulative client-side Javascript timer that is tied to a hidden form parameter, triggered with the page load (start the timer in the the bodynload() handler, initial value from hidden form parameter), and submitted to the server with form submissions (update the hidden form variable in the formnsubmit() handler) to track and initialize subsequent pages.

At a higher level, you might consider using Ajax components in your pages to better minimize the page-to-page latency issues. This will make the test duration appear more seamless, and provide the test taker with a (nearly) uninterrupted test environment.

I have had pretty good success with the dojo toolkit for this sort of application. It is simple to associate an HTML form with the XHR object, and update the form parameters dynamically from one request to the next.

Breaking the "back" button in a test environment is something you need to think about, but dojo provides workarounds for that too. An additional "plus" is the possibility of making your test work in off-line mode.

Good luck!
[ February 07, 2007: Message edited by: Philip Shanks ]

Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Shilpa sathaye
Greenhorn

Joined: May 31, 2006
Posts: 6
thanks Philip!! I hope working with hidden variable will help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help for tracking time?