Description:
fix error when problem.full_score is nil. More has to be done to prevent problem.full_score being nil
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r523:e5c66a78e3f9 - - 2 files changed: 27 inserted, 26 deleted

@@ -139,13 +139,13
139 139 @scorearray = Array.new
140 140 @users.each do |u|
141 141 ustat = Array.new
142 142 ustat[0] = u
143 143 @problems.each do |p|
144 144 sub = Submission.find_last_by_user_and_problem(u.id,p.id)
145 - if (sub!=nil) and (sub.points!=nil)
145 + if (sub!=nil) and (sub.points!=nil) and p and p.full_score
146 146 ustat << [(sub.points.to_f*100/p.full_score).round, (sub.points>=p.full_score)]
147 147 else
148 148 ustat << [0,false]
149 149 end
150 150 end
151 151 @scorearray << ustat
@@ -12,18 +12,18
12 12 # It's strongly recommended to check this file into your version control system.
13 13
14 14 ActiveRecord::Schema.define(:version => 20150203153534) do
15 15
16 16 create_table "announcements", :force => true do |t|
17 17 t.string "author"
18 - t.text "body"
18 + t.text "body", :limit => 16777215
19 19 t.boolean "published"
20 - t.datetime "created_at", :null => false
21 - t.datetime "updated_at", :null => false
22 - t.boolean "frontpage", :default => false
23 - t.boolean "contest_only", :default => false
20 + t.datetime "created_at", :null => false
21 + t.datetime "updated_at", :null => false
22 + t.boolean "frontpage", :default => false
23 + t.boolean "contest_only", :default => false
24 24 t.string "title"
25 25 t.string "notes"
26 26 end
27 27
28 28 create_table "contests", :force => true do |t|
29 29 t.string "title"
@@ -47,25 +47,25
47 47 t.string "name"
48 48 t.datetime "created_at", :null => false
49 49 t.datetime "updated_at", :null => false
50 50 end
51 51
52 52 create_table "descriptions", :force => true do |t|
53 - t.text "body"
53 + t.text "body", :limit => 16777215
54 54 t.boolean "markdowned"
55 - t.datetime "created_at", :null => false
56 - t.datetime "updated_at", :null => false
55 + t.datetime "created_at", :null => false
56 + t.datetime "updated_at", :null => false
57 57 end
58 58
59 59 create_table "grader_configurations", :force => true do |t|
60 60 t.string "key"
61 61 t.string "value_type"
62 62 t.string "value"
63 - t.datetime "created_at", :null => false
64 - t.datetime "updated_at", :null => false
65 - t.text "description"
63 + t.datetime "created_at", :null => false
64 + t.datetime "updated_at", :null => false
65 + t.text "description", :limit => 16777215
66 66 end
67 67
68 68 create_table "grader_processes", :force => true do |t|
69 69 t.string "host", :limit => 20
70 70 t.integer "pid"
71 71 t.string "mode"
@@ -94,16 +94,16
94 94 end
95 95
96 96 create_table "messages", :force => true do |t|
97 97 t.integer "sender_id"
98 98 t.integer "receiver_id"
99 99 t.integer "replying_message_id"
100 - t.text "body"
100 + t.text "body", :limit => 16777215
101 101 t.boolean "replied"
102 - t.datetime "created_at", :null => false
103 - t.datetime "updated_at", :null => false
102 + t.datetime "created_at", :null => false
103 + t.datetime "updated_at", :null => false
104 104 end
105 105
106 106 create_table "problems", :force => true do |t|
107 107 t.string "name", :limit => 30
108 108 t.string "full_name"
109 109 t.integer "full_score"
@@ -139,13 +139,13
139 139 end
140 140
141 141 add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
142 142
143 143 create_table "sessions", :force => true do |t|
144 144 t.string "session_id"
145 - t.text "data"
145 + t.text "data", :limit => 16777215
146 146 t.datetime "updated_at"
147 147 end
148 148
149 149 add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
150 150 add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
151 151
@@ -160,20 +160,20
160 160 end
161 161
162 162 create_table "submissions", :force => true do |t|
163 163 t.integer "user_id"
164 164 t.integer "problem_id"
165 165 t.integer "language_id"
166 - t.text "source"
166 + t.text "source", :limit => 16777215
167 167 t.binary "binary"
168 168 t.datetime "submitted_at"
169 169 t.datetime "compiled_at"
170 - t.text "compiler_message"
170 + t.text "compiler_message", :limit => 16777215
171 171 t.datetime "graded_at"
172 172 t.integer "points"
173 - t.text "grader_comment"
173 + t.text "grader_comment", :limit => 16777215
174 174 t.integer "number"
175 175 t.string "source_filename"
176 176 t.float "max_runtime"
177 177 t.integer "peak_memory"
178 178 t.integer "effective_code_length"
179 179 t.string "ip_address"
@@ -188,33 +188,33
188 188 t.integer "status"
189 189 t.datetime "updated_at"
190 190 end
191 191
192 192 create_table "test_pairs", :force => true do |t|
193 193 t.integer "problem_id"
194 - t.text "input", :limit => 16777215
195 - t.text "solution", :limit => 16777215
196 - t.datetime "created_at", :null => false
197 - t.datetime "updated_at", :null => false
194 + t.text "input", :limit => 2147483647
195 + t.text "solution", :limit => 2147483647
196 + t.datetime "created_at", :null => false
197 + t.datetime "updated_at", :null => false
198 198 end
199 199
200 200 create_table "test_requests", :force => true do |t|
201 201 t.integer "user_id"
202 202 t.integer "problem_id"
203 203 t.integer "submission_id"
204 204 t.string "input_file_name"
205 205 t.string "output_file_name"
206 206 t.string "running_stat"
207 207 t.integer "status"
208 - t.datetime "updated_at", :null => false
208 + t.datetime "updated_at", :null => false
209 209 t.datetime "submitted_at"
210 210 t.datetime "compiled_at"
211 - t.text "compiler_message"
211 + t.text "compiler_message", :limit => 16777215
212 212 t.datetime "graded_at"
213 213 t.string "grader_comment"
214 - t.datetime "created_at", :null => false
214 + t.datetime "created_at", :null => false
215 215 t.float "running_time"
216 216 t.string "exit_status"
217 217 t.integer "memory_usage"
218 218 end
219 219
220 220 add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id"
@@ -236,12 +236,13
236 236 t.string "email"
237 237 t.integer "site_id"
238 238 t.integer "country_id"
239 239 t.boolean "activated", :default => false
240 240 t.datetime "created_at"
241 241 t.datetime "updated_at"
242 + t.string "section"
242 243 t.boolean "enabled", :default => true
243 244 t.string "remark"
244 245 end
245 246
246 247 add_index "users", ["login"], :name => "index_users_on_login", :unique => true
247 248
You need to be logged in to leave comments. Login now