Modify score calculations. Ignore any survey item scores of 0.

Never include zero when performing calculations for scores.
This commit is contained in:
Nelson Jovel 2022-04-19 12:41:01 -07:00
parent 0e85370b90
commit c475744939
5 changed files with 99 additions and 32 deletions

View file

@ -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