Description:
fixed codejom stutus update to ignore disabled problems
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r246:180b30450ef3 - - 1 file changed: 2 inserted, 2 deleted
@@ -1,4 +1,4 | |||
|
1 |
- # -*- coding: u |
|
|
1 | + # -*- coding: utf-8 -*- | |
|
2 | 2 | require 'digest/sha1' |
|
3 | 3 | |
|
4 | 4 | class User < ActiveRecord::Base |
@@ -234,7 +234,7 | |||
|
234 | 234 | def update_codejom_status |
|
235 | 235 | status = codejom_status || CodejomStatus.new(:user => self) |
|
236 | 236 | problem_count = Problem.available_problem_count |
|
237 | - status.num_problems_passed = (self.submission_statuses.find_all {|s| s.passed}).length | |
|
237 | + status.num_problems_passed = (self.submission_statuses.find_all {|s| s.passed and s.problem.available }).length | |
|
238 | 238 | status.alive = (problem_count - (status.num_problems_passed)) <= CODEJOM_MAX_ALIVE_LEVEL |
|
239 | 239 | status.save |
|
240 | 240 | end |
You need to be logged in to leave comments.
Login now