question builder

This commit is contained in:
Stella 2014-02-09 18:05:57 +02:00
parent 4356616566
commit 3105c8da5d
28 changed files with 338 additions and 15 deletions

View file

@ -8,3 +8,19 @@
Role.create(:name => "Participant")
Role.create(:name => "Organizer")
Role.create(:name => "Admin")
qtype_yesno = QuestionType.create(:title => "Yes/No")
qtype_single = QuestionType.create(:title => "Single Choice")
qtype_multiple = QuestionType.create(:title => "Multiple Choice")
answer_yes = Answer.create(:title => "Yes")
answer_no = Answer.create(:title => "No")
questions_yes_no = ["Do you need handicapped access to the venue?", "Are you attending with partner?", "Will you attend the social event(s)?", "Will you stay at suggested hotel?"]
for i in questions_yes_no do
q = Question.create(:title => i, :question_type_id => qtype_yesno.id, :global => true)
Qanswer.create(:question_id => q.id, :answer_id => answer_no.id)
Qanswer.create(:question_id => q.id, :answer_id => answer_yes.id)
end