From ecd052b9af5a9bdf3917c1813944ecf21469c6f6 Mon Sep 17 00:00:00 2001 From: Bohung Date: Thu, 4 Nov 2021 16:47:14 +0800 Subject: [PATCH] Fix bug. --- app/models/questionnaire_survey.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/questionnaire_survey.rb b/app/models/questionnaire_survey.rb index 499018e..86cdca5 100644 --- a/app/models/questionnaire_survey.rb +++ b/app/models/questionnaire_survey.rb @@ -465,7 +465,7 @@ class QuestionnaireSurvey answer.scored_points = total answer.individual_total = individual_total if tmp_total_weight != 0 - answer.avg_points = (individual_total.to_f / tmp_total_weight).round + answer.avg_points = (total.to_f / tmp_total_weight).round else answer.avg_points = 0 end