My latest project involves developing a web-based testing application using CakePHP.
Here's how it works: when a user starts a test, the exact start time is stored on the web server. Once the test is completed and the answers are submitted, the server cross-checks the submission time with the initial start time. If the total time falls within a specified margin of error (e.g. 5 minutes), the test result is deemed valid.
I've successfully implemented this functionality and currently utilize the jQuery Countdown Plugin to display a timer for the client in their browser. This same timer also triggers an automatic form submission upon expiration.
The issue arises when the page is refreshed or navigated back and forth, as this inadvertently resets the timer. Although the total test duration is tracked and verified on the server side (thus preventing users from manipulating the timer and submitting fraudulent results), I'm curious if there's a way to address or warn against this behavior, or even better, automatically submit flagged instances of tampering (which would subsequently be rejected).
I have considered incorporating AJAX for this purpose, but have been advised against doing so by management citing bandwidth concerns (which I personally doubt). Does anyone have any suggestions or workarounds?
Thank you in advance!