feat: Round up response rate. Survey response rates above 24.5 will now meet sufficiency

pull/1/head
rebuilt 2 years ago
parent b58ff3e519
commit 6edc0db868

@ -18,7 +18,7 @@ class ResponseRateCalculator
return 0 unless total_possible_responses.positive?
cap_at_one_hundred(raw_response_rate)
cap_at_one_hundred(raw_response_rate).round
end
def meets_student_threshold?

@ -84,7 +84,7 @@ describe ResponseRateCalculator, type: :model do
school:, grade: 1)
end
xcontext "and the response rate is a decimal number" do
context "and the response rate is a decimal number" do
before do
create_list(:survey_item_response, 1, survey_item: sufficient_student_survey_item_1, academic_year:,
school:, grade: 1)
@ -171,7 +171,7 @@ describe ResponseRateCalculator, type: :model do
end
end
xcontext "when two grades have different numbers of students" do
context "when two grades have different numbers of students" do
before do
create(:respondent, school:, academic_year:, total_students: 60, one: 40, two: 20)
create_list(:survey_item_response, 20, survey_item: sufficient_student_survey_item_1, academic_year:,
@ -185,7 +185,7 @@ describe ResponseRateCalculator, type: :model do
end
end
xcontext "when three grades have different numbers of students" do
context "when three grades have different numbers of students" do
before do
create(:respondent, school:, academic_year:, total_students: 120, one: 40, two: 20, three: 60)
create_list(:survey_item_response, 20, survey_item: sufficient_student_survey_item_1, academic_year:,

Loading…
Cancel
Save