Skip to content

Commit

Permalink
Detailed survey report now correctly sorts answer options by position
Browse files Browse the repository at this point in the history
  • Loading branch information
remomueller committed May 12, 2016
1 parent 292c0b0 commit dc52216
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
- Blog posts are now viewable on the landing page
- **Research Topics**
- Removed requirement to do a research tutorial before casting votes
- **Survey Changes**
- Detailed survey report now correctly sorts answer options by position
- **Gem Changes**
- Updated to Ruby 2.3.1
- Updated to devise 4.1.0
Expand Down
4 changes: 2 additions & 2 deletions app/views/surveys/reports/_question_and_answer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
%th Option
%th.text-right Percentage
%tbody
- all_counts.each do |answer_option_id, count|
- answer_option = AnswerOption.find_by_id(answer_option_id)
- answer_template.answer_options.each do |answer_option|
- count = all_counts[answer_option.id] || 0
- selected_response = (user_answer_values and user_answer_values.pluck(:answer_option_id).include?(answer_option.id))
- name = answer_option.text
- percent = (count * 100 / total_count rescue 0)
Expand Down

0 comments on commit dc52216

Please sign in to comment.