From b4ac13c157bb990f01f234e5ef391b743838617d Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Wed, 13 Jul 2016 09:36:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E7=A8=8B=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E6=B2=A1main=E5=87=BD=E6=95=B0=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=AF=84=E5=88=86100=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/student_work_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/student_work_test.rb b/app/models/student_work_test.rb index 54d5ab07a..f2a35871f 100644 --- a/app/models/student_work_test.rb +++ b/app/models/student_work_test.rb @@ -45,7 +45,7 @@ class StudentWorkTest < ActiveRecord::Base private def get_success_count self.results.inject(0) do |sum, result| - sum += (result["status"] && result["status"].to_i == 0 ? 1 : 0) + sum += (result["status"] && result["status"].class == ::Fixnum && result["status"].to_i == 0 ? 1 : 0) end || 0 end