Page 1 of 1

Creating a timed test in PHP?

Posted: Sat Nov 18, 2006 3:21 pm
by skallsen
I'm new to PHP and need to create a timed test. Well, maybe two timed tests: 1) keeps track how long someone takes to complete test and 2) a test that is timed and closes after a certain amount of time.

Number 1 is the one I need most urgently - does anyone know of a tutorial for something like that? Or where I could get some code to learn from and change variables to meet my needs?

Thanks much!

Posted: Sat Nov 18, 2006 5:47 pm
by Ambush Commander
Store the starting time in the database when you issue the test (be sure to give an ID too), and compare that with the ending time when the user submits the test. Works for both requirements.

If you want, some client-side JavaScript could be used to give the user realtime notification of their time left.