From 2887de4c4e0bfbb9527e49efdf5070c95f51b2a7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 24 Jul 2019 09:36:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=AF=94=E4=BE=8B=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/game.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/game.rb b/app/models/game.rb index ae056a702..d81b794a5 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -31,7 +31,7 @@ class Game < ApplicationRecord # 根据得分比例来算实际得分(试卷、实训作业) def real_score score - (final_score.to_f / challenge.all_score) * score + ((final_score < 0 ? 0 : final_score).to_f / challenge.all_score) * score end # 判断实训是否全部通关