Please enable JavaScript to use RhodeCode Enterprise
Commit Description:
add model solution
Commit Description:
add model solution
class Site < ActiveRecord :: Base
belongs_to :country
has_many :users
def clear_start_time_if_not_started
if ! self . started
self . start_time = nil
end
end
def time_left
contest_time = GraderConfiguration . contest_time_limit
return nil if contest_time == nil
return contest_time if ! self . started
current_time = Time . now . gmtime
if self . start_time! = nil
finish_time = self . start_time + contest_time
else
finish_time = current_time + contest_time
end
if current_time > finish_time
return current_time - current_time
else
return finish_time - current_time
end
end
def finished?
if ! self . started
return false
end
contest_time = GraderConfiguration . contest_time_limit
if contest_time! = nil
return Time . now . gmtime > ( self . start_time + contest_time )
else
false
end
end
end
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository permissions settings