views:

64

answers:

3

Hi

I have to create a web page for a online quiz which will display same questions in different sequence for each user. Now, I have written code which takes questions randomly every time when user visit that page. User goes to that page by login id and password. I have used random function in query which gives questions in different order for each user. But now problem is when i refresh that page question order changes for the same user. So i wants to disable refresh button. Can you please tell me how to disable it? or is there any other way?

+2  A: 

It's impossible to disable refresh button.

You can try to save questions order in users session and then use it.

Māris Kiseļovs
beat me to it...
Lex
+2  A: 

You can't disable the button. You shouldn't be messing with the user's browser.

What you can do however, is to show a dialog asking the user if they want to leave the page.

<body onbeforeunload="return 'Are you sure you want to leave the page?';">
NullUserException
A: 

Just generate and store question order once per session or login instead of on every request.

BalusC