From 4e866559795afae9aee7b135cd239816ee34d03b Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 22 Aug 2019 12:22:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=87=E5=87=86=E7=AD=94?= =?UTF-8?q?=E6=A1=88=E6=B5=8B=E8=AF=952?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_questions_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 9b029d265..58f3a7e71 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -364,10 +364,10 @@ class ExerciseQuestionsController < ApplicationController Rails.logger.info("#####_________update_objective_score___________##############{update_objective_score}") if update_objective_score != 0 objective_score = ex_user.objective_score - subjective_score = ex_user.subjective_score - total_score_subjective_score = subjective_score < 0.0 ? 0.0 : subjective_score - total_score = objective_score + update_objective_score + total_score_subjective_score - ex_user.update_attributes(objective_score:objective_score,score:total_score) + new_objective_score = objective_score + update_objective_score + total_score = ex_user.score + update_objective_score + total_score = total_score < 0.0 ? 0.0 : total_score + ex_user.update_attributes(objective_score:new_objective_score,score:total_score) end Rails.logger.info("#####_________ex_user.score___________##############{ex_user.score}") # user = ex_user.user