![]() ![]() ![]() It is basically the same with visitor counters or polls.Ītleast you have to store your information somewhere if there user as already triggered that script and redentify him on every page call. There are different possible solutions for problems like this. To make sure the user does not change his questionnaire_id manually you can save it in a session on the server so the user won't have access to it. If it's the first time the user submit this questionnaire you can update the score, if not, do nothing. This way you can make sure the user can't submit the same questionnaire results twice (or more). Generate new questionnaire each time the user gets new questionnaire and save his answers per questionnaire. Use 2 tables: -Īnd -Įach questionnaire is unique and contains some questions - the answer to each question is empty at the start. If you want to use questions multiple times I recommend another method. This method works assuming you won't present the same question again if the user already answered it correctly. If so, update his answer and if it's the correct answer update him score. ![]() When a user answers a question you can check if the user had already answered this question. You should add another table in order to do so. I would recommend saving the user's state in your database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |