RE: Quiz Timer 07-16-2014, 04:03 PM
#5
(07-16-2014, 02:16 PM)Ex094 Wrote:Are you actually storing the user's session?(07-16-2014, 12:38 PM)zomgwtfbbq Wrote: I don't really get it...how come the time stops when the user goes offline? That's a pretty nice feature actually.
Anyway, just save the unix timestamp when the user starts and go from there. Personally I'd go for an ajax based quiz that would keep the quiz on your screen without reloading after each question was answered. After each answer you can send back some json data to load the next question or finish the quiz. You can eg use setInterval each second to check whether the time is already over. The advantage is that the user will be shown in realtime that the time is over and it's pretty much impossible to cheat. The only disadvantage would be that you send a request every x seconds to the server. But it will look much slicker.
I meant the timer resetsWell I'll see what I can do about this

Well I'll see what I can do about this![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)