Description:
add check for nil problem
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r527:662f5e0a87b8 - - 1 file changed: 1 inserted, 1 deleted
@@ -139,13 +139,13 | |||||
|
139 | @scorearray = Array.new |
|
139 | @scorearray = Array.new |
|
140 | @users.each do |u| |
|
140 | @users.each do |u| |
|
141 | ustat = Array.new |
|
141 | ustat = Array.new |
|
142 | ustat[0] = u |
|
142 | ustat[0] = u |
|
143 | @problems.each do |p| |
|
143 | @problems.each do |p| |
|
144 | sub = Submission.find_last_by_user_and_problem(u.id,p.id) |
|
144 | sub = Submission.find_last_by_user_and_problem(u.id,p.id) |
|
145 | - if (sub!=nil) and (sub.points!=nil) |
|
145 | + if (sub!=nil) and (sub.points!=nil) and p and p.full_score |
|
146 | ustat << [(sub.points.to_f*100/p.full_score).round, (sub.points>=p.full_score)] |
|
146 | ustat << [(sub.points.to_f*100/p.full_score).round, (sub.points>=p.full_score)] |
|
147 | else |
|
147 | else |
|
148 | ustat << [0,false] |
|
148 | ustat << [0,false] |
|
149 | end |
|
149 | end |
|
150 | end |
|
150 | end |
|
151 | @scorearray << ustat |
|
151 | @scorearray << ustat |
You need to be logged in to leave comments.
Login now