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:
parent
c278e547ce
commit
683f62a27c
36 changed files with 219 additions and 74 deletions
|
|
@ -10,15 +10,19 @@
|
|||
= @survey.start_date
|
||||
to
|
||||
= @survey.end_date
|
||||
|
||||
- unless @survey.active?
|
||||
%label
|
||||
%i.fa.fa-exclamation-circle
|
||||
This survey does not accept replies at this monent.
|
||||
.row
|
||||
.col-md-12
|
||||
= semantic_form_for @survey_submission, url: reply_conference_survey_path(@conference.short_title, @survey) do |f|
|
||||
- @survey.survey_questions.each.with_index(1) do |survey_question, question_index|
|
||||
.row
|
||||
.col-md-10.col-md-offset-1
|
||||
- survey_reply = survey_question.survey_replies.find_by(user: current_user) || SurveyReply.new(survey_question_id: survey_question.id, user_id: current_user.id)
|
||||
- survey_reply = survey_question.survey_replies.find_by(user: current_user) || SurveyReply.new(survey_question_id: survey_question.id, user: current_user)
|
||||
= render partial: 'admin/surveys/survey_question', locals: { survey_question: survey_question, question_index: question_index, survey_reply: survey_reply }
|
||||
|
||||
.row
|
||||
.col-md-10.col-md-offset-1
|
||||
= f.submit 'Submit', class: 'btn btn-primary pull-right'
|
||||
= f.submit 'Submit', class: 'btn btn-primary pull-right', disabled: !(can? :reply, @survey)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue