Populating a survey and persisting the user's response

Let’s say I want to build a survey app that

  1. pulls questions and their types out of one table (QUESTIONS)
  2. processes these questions into say a 10 question form,
  3. user fills in form fully and submits or partly and comes back to it
    later. (RESPONSES)

I -think- I should have one controller (Form) that pulls records from
both Questions and (If has already started survey) Responses and loop
through in the view, constructing each formfield and the user’s
response.

But,

  1. Where do I put the logic re use this _partial for question type 1
    (multiple choice) and this _partial for type 2 (essay)? The view, the
    controller?
  2. How can I save the user’s responses continuously so that if the
    connection is lost, they don’t lose their responses?