views:

107

answers:

3

i want to limit time of exam in the site , after the time is finish , alert popup window with message and redirect the user to another page.

the exam contain some pages , the user can turn pages forward and backwards. i want to prevent (how much i possible) to lie.

A: 

The alert can be done with a SetTimeOut in the page. However keeping track of the total time should be done based on the first 'start' of the exam, and should be done serverside. Give each user their own personal account and keep track of their progress serverside.

CtlAltDel
+1  A: 

I'd say that ensuring only a fixed time window is available to provide input data should be controlled in the backend application, not on the browser.

The browser can be manipulated by the user, the backend application can be controlled much more effectively.

You might want to provide more information about the technology stack and contraints you're working under to get more specific answers.

Brabster
+5  A: 

When they begin the exam, store the time on the server side. For every page they load, start a timer for however much time is left.

ysth
how can i know that the time finish and popup a alert ?
Haim Evgi
server knows it. Server can put javascript call into page: setTimeout(my_function_on_time_end, time_to_end_in_milliseconds)
Sergey Kovalenko