mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
working on 2018 admin data
This commit is contained in:
parent
2dd216ee25
commit
a6385897ff
3 changed files with 5 additions and 3 deletions
|
|
@ -37,7 +37,7 @@ class School < ApplicationRecord
|
|||
school_category.update(school_id: school.id)
|
||||
existing_school_category = school.school_categories.for(school_category.school, school_category.category).in(school_category.year)
|
||||
if existing_school_category.present?
|
||||
if existing_school_category.attempt_count == 0
|
||||
if existing_school_category.attempt_count == 0 && existing_school_category.zscore.nil?
|
||||
existing_school_category.destroy
|
||||
else
|
||||
school_category.destroy
|
||||
|
|
|
|||
|
|
@ -52,6 +52,8 @@ class SchoolCategory < ApplicationRecord
|
|||
SchoolCategory.for(school, cc).in(year).valid
|
||||
end.flatten.compact
|
||||
|
||||
return {} if child_school_categories.blank?
|
||||
|
||||
average_zscore = nil
|
||||
zscore_categories = child_school_categories.select { |csc| csc.zscore.present? }
|
||||
if zscore_categories.length > 0
|
||||
|
|
@ -76,7 +78,7 @@ class SchoolCategory < ApplicationRecord
|
|||
def sync_aggregated_responses
|
||||
return if ENV['BULK_PROCESS']
|
||||
update_attributes(chained_aggregated_responses)
|
||||
return if response_count == 0
|
||||
return if response_count == 0 && zscore.nil?
|
||||
if category.parent_category.present?
|
||||
parent_school_category = SchoolCategory.for(school, category.parent_category).in(year).first
|
||||
if parent_school_category.nil?
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue