Store form values for later submission

Posted by kim griggs on Stack Overflow See other posts from Stack Overflow or by kim griggs
Published on 2010-06-16T23:31:54Z Indexed on 2010/06/17 0:32 UTC
Read the original article Hit count: 222

Filed under:
|
|

I have a Rails app that lets users create tutorials and quizzes. There are many users taking the quizzes and many quizzes in a tutorial. My client wants the quiz results to persist when a student navigates away from the quiz. So the use case would be:

  • User starts to take quiz
  • User answers some of the questions
  • User navigates away from quiz to check a fact in the tutorial
  • User goes back to quiz and their answers are still there
  • User finishes quiz and submits

Now this would be pretty easy to do if I enforced a "Save" submit so that the answers could be stored in a session or whatever, but the client (and I agree) thinks people will not remember to save before navigating away.

Looking for advice on how to approach this. I'm thinking an observer and cookies.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about AJAX