What would be the best way to stop a page from being refreshed by a user or atleast tell if it was. What I am doing is writing a page for Students to take a small quiz and as it is right now, they are able to refresh the browser and re-answer question to get the correct answer (questions are multiple choice). my first thought would be to make a function that stored the student name in a file on the start of the quiz, then when ever the student refreshes the page, check that file.

Any thoughts would be greatly appreciated

(and code if you have it)