I am coding a web based exam application in PHP.
- The examinee has to choose a set of modules with the according questions.
- A module is represented as one-single-formular.
- For each module he got for example 30 minutes.
I will achive that if the 30 minutes are over, the state of the form (answered and unanswered questions will be stored in a database) and the form will be closed e.g. redirect to menu page. I tried something like that:
<?php
set_time_limit('30000');
function redirect(){
//...
}
$i = 1;
while($i <= 45){
sleep('60');
callthis();
flush();
$i++;
}
?>
At my hoster set_time_limit couldn't be used because of PHP's Safe Mode.
What is the most reliable server-based solution (no Javascript) for a form timer in PHP?