mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
fixing merge_into
This commit is contained in:
parent
2614a0f127
commit
a0e634c993
2 changed files with 6 additions and 4 deletions
|
|
@ -48,7 +48,7 @@ class School < ApplicationRecord
|
|||
reload
|
||||
|
||||
user_schools.update_all(school_id: school.id)
|
||||
school.school_categories.map(&:sync_aggregated_responses)
|
||||
# school.school_categories.map(&:sync_aggregated_responses)
|
||||
destroy
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -61,16 +61,18 @@ class SchoolCategory < ApplicationRecord
|
|||
average_zscore = total_zscore / zscore_categories.length
|
||||
end
|
||||
|
||||
|
||||
|
||||
return {
|
||||
attempt_count:
|
||||
_aggregated_responses[:attempt_count] +
|
||||
child_school_categories.inject(0) { |total, csc| total + csc.attempt_count || 0 },
|
||||
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 || 0 },
|
||||
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 || 0 },
|
||||
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