# HG changeset patch # User Nattee Niparnan # Date 2014-10-01 15:46:51 # Node ID 4d5c727a0d13fec0bc331eb6c1df808915aa478f # Parent ef5c1bd32447bed3ddbb058cb652006210b6b2cb fix displaying bug diff --git a/app/controllers/report_controller.rb b/app/controllers/report_controller.rb --- a/app/controllers/report_controller.rb +++ b/app/controllers/report_controller.rb @@ -196,6 +196,7 @@ @struggle = Array.new record = {} Submission.includes(:problem,:user).order(:problem_id,:user_id).find_each do |sub| + next unless sub.user and sub.problem if user != sub.user_id or problem != sub.problem_id @struggle << { user: record[:user], problem: record[:problem], tries: tries } unless solve record = {user: sub.user, problem: sub.problem} diff --git a/app/views/graders/list.html.haml b/app/views/graders/list.html.haml --- a/app/views/graders/list.html.haml +++ b/app/views/graders/list.html.haml @@ -66,7 +66,7 @@ %td= sub.try(:user).try(:full_name) %td= sub.try(:problem).try(:full_name) %td= "#{time_ago_in_words(sub.submitted_at)} ago" - %td= "#{time_ago_in_words(sub.graded_at)} ago" + %td= "#{sub.graded_at ? time_ago_in_words(sub.graded_at) : ''} ago" %td= sub.grader_comment