Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Developing Online Exam Project but Once User Login and Clicks Start Exam the timer gets started but in between the browser gets closed and when user login again the timer gets reset and start from beginning how can i Store Time and when to store time.

Can Any One Help me One idea i Have is Global.ashx but dont know how to use................
Posted
Comments
jkirkerx 9-May-14 16:45pm    
You would probably store the start time in a session value, so it persist even if you close the browser.<br>
exam name and start time.

Why does the browser close when you start the exam?
Codefroster 9-May-14 17:02pm    
If accidently user closes browser or network error connection lost so at that time

1 solution

Hey Man,
Take a look at this article : Save Changes on Close of Browser or When Exiting the Page[^]
Anyway, you need to save the time in a cookie. Never use session for saving these types of data's because if you save these simple data's on your session, it means you are making a big memory usage(disk or even database) on your server. You ought to save time in user's cookie.Nevertheless This is not a very good option because user can delete his cookies. So, what is the real way ???
Solution : when user clicked on Start button, save his start time in the database or a file in the server and when he wants to close the page, you need to save the exit time too. If he wants to open the page, you should write a code on pageload event of your page that gets start time and exit time from server-side and gives it to a javascript timer countdown code to calculate the remaining time and back to the game again. This the way that you can see in countdown codes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900