Description:
added options not to hide passed problems
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r260:a6455c18d017 - - 2 files changed: 6 inserted, 2 deleted
@@ -306,25 +306,24 | |||
|
306 | 306 | assignment = @user.get_recent_test_pair_assignment_for(problem) |
|
307 | 307 | if assignment == nil |
|
308 | 308 | timeout = nil |
|
309 | 309 | else |
|
310 | 310 | if (assignment.expired?) or (assignment.submitted) |
|
311 | 311 | timeout = 0 |
|
312 | 312 | else |
|
313 | 313 | timeout = assignment.created_at + TEST_ASSIGNMENT_EXPIRATION_DURATION - Time.new.gmtime |
|
314 | 314 | end |
|
315 | 315 | end |
|
316 | 316 | @submission_timeouts[problem.id] = timeout |
|
317 | 317 | end |
|
318 | - @submission_timeouts.each_pair {|k,v| puts "#{k} => #{v}"} | |
|
319 | 318 | end |
|
320 | 319 | |
|
321 | 320 | def prepare_list_information |
|
322 | 321 | @user = User.find(session[:user_id]) |
|
323 | 322 | |
|
324 | 323 | all_problems = Problem.find_available_problems |
|
325 | 324 | |
|
326 | 325 | passed = {} |
|
327 | 326 | sub_count = {} |
|
328 | 327 | @user.submission_statuses.each do |status| |
|
329 | 328 | if status.passed |
|
330 | 329 | passed[status.problem_id] = true |
@@ -334,25 +333,29 | |||
|
334 | 333 | |
|
335 | 334 | if session.has_key? :current_problem_id |
|
336 | 335 | @current_problem_id = session[:current_problem_id] |
|
337 | 336 | session.delete(:current_problem_id) |
|
338 | 337 | else |
|
339 | 338 | if params.has_key? :id |
|
340 | 339 | @current_problem_id = params[:id].to_i |
|
341 | 340 | else |
|
342 | 341 | @current_problem_id = nil |
|
343 | 342 | end |
|
344 | 343 | end |
|
345 | 344 | |
|
346 | - @problems = all_problems.reject { |problem| passed.has_key? problem.id } | |
|
345 | + if (not defined? HIDE_PASSED_TASKS) or HIDE_PASSED_TASKS | |
|
346 | + @problems = all_problems.reject { |problem| passed.has_key? problem.id } | |
|
347 | + else | |
|
348 | + @problems = all_problems | |
|
349 | + end | |
|
347 | 350 | |
|
348 | 351 | prepare_timeout_information(@problems) |
|
349 | 352 | |
|
350 | 353 | @prob_submissions = Array.new |
|
351 | 354 | @problems.each do |p| |
|
352 | 355 | if sub_count.has_key? p.id |
|
353 | 356 | @prob_submissions << { :count => sub_count[p.id] } |
|
354 | 357 | else |
|
355 | 358 | @prob_submissions << { :count => 0 } |
|
356 | 359 | end |
|
357 | 360 | end |
|
358 | 361 | prepare_announcements |
@@ -100,12 +100,13 | |||
|
100 | 100 | # Uncomment so that Apache X-Sendfile is used when delivering files |
|
101 | 101 | # (e.g., in /tasks/view). |
|
102 | 102 | # USE_APACHE_XSENDFILE = true |
|
103 | 103 | |
|
104 | 104 | # Uncomment so that configuration is read only once when the server is loaded |
|
105 | 105 | # Configuration.enable_caching |
|
106 | 106 | |
|
107 | 107 | # OPTIONS FOR CODE JOM |
|
108 | 108 | # -------------------- |
|
109 | 109 | CODEJOM_MAX_ALIVE_LEVEL = 10 |
|
110 | 110 | TEST_ASSIGNMENT_EXPIRATION_DURATION = 5.minute |
|
111 | 111 | SHOW_CONTEST_STATUS = false |
|
112 | + HIDE_PASSED_TASKS = true No newline at end of file |
You need to be logged in to leave comments.
Login now