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
13
app/views/admin/surveys/_survey_stats.html.haml
Normal file
13
app/views/admin/surveys/_survey_stats.html.haml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
= javascript_include_tag "//www.google.com/jsapi", "chartkick"
|
||||
= javascript_include_tag 'chartkick'
|
||||
|
||||
= bar_chart @survey.survey_questions.map{ |q| [q.title, q.survey_replies.count] }
|
||||
|
||||
- @survey.survey_questions.each.with_index(1) do |survey_question, question_index|
|
||||
.panel.panel-default
|
||||
.panel-heading
|
||||
= render partial: 'survey_question_title', locals: { survey_question: survey_question, question_index: question_index }
|
||||
.panel-body
|
||||
- question_replies = survey_question.survey_replies
|
||||
- if question_replies.any?
|
||||
= pie_chart question_replies.group(:text).count, library: { legend: 'bottom', plotOptions: { pie: { dataLabels: { enabled: false }, showInLegend: true } } }
|
||||
Loading…
Add table
Add a link
Reference in a new issue