Re: Re: Time limit in the script
| From: | Randy Clamons | Date: | Thu, 17 Feb 2005 18:49:11 +0000 |
| Subject: | Re: Re: Time limit in the script | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-25608@lists.php.net to get a copy of this message | ||
Using Javascript, try this function:
iTimerID = window.setTimeout(vCode, iMilliSeconds)
Set iMilliSeconds to one hour (60*60*1000 = 3600000)
vCode should call a function that submits the form for scoring. Something like
"document.forms[0].submit()" should work, assuming there is only one form on the page.
If your multiple choice test is several pages long, your problem is more complicated.
Randy Clamons
Systems Programming
Novaspace.com
> ------------Original Message------------
> From: "Reptilevl" <reptilevl@gmail.com>
> To: php-windows@lists.php.net
> Date: Thu, Feb-17-2005 0:58 AM
> Subject: [PHP-WIN] Re: Time limit in the script
>
> you could allways set a cookie with the timestamp in it and calculate
> problem is, that you won't be able to forward when it's exactly an hour
> if
> you know what I mean.
>
> I made a similar thing once.
> I did the forms and stuff in PHP
> but I used Javascript for the timer.
> I would give you the code but i lost it in a format I'm afraid.
> but it worked like a charm.
>
> I hope thise gives you an idea on how you can solve your problem
>
> "Veselina Jecheva" <vessi@bfu.bg> wrote in message
> news:5.0.2.1.0.20050215153924.00a022f0@masters.bfu.bg...
> > Hello, everyone,
> > I have to make a script, that allows the user to solve an online test
>
> > (multiple choise). The test has to be solved during the specific
> period of
> > time (1 hour).
> > How can I interrupt the user after the end of the hour and redirect
> him to
> > another page with the results, for example?
> > Thanks in advance
> > Veselina
> >
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>