small fix in calculation algo

This commit is contained in:
Harry Bomrah 2016-11-16 18:46:58 +08:00
parent 730d6b896a
commit 9917cb186d
1 changed files with 1 additions and 1 deletions

View File

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