Monday, May 9, 2011

No Turning Back

To help prevent against cheating or accidental button pressing during the assessments we have had to disable AJAX support on the JQuery Mobile framework. This feature is designed to pre-load the next page and slide it into view with a lovely JavaScript animation. Unfortunately this caching of pages proves a hindrance when creating a quiz with an aim of preventing the user from going back after receiving the result of their answer or accidentally refreshing the page.

We wanted the user to be able resume the assessment in the event that they do accidentally press back, reload the page or the device/application crashes. While disabling AJAX was the first step towards this goal, we discovered yet another form of caching native to most modern mobile browsers which is not currently being used by their desktop counterparts. This caching means that when a user does press back rather than reloading the previous page it simply moves back to it as though they never left without running through the code or reloading scripts. Since this form of caching cannot be disabled under any of the mobile web browsers, this has meant our resuming redirection script cannot be triggered simply on page load but must also be activated by pressing a button, so while refreshing will redirect the user back to the question they were up to, if they go back they must proceed before they are redirected.
While it was a little tricky to implement and has exposed a number of shortcomings of the mobile web platform, our workarounds appear to be working well and will provide a safeguard against this form of cheating or accidental button pressing.

No comments:

Post a Comment