0

Hello
I am new in php working on online exam type webapplication my client requirement is this durring the test the user cant move backward or cant press the back button of browser

how can i control it
there are few javascripts i try but they not working if user disable the javascript

please tell me solution for this

4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by codejoust
0

I suggest a few steps; but if Javascript is disables, part of this will fail.
1. open the app as new pop-up window without menu/toolbars etc. (need JS)
2. disable right click (using JS)
3. disable back key (using JS, causes bad user experience)
4. Add "Expires" to HTML headers of each page that should be backed
However, on second thought, why not keep track of what questions are already answered, on server (may be session may be database) so that questions cannot be re-submitted.

Hope the discussion helps

0

Since PHP is server-side, it can't actually disable the back button, all you can really do with it is prevent that data is lost when people do, sometimes.

0

This can be solved with a php session, saving the question to the session, and using a database/array/file to load the next question on the same page (or hidden POSTS using forms on the next buttons).
This way, when they try to go back, they receive the same question (as saved in the session or in the form...) if there is not cookie or form, it goes back to the 1st question.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.