Add more options for surveys

* Survey period constraints
* Add abilities
* Enforce required questions
* Update survey_submssion updated_at
* Do a full match of possible answer and user reply
This commit is contained in:
Stella Rouzi 2018-02-09 19:07:10 +02:00
parent c278e547ce
commit 683f62a27c
36 changed files with 219 additions and 74 deletions

View file

@ -0,0 +1,22 @@
%span.badge
= question_index
= survey_question.title
- if survey_question.multiple_choice?
( Select
- if survey_question.min_choices != survey_question.max_choices
a minimum of
= survey_question.min_choices
- if survey_question.min_choices != survey_question.max_choices
and a maximum of
= survey_question.max_choices
choices )
- if survey_question.mandatory
%span.fa.fa-asterisk.text-danger
- if can? :edit, @survey
%p.pull-right
= "(#{survey_question.survey_replies.count} replies)"
= link_to edit_admin_conference_survey_survey_question_path(@conference.short_title, @survey, survey_question) do
%span.fa.fa-edit
= link_to admin_conference_survey_survey_question_path(@conference.short_title, @survey, survey_question), method: :delete, data: { confirm: 'Are you sure you want to delete this question?' } do
%span.fa.fa-times