mmarif4u Posted June 5, 2007 Share Posted June 5, 2007 Hi. I have a page in my site where a user give an exam, The problem is that If he wrong answer the q and then he know that the correct answer is C, So he go back and come again to that page and mark C as a correct answer. I dont want that from users. I want that if he or she click on the back button Then a message will comeout that save ur score. OR If he or she click the back button of the browser the page remain the same. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/54223-back-button/ Share on other sites More sharing options...
MemphiS Posted June 5, 2007 Share Posted June 5, 2007 You could use a $_SESSION to monitor which question there up to. Quote Link to comment https://forums.phpfreaks.com/topic/54223-back-button/#findComment-268085 Share on other sites More sharing options...
mmarif4u Posted June 5, 2007 Author Share Posted June 5, 2007 How to store in a session situation like this, can u explain it a little more. Quote Link to comment https://forums.phpfreaks.com/topic/54223-back-button/#findComment-268088 Share on other sites More sharing options...
MemphiS Posted June 5, 2007 Share Posted June 5, 2007 Well im assuming the user is signed up? They enter the questions.php page... how is the question page set? is it multiple choice on one page then they submit all the data. Or does it go to a new page.. need more info. Quote Link to comment https://forums.phpfreaks.com/topic/54223-back-button/#findComment-268090 Share on other sites More sharing options...
mmarif4u Posted June 5, 2007 Author Share Posted June 5, 2007 Yep they sign in then select a set of q's and q are all multiple choice like A:True B:False C:Non of these D: Wrong. So it mean that every q has 4 answers. Now if the user want to mark 2nd q and he did not mark 1st then an error pop up, this part is ok. But the problem is the back button. I want that for example he answer 4 q out of 20, 2 answer are wrong 2 are correct now if he want to go back and come again to mark the wrong one as correct. If he click the browser back button a pop up msg appear "that u have to save ur score to go back." And in pop up only one button which will be ok, when he click ok data is saved to db and page go one step back. Quote Link to comment https://forums.phpfreaks.com/topic/54223-back-button/#findComment-268097 Share on other sites More sharing options...
MemphiS Posted June 5, 2007 Share Posted June 5, 2007 Why ask the user if they wish to save and just auto save it in a sql db and in the sql db set questions choose and there answer. As soon as the click continue save there data. Quote Link to comment https://forums.phpfreaks.com/topic/54223-back-button/#findComment-268101 Share on other sites More sharing options...
mmarif4u Posted June 5, 2007 Author Share Posted June 5, 2007 This is to remind the user that next time he or she did not go for this type of situation. Quote Link to comment https://forums.phpfreaks.com/topic/54223-back-button/#findComment-268104 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.