Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Servlet help anyone?

Options
  • 04-01-2005 10:16pm
    #1
    Registered Users Posts: 758 ✭✭✭


    Hi all,

    Hav to do a small project and one part is annoying me. I have to make quiz type thing and then and let someone answer questions one at a time. Each time they answer a question they win a prize and they're moved to the next question. This one has to replace the old question. I have most of it done....

    But...

    I need to track a persons progress. The servlet has to move to the next question for that person. so when they answer a question correctly the next question comes up...

    Here's my idea - if there is any information its passed to the servlets doPost method and its checked and the next question is posted if correct. and if thers no information being sent to the servlet the first question is displayed?

    Will this work? As in... will multiple users be able to use the servlet at once or is that a stupid question? :confused: Dont really know how servlets work? Im more a php person???

    Any help at all, ideas anything would b appreciated?

    Thanks


Comments

  • Moderators, Politics Moderators Posts: 39,765 Mod ✭✭✭✭Seth Brundle


    Why not just use Cookies?


  • Registered Users Posts: 1,994 ✭✭✭lynchie


    If you need to store information unique to a user over multiple requests you should use a Session. Look at the many tutorials on using the HttpSession class on Sun's website for pointers on how to use it.


  • Registered Users Posts: 27,163 ✭✭✭✭GreeBo


    Archytas wrote:
    Hi all,

    Hav to do a small project and one part is annoying me. I have to make quiz type thing and then and let someone answer questions one at a time. Each time they answer a question they win a prize and they're moved to the next question. This one has to replace the old question. I have most of it done....

    But...

    I need to track a persons progress. The servlet has to move to the next question for that person. so when they answer a question correctly the next question comes up...

    Here's my idea - if there is any information its passed to the servlets doPost method and its checked and the next question is posted if correct. and if thers no information being sent to the servlet the first question is displayed?

    Will this work? As in... will multiple users be able to use the servlet at once or is that a stupid question? :confused: Dont really know how servlets work? Im more a php person???

    Any help at all, ideas anything would b appreciated?

    Thanks
    Do you even need to keep track of each user?
    For example: I provide an answer for question 4 which is passed into the servlet, my answer is checked and if correct I move to question 5 (current question + i) else I stay where I am.
    I dont see why you need to keep track of everyone individually on a session?
    For every user the logic is the same, if the answer is correct, move to the next question
    or am I missing something? :confused:


  • Registered Users Posts: 758 ✭✭✭Archytas


    Yep your right... I was just a little confused! Thanks for the help!


Advertisement