avoinministerio/avoinministerio — pull request #267 by wasimakram (2012-10-17 01:04:33+00:00)
Title: Improved Survey

Question_Numbers:
Improved Implementation of question_numbers in future we should use reference_identifiers
q "> q_1 ""
The current code is backwards compatible so if surveys were defined using the old technique their display numbers will be used

Answer value:
Fixed Answer of Q15 and handling of other values.

Improved_Handling of multiple selected answers:
they will appear like a hash with answer position as keys and answer text as values.

Added latest idea to user_state

Here is the sample code for generating surveys:
survey = Survey.where(access_code: ENV[SURVEY_CODE]).order("survey_version DESC").first
response_set = ResponseSet.create(survey: survey, user_id: Citizen.find_by_email(ENV[CITIZEN_EMAIL]), user_state: ENV[USER_STATE])
edit_my_survey_path( survey_code: survey.access_code, response_set_code: response_set.access_code)

I have also created a method in application_helper with following signature
def self.get_survey_link(survey_code, user_email, user_state = nil)
e.g ApplicationHelper::get_survey_link("avoin-ministerio-attitudes-1-fi", "mailwasim@gmail.com")
gives you a path

Also added a debugging library
letters you can remove it but I thought it might be useful to I use it a lot

Updated the read me file.