编译错误时 计算系统评分不正确
This commit is contained in:
parent
f2325dee88
commit
50817c3d64
|
@ -45,7 +45,7 @@ class StudentWorkTest < ActiveRecord::Base
|
||||||
private
|
private
|
||||||
def get_success_count
|
def get_success_count
|
||||||
self.results.inject(0) do |sum, result|
|
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 || 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue