Click here to Skip to main content
15,936,850 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
I have created a quiz application. The only issue left is how and where to employ the timing mechanism. When the test is started the timer should start running and not be affected by postbacks happening. Once the timer runs out the momentarily answered questions should be submitted.

How can I implement this?

Please guide me!
Updated 15-Mar-13 2:52am
Richard MacCutchan 15-Mar-13 8:11am    
ZurdoDev 15-Mar-13 8:13am    
Please remove the CAPS.
ZurdoDev 15-Mar-13 8:13am    
Postback should not affect the timer? Then I think you need to use ajax and not do postbacks.
Sergey Alexandrovich Kryukov 15-Mar-13 10:12am    
Or use session state variable; session state can store intermediate time between postbacks...

1 solution

On the button click of start quiz the timer should be started. If you have a master page, implement the timer there. So it will not be affected by any post back event in the pages.
Once the timer has completed, an End_Quiz() method should be called at the timer's completed event. This method will consists of all the mechanisms to submit answers, check the correct ones and calculate score.
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