From 555b1f8dc0dc08c68a5773a8edcb13bd18f1f541 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 25 Jun 2019 17:46:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A=E7=9A=84?= =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=95=88=E7=8E=87=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/homeworks_service.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index 2d6f50b5c..1e155dde0 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -111,7 +111,7 @@ class HomeworksService if homework.work_efficiency if homework.max_efficiency < student_work.efficiency # homework.max_efficiency = student_work.efficiency - homework.update_column("max_efficiency", homework.max_efficiency) + homework.update_column("max_efficiency", student_work.efficiency) end # eff_score = homework.max_efficiency == 0 ? 0 : student_work.efficiency / homework.max_efficiency * homework.eff_score # student_work.eff_score = format("%.2f", eff_score) @@ -200,7 +200,7 @@ class HomeworksService # 如果作业的最大效率值有变更则更新所有作品的效率分 if homework.work_efficiency && homework.max_efficiency < work.efficiency - homework.update_column("max_efficiency", homework.max_efficiency) + homework.update_column("max_efficiency", work.efficiency) end end