Meteor for a simple survey?


#1

Hi there,
To get started with meteor (first timer! :slight_smile: ), I would like to build a small survey form with it.

Maybe you guys can help me in assessing what I need to get on my way?


System-flow:

  1. User receives email with a unique link to the survey. (emails are not send by meteor)
    My idea was to give links a randomly generated extension, like survey.html=4434234, as a unique id.

  2. If the user clicks the link:
    By taking the last part of the url, the unique id (=4434234), the system checks with the database if the survey has already been completed for this link ( 4434234 = completed ? )
    ( If already completed: Display a message “You already filled out this form” )

  3. If the survey is still open:
    The user is redirected to form.html and the unique id is saved to a cookie (for id validation on submit, and so the user can’t meddle with the id inside the address bar )

  4. The form.html is displayed in either of two languages, depending on the user’s system language

  5. When the form is submitted:
    a. There is a front-end validation using js
    b. There is a backend validation to make sure that the form data is only integer, as well as checking again with the database if the unique id (read form the cookie) is still OPEN )

  6. If back end validation = OK:
    Display a confirmation message.

Requirements are:

  1. There’s no user login but the form can only be submitted once. (to avoid data pollution)
  2. Survey should be later exportable as csv.

Thanks for giving me your advice – I’m excited to get started with Meteor!


#2

Hello, welcome to Meteor! Check out atmosphere if you haven’t already. Have a look at shortid or hashid packages to generate random uids for your URLs. You can use a router like iron-router to map your survey forms to URLs like /survey/:id


#3

Instead of cookies, look at Session.get() / Session.set().