编译错误时 计算系统评分不正确

This commit is contained in:
sw 2015-09-22 16:52:21 +08:00
parent f2325dee88
commit 50817c3d64
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class StudentWorkTest < ActiveRecord::Base
private
def get_success_count
self.results.inject(0) do |sum, result|
sum += (result["status"].to_i == 0 ? 1 : 0)
sum += (result["status"] && result["status"].to_i == 0 ? 1 : 0)
end || 0
end