Forum Moderators: coopster

Message Too Old, No Replies

PHP to manage time

         

dbarasuk

7:59 pm on Aug 1, 2009 (gmt 0)

10+ Year Member



HI.
I once did an online exam with questions running in a browser where PHP was used to create the pages.

In those questions, there were many multiple questions and every question was minuted, i.e every question had a number of minutes to last after what i was redirected to the next question whether or not I had finished to answer the question.

So my question is, how can I write a PHP script that can do that job?
Please if you know any tutorial on that subject, I'd be glad to see it.

Thanks

eelixduppy

6:26 am on Aug 2, 2009 (gmt 0)



Sounds like they used javascript and set a timeout for each question then redirected when the event was triggered.

[w3schools.com...]

Here's some more information on timing with javascript. Good luck. :)

dreamcatcher

7:33 am on Aug 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I guess you could also implement a meta refresh.

dc

andrewsmd

1:39 pm on Aug 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you go the JS way make sure you run a check first to make sure they have JS enabled in their websites. When I was in college I had tests like that, but they would let you do them without JS enabled and thus neutralizing the timer allowing me to google every single answer.

rocknbil

2:41 pm on Aug 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And you openly admit this? :-) (I am jazzing you . . . )

Meta refresh can also be disabled, however, there are ways to prevent this. Do a meta refresh or Javascript test on load of every page (test->JS/meta refresh OK->go to next test page, otherwise sent to failure page.) When answers are submitted, send a token to your server side script using either method. In either case, if your timer method has been disabled, redirect to an "epic fail" page.

The third option is to put the entire test in Flash, as long as there are no accessibility issues.

andrewsmd

2:58 pm on Aug 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can't expect a CS major to not try and exploit any and every test he/she comes across using technology. That's why most of my CS professors made us do projects instead of tests, they knew we would find a way to cheat :).