SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to resume a questionnaire at later time?

    Hello

    I have build a online questionnaire with 20 question. Each question is on it's own page with a "next" button which saves the answer along with the user id.

    There are separate tables for every question.

    At the end there are one page that shows a summarize of questions and answers.

    Now, the client is asking if it possible to let the user leave off in the middle and continue at a later time. Can this be done? How to do it?

    The only way to do that I can think of, is to use cookies. But that will - if I understand it right - only work if the user use the same computer the next time.

    Any other way to manage this?

    Regards, Magnus

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The only other way is to provide them with a username/password or some other identifier so they can tell you who they are to resume the questionnaire later.

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,014
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Brake6 View Post
    ...which saves the answer along with the user id.
    dan, that's it right there
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi again,

    I have done some thinking and ... is this a smart and useful way:

    - Add a new table "lastquestion" which have two fields: user ID and lastQuestionNumber

    - This table gets updated every time a user clicks on "next".

    - Next time the user log in he/she can choose to "continue from last time". The number in the lastquestion table is read and he is redirect to the new question.

    Stupid or doable?

    Regards, Magnus

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,014
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    not stupid, but not needed

    you said that each time the person presses Next, the application saves the userid along with that answer

    so there is no need to store the last question answered in a separate table, because you're already doing that in the answers table

    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    not stupid, but not needed

    you said that each time the person presses Next, the application saves the userid along with that answer

    so there is no need to store the last question answered in a separate table, because you're already doing that in the answers table

    Okay
    But I'm a little lost here. What shall I check for (in the tables?) to redirect the user to the "next" question? In each question table I save the user ID, the answer and the current date.

    And (I forget to tell in my first post) that the user is supposed to to come back and do all the questions again (it's all about statics). So there can be three sets of completed answers and a fourth one just partially completed. How do I let the user continue the forth time?

    All the answers (on question #1 for example) can then be compared to each other.

    Regards, Magnus

  7. #7
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,014
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by Brake6 View Post
    What shall I check for (in the tables?) to redirect the user to the "next" question?
    look for the latest question that the user has answered, and send him to the next question

    alternatively, look for the first question the user hasn't answered yet, and send him to that one


    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •