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: 13 inserted, 12 deleted

@@ -142,7 +142,7
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]
@@ -15,7 +15,7
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 20 t.datetime "created_at", :null => false
21 21 t.datetime "updated_at", :null => false
@@ -50,7 +50,7
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 55 t.datetime "created_at", :null => false
56 56 t.datetime "updated_at", :null => false
@@ -62,7 +62,7
62 62 t.string "value"
63 63 t.datetime "created_at", :null => false
64 64 t.datetime "updated_at", :null => false
65 - t.text "description"
65 + t.text "description", :limit => 16777215
66 66 end
67 67
68 68 create_table "grader_processes", :force => true do |t|
@@ -97,7 +97,7
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 102 t.datetime "created_at", :null => false
103 103 t.datetime "updated_at", :null => false
@@ -142,7 +142,7
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
@@ -163,14 +163,14
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"
@@ -191,8 +191,8
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
194 + t.text "input", :limit => 2147483647
195 + t.text "solution", :limit => 2147483647
196 196 t.datetime "created_at", :null => false
197 197 t.datetime "updated_at", :null => false
198 198 end
@@ -208,7 +208,7
208 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 214 t.datetime "created_at", :null => false
@@ -239,6 +239,7
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
You need to be logged in to leave comments. Login now