From 9917cb186d16b86785c4862f85b80dc738f15e60 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 16 Nov 2016 18:46:58 +0800 Subject: [PATCH] small fix in calculation algo --- app/views/surveys/answer_success.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/surveys/answer_success.html.erb b/app/views/surveys/answer_success.html.erb index 59da084..9bd1616 100644 --- a/app/views/surveys/answer_success.html.erb +++ b/app/views/surveys/answer_success.html.erb @@ -9,7 +9,7 @@ <% @survey.result_criteria.each do |criteria| %> <% total_criteria_score = 0 - (criteria["questions"][0].to_i..criteria["questions"][1].to_i).each do |x| + ((criteria["questions"][0].to_i - 1)..(criteria["questions"][1].to_i - 1)).each do |x| total_criteria_score = (total_criteria_score + @answer_model.individual_total[x].to_i) rescue 0 end %>