mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
fixing most popular answer
This commit is contained in:
parent
650540b9de
commit
83c2834887
1 changed files with 1 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ class Question < ApplicationRecord
|
|||
histogram = school_responses.group_by(&:answer_index_with_reverse)
|
||||
|
||||
most_popular_answer_index = histogram.to_a.sort_by { |info| info[1].length }.last[0]
|
||||
most_popular_answer = options_with_reverse[most_popular_answer_index]
|
||||
most_popular_answer = options_with_reverse[most_popular_answer_index - 1]
|
||||
|
||||
AggregatedResponses.new(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue