Show More
Commit Description:
add golden submit button...
Commit Description:
add golden submit button - When the user submit more than or equal to 100 times the submit button will turn gold - Add golden-btn tag in applications.css.scss
References:
File last commit:
Show/Diff file:
Action:
app/models/site.rb | 46 lines | 904 B | text/x-ruby | RubyLexer |
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