mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
use zscore for all averages
This commit is contained in:
parent
52026544bd
commit
d655ab7430
2 changed files with 6 additions and 4 deletions
|
|
@ -26,7 +26,10 @@ class SchoolCategory < ApplicationRecord
|
|||
return {
|
||||
attempt_count: attempt_data.attempt_count || 0,
|
||||
response_count: attempt_data.response_count || 0,
|
||||
answer_index_total: attempt_data.answer_index_total || 0
|
||||
answer_index_total: attempt_data.answer_index_total || 0,
|
||||
zscore: attempt_data.answer_index_total.nil? ?
|
||||
zscore :
|
||||
attempt_data.answer_index_total.to_f / attempt_data.response_count.to_f - 3.to_f
|
||||
}
|
||||
end
|
||||
|
||||
|
|
@ -54,7 +57,7 @@ class SchoolCategory < ApplicationRecord
|
|||
answer_index_total:
|
||||
_aggregated_responses[:answer_index_total] +
|
||||
child_school_categories.inject(0) { |total, csc| total + csc.answer_index_total },
|
||||
zscore: average_zscore.present? ? average_zscore : zscore
|
||||
zscore: average_zscore.present? ? average_zscore : _aggregated_responses[:zscore]
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
- likert = info.answer_index_average
|
||||
- zscore = info.zscore.present? ? info.zscore + 3 : nil
|
||||
- if zscore.present?
|
||||
- likert = info.answer_index_average.nan? ? zscore : (info.answer_index_average + zscore) / 2
|
||||
- likert = zscore if zscore.present?
|
||||
- likert = likert.round(1)
|
||||
|
||||
- return if likert.nan?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue