Description:
[web] fix nil problem in various place, some styling git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@259 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r129:adeb816b0bb6 - - 4 files changed: 10 inserted, 11 deleted

@@ -34,7 +34,7
34 34 return false if mode=='analysis'
35 35 if (mode=='contest')
36 36 return false if (user.site!=nil) and
37 - ((user.site.started==false) or (user.site.finished?))
37 + ((user.site.started!=true) or (user.site.finished?))
38 38 end
39 39 return true
40 40 end
@@ -42,7 +42,7
42 42 def self.show_tasks_to?(user)
43 43 mode = get(SYSTEM_MODE_CONF_KEY)
44 44 if (mode=='contest')
45 - return false if (user.site!=nil) and (user.site.started==false)
45 + return false if (user.site!=nil) and (user.site.started!=true)
46 46 end
47 47 return true
48 48 end
@@ -50,8 +50,7
50 50 def self.allow_test_request(user)
51 51 mode = get(SYSTEM_MODE_CONF_KEY)
52 52 if (mode=='contest')
53 - return false if (user.site!=nil) and ((user.site.started==false) or
54 - (user.site.time_left < 30.minutes))
53 + return false if (user.site!=nil) and ((user.site.started!=true) or (user.site.time_left < 30.minutes))
55 54 end
56 55 return false if mode=='analysis'
57 56 return true
@@ -14,8 +14,13
14 14 if tmatch = /(\d+):(\d+)/.match(contest_time)
15 15 h = tmatch[1].to_i
16 16 m = tmatch[2].to_i
17 - finish_time = self.start_time + h.hour + m.minute
17 +
18 18 current_time = Time.now.gmtime
19 + if self.start_time!=nil
20 + finish_time = self.start_time + h.hour + m.minute
21 + else
22 + finish_time = current_time + h.hour + m.minute
23 + end
19 24
20 25 if current_time > finish_time
21 26 return current_time - current_time
@@ -25,8 +25,3
25 25
26 26 %hr/
27 27
28 - %p
29 - %b Note:
30 - We currently have problems synchronizing
31 - the time stamps between grading machines.
32 - You will see weird time stamps during the practice session.
@@ -77,7 +77,7
77 77 </td>
78 78 <td>
79 79 <small>
80 - * This option works <u>only</u> for task max.
80 + * This option works <u>only</u> for task beads.
81 81 You can use this to submit <tt>questions.txt</tt>.<br/>
82 82 The file shall be copied to the execution directory before your program runs.
83 83 </small>
You need to be logged in to leave comments. Login now