Link to home
Start Free TrialLog in
Avatar of Tomsaunders

asked on

Using a server clock for an online quiz timer

Hi All,

A client recently asked me to help with a Flash problem. I couldn't work it out but I hope somebody here can.

I'm not sure if I can upload FLAs on here but maybe there's another way to get it across?

I didn't create the Flash file but whoever did must have a very messy bedroom because it took a few minutes for me to get my head round it!

Anyway, this online quiz works perfectly except for when people are cheating. The user can cheat if they're using a really slow computer by repeatedly pressing the "Print Screen" button. This slows down the computers processor enough so that the flash movie slows down. If the movie slows down enough the user will get more points for their answer, and the more points they get, the higher their ranking and they illegitimately win holidays! It's turning into a bit of a problem.

I wonder if there's a way of having it determined by a server side clock which won't slow down, or if there's any other way of doing it so that the flash movie only logs the score relevant to the server side clock?

I'm a little out of my depth on this one!

Many thanks,

Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>repeatedly pressing the "Print Screen" button. This slows down the computers processor
>enough so that the flash movie slows down
That may be true, but the getTimer() function in Actionscript counts the number of milliseconds since the SWF began playing. A check on that at the start and end of the quiz will give the length of time spent - however much they've slowed down the SWF.

However, if you really want to make a call to a server then try the XML.sendAndLoad method.

A call to your server at the start and end could capture the server clock time (you'd need a bit of PHP, ASP, CFM or whatever to get the time and return the XML) and you could do the maths with that.
Avatar of Tomsaunders


Thanks for that, sorry about the delay!