mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Modify score calculations. Ignore any survey item scores of 0.
Never include zero when performing calculations for scores.
This commit is contained in:
parent
0e85370b90
commit
c475744939
5 changed files with 99 additions and 32 deletions
|
|
@ -2,6 +2,10 @@ module ArrayMonkeyPatches
|
|||
def average
|
||||
sum.to_f / size
|
||||
end
|
||||
|
||||
def remove_zeros
|
||||
reject { |item| item == 0 || item.to_f.nan? }
|
||||
end
|
||||
end
|
||||
|
||||
Array.include ArrayMonkeyPatches
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue