mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 15:08:15 -07:00
Calculate benchmarks for measures based on a weighted average of survey and admin data items Added architectural records
33 lines
683 B
Ruby
33 lines
683 B
Ruby
module SchedulesHelper
|
|
def options_for_frequency_hours
|
|
[
|
|
['Once A Day', 24],
|
|
['Once A Week', 24 * 7],
|
|
['Every Other Week', 2 * 24 * 7],
|
|
['Once A Month', 4 * 24 * 7]
|
|
]
|
|
end
|
|
|
|
def options_for_time
|
|
words = %w[AM PM].map do |time|
|
|
[12, *(1..11)].map do |hour|
|
|
%w[00 30].map do |minute|
|
|
"#{hour}:#{minute} #{time}"
|
|
end
|
|
end
|
|
end.flatten
|
|
|
|
words.each_with_index.map { |word, index| [word, index * 30] }
|
|
end
|
|
|
|
def frequency_description(hours)
|
|
case hours
|
|
when (24 * 7)
|
|
'Once A Week'
|
|
when (2 * 24 * 7)
|
|
'Every Other Week'
|
|
when (4 * 24 * 7)
|
|
'Once A Month'
|
|
end
|
|
end
|
|
end
|