diff --git a/app/models/configuration.rb b/app/models/configuration.rb --- a/app/models/configuration.rb +++ b/app/models/configuration.rb @@ -34,7 +34,7 @@ return false if mode=='analysis' if (mode=='contest') return false if (user.site!=nil) and - ((user.site.started==false) or (user.site.finished?)) + ((user.site.started!=true) or (user.site.finished?)) end return true end @@ -42,7 +42,7 @@ def self.show_tasks_to?(user) mode = get(SYSTEM_MODE_CONF_KEY) if (mode=='contest') - return false if (user.site!=nil) and (user.site.started==false) + return false if (user.site!=nil) and (user.site.started!=true) end return true end @@ -50,8 +50,7 @@ def self.allow_test_request(user) mode = get(SYSTEM_MODE_CONF_KEY) if (mode=='contest') - return false if (user.site!=nil) and ((user.site.started==false) or - (user.site.time_left < 30.minutes)) + return false if (user.site!=nil) and ((user.site.started!=true) or (user.site.time_left < 30.minutes)) end return false if mode=='analysis' return true diff --git a/app/models/site.rb b/app/models/site.rb --- a/app/models/site.rb +++ b/app/models/site.rb @@ -14,8 +14,13 @@ if tmatch = /(\d+):(\d+)/.match(contest_time) h = tmatch[1].to_i m = tmatch[2].to_i - finish_time = self.start_time + h.hour + m.minute + current_time = Time.now.gmtime + if self.start_time!=nil + finish_time = self.start_time + h.hour + m.minute + else + finish_time = current_time + h.hour + m.minute + end if current_time > finish_time return current_time - current_time diff --git a/app/views/main/list.html.haml b/app/views/main/list.html.haml --- a/app/views/main/list.html.haml +++ b/app/views/main/list.html.haml @@ -25,8 +25,3 @@ %hr/ -%p - %b Note: - We currently have problems synchronizing - the time stamps between grading machines. - You will see weird time stamps during the practice session. diff --git a/app/views/test/index.html.erb b/app/views/test/index.html.erb --- a/app/views/test/index.html.erb +++ b/app/views/test/index.html.erb @@ -77,7 +77,7 @@ - * This option works only for task max. + * This option works only for task beads. You can use this to submit questions.txt.
The file shall be copied to the execution directory before your program runs.