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,16 @@
- @survey.survey_questions.each.with_index(1) do |survey_question, question_index|
.panel.panel-default
.panel-heading{ type: 'button', 'data-toggle': 'collapse', 'data-target': "#question-#{survey_question.id}", 'aria-expanded': 'true', 'aria-controls': 'collapse' }
= render partial: 'survey_question_title', locals: { survey_question: survey_question, question_index: question_index }
.panel-body.collapse{ id: "question-#{survey_question.id}" }
- if survey_question.survey_replies.any?
%table.table
%thead
%th User Email
%th Reply
%tbody
- survey_question.survey_replies.reload.each do |reply|
%tr
%td= reply.user.email
%td= reply.text