Description:
fixed single contest bug, reported by K. Siththa
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r292:35efcd905ebb - - 1 file changed: 1 inserted, 1 deleted

@@ -191,25 +191,25
191 else
191 else
192 @announcements = Announcement.find_published
192 @announcements = Announcement.find_published
193 end
193 end
194 if recent!=nil
194 if recent!=nil
195 recent_id = recent.to_i
195 recent_id = recent.to_i
196 @announcements = @announcements.find_all { |a| a.id > recent_id }
196 @announcements = @announcements.find_all { |a| a.id > recent_id }
197 end
197 end
198 end
198 end
199
199
200 def prepare_list_information
200 def prepare_list_information
201 @user = User.find(session[:user_id])
201 @user = User.find(session[:user_id])
202 if not Configuration.multicontests?
202 if not Configuration.multicontests?
203 - @problems = problem_list_for_user(@user)
203 + @problems = @user.available_problems
204 else
204 else
205 @contest_problems = @user.available_problems_group_by_contests
205 @contest_problems = @user.available_problems_group_by_contests
206 @problems = @user.available_problems
206 @problems = @user.available_problems
207 end
207 end
208 @prob_submissions = {}
208 @prob_submissions = {}
209 @problems.each do |p|
209 @problems.each do |p|
210 sub = Submission.find_last_by_user_and_problem(@user.id,p.id)
210 sub = Submission.find_last_by_user_and_problem(@user.id,p.id)
211 if sub!=nil
211 if sub!=nil
212 @prob_submissions[p.id] = { :count => sub.number, :submission => sub }
212 @prob_submissions[p.id] = { :count => sub.number, :submission => sub }
213 else
213 else
214 @prob_submissions[p.id] = { :count => 0, :submission => nil }
214 @prob_submissions[p.id] = { :count => 0, :submission => nil }
215 end
215 end
You need to be logged in to leave comments. Login now