From 60a728890612ddd561bea2e0be5d5acce17e8d65 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 22 Aug 2019 12:14:19 +0800 Subject: [PATCH 1/3] fixbug --- app/controllers/exercise_questions_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index 2257250c9..dca33a0a7 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -368,6 +368,7 @@ class ExerciseQuestionsController < ApplicationController total_score = objective_score + update_objective_score + total_score_subjective_score ex_user.update_attributes(objective_score:objective_score,score:total_score) end + Rails.logger.info("#####_________ex_user.score___________##############{ex_user.score}") # user = ex_user.user # objective_score = calculate_student_score(@exercise,user)[:total_score] end From 1e45b8ee0ab0feee36ad094358d8eb1cab36ac47 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 22 Aug 2019 12:17:02 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9A=84=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=A0=87=E5=87=86=E7=AD=94=E6=A1=88=E7=9A=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_questions_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/exercise_questions_controller.rb b/app/controllers/exercise_questions_controller.rb index dca33a0a7..9b029d265 100644 --- a/app/controllers/exercise_questions_controller.rb +++ b/app/controllers/exercise_questions_controller.rb @@ -361,6 +361,7 @@ class ExerciseQuestionsController < ApplicationController if ex_users_committed.size > 0 ex_users_committed.each do |ex_user| update_objective_score = update_single_score(@exercise_question,ex_user.user_id,standard_answer) + 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 From 4e866559795afae9aee7b135cd239816ee34d03b Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 22 Aug 2019 12:22:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=87=E5=87=86?= =?UTF-8?q?=E7=AD=94=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