#Step 1: Wireframing
- '/' Index page:
- navigation: login/signup -when user is logged in, the nav changes to account management, create survey, and logout
- Shows a list of all surveys -Each survey shows -Survey creator, -Survey created -Survey count -Survey is a link to the page for that survey This is sorting somehow.
Kevin will teach partials, and also will help us make the login form modal.
- '/login' (partial)
- login form
- username
- password
- submit buton
-
'/signup' (partial)
- copy of sign-in
-
'/users/user_id/account_management'
- nav bar
- landing page for reporting and statistics
- ignore user profile (don't change name or password)
- list of surveys created
-
'Statistics page for surveys' -This is a dummy page
-
'What is the resful way to create page route'
- Survey has a name
- Survey has a list of already created questions
- Survey has a question form
- Question
- Set of answers
- Create Question button
- Kill survey button
- 'survey/id '
- Display survey
- submit button
- Thank you for taking survey!
- Button that redirects to main page
#Schema
- Users
- id
- name
- password
- timestamps
- Survey
- title
- created_at(timestamp)
- user_id
- Question
- survey id
- content
- Possible Answers table
- question_id
- text
- Participant
- user_id
- survey_id
- Results
- participants_id
- answers_id
#Survey Gorilla Challenge
We're going to build a survey application that lets users create their own multiple-choice polls and other users to vote in them.
This is going to use a combination of pure JavaScript and AJAX to achieve the desired effects.
A survey will have many questions. Each question will have many possible responses. A voter will select one (and only one) response for each question in a survey.
##Objectives
###Models Go back to the polling schema challenges. This schema will be fairly complex and it will help to think in terms of survey-creators versus survey-voters.
There should be at least 6 core models/tables. You'll need a table to hold rows that represent the following sort of facts:
- User A exists
- User A created Survey X
- Question Y belongs to Survey X
- Possible Choice Z belongs to Question Y
- User B completed Survey X
- User B chose Possible Choice Z for Question Y
Each of these should correspond to a single table in your database and a single model in your app.Users need to be signed in to create a survey and vote in a survey.
###Wireframes Work through wireframes and discuss what your core pages are and what your core user flows are.
There should be two core flows: survey creation and survey completion. One possible division of labor would be to separate these two flows.
###Survey Creation Users will want to create their surveys in "one go" by adding multiple questions and choices per question on a single page. This is an opportunity to create some fun dynamic forms. Check these out:
- [Adding Form Fields Dynamically with jQuery](http://www.mustbebuilt.co.uk/2012/07/27/adding- form-fields-dynamically-with-jquery/)
- [Dynamically Add Input Fields To Form Using jQuery](http://www.infotuts.com/dynamically-add- input-fields-to-form-jquery/)
Google "jquery dynamic form fields" to find more.
To start and for your own sanity, maybe limit each survey to a single question. Create a version with a single question per survey working first and add support for multiple questions later. Surveys should also have an optional image associated with them. [CarrierWave] (https://github.com/jnicklas/carrierwave) is your friend; you'll come to love it with time.
###Survey Taking
For now, a user has to answer every question in a survey. You should be able to implement this constraint using a single custom validation on a single model.
###Survey Results
Create a nice page that shows the survey creator the results of a survey. If you want to do something fancy, try using d3.js. This is very advanced. There are other charting libraries like Flot or [Highcharts] (http://www.highcharts.com/).
At the very least, create some simple HTML bar charts by having percentage-width divs with a fixed height and solid background color so that we can see how people responded for each question in a particular survey.
###Advanced Features
If you're looking for more advanced features, how about something that lets a user view a survey without logging in but pops up a modal dialog to prompt a user to sign in/sign up right before they vote?
How about more advanced visualizations, like time series? How about focusing on making the user interface really nice? How about multiple question types?