mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
fixing bug with merging schools
This commit is contained in:
parent
50930ecc62
commit
2dd216ee25
2 changed files with 13 additions and 13 deletions
|
|
@ -62,13 +62,13 @@ class SchoolCategory < ApplicationRecord
|
|||
return {
|
||||
attempt_count:
|
||||
_aggregated_responses[:attempt_count] +
|
||||
child_school_categories.inject(0) { |total, csc| total + csc.attempt_count },
|
||||
child_school_categories.inject(0) { |total, csc| total + csc.attempt_count || 0 },
|
||||
response_count:
|
||||
_aggregated_responses[:response_count] +
|
||||
child_school_categories.inject(0) { |total, csc| total + csc.response_count },
|
||||
child_school_categories.inject(0) { |total, csc| total + csc.response_count || 0 },
|
||||
answer_index_total:
|
||||
_aggregated_responses[:answer_index_total] +
|
||||
child_school_categories.inject(0) { |total, csc| total + csc.answer_index_total },
|
||||
child_school_categories.inject(0) { |total, csc| total + csc.answer_index_total || 0 },
|
||||
zscore: average_zscore.present? ? average_zscore : _aggregated_responses[:zscore]
|
||||
}
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue