# HG changeset patch # User Jittat Fakcharoenphol # Date 2015-02-01 17:02:15 # Node ID aef66acd0ee0831637738f7d76b247ac3038ed32 # Parent 865ba2aed5c0340a6681e4f51180dffb1f9519fc shows scores only for submitted problems diff --git a/app/controllers/user_admin_controller.rb b/app/controllers/user_admin_controller.rb --- a/app/controllers/user_admin_controller.rb +++ b/app/controllers/user_admin_controller.rb @@ -133,7 +133,7 @@ if (sub!=nil) and (sub.points!=nil) ustat << [(sub.points.to_f*100/p.full_score).round, (sub.points>=p.full_score)] else - ustat << [0,false] + ustat << [nil,false] end end @scorearray << ustat diff --git a/app/views/user_admin/user_stat.html.erb b/app/views/user_admin/user_stat.html.erb --- a/app/views/user_admin/user_stat.html.erb +++ b/app/views/user_admin/user_stat.html.erb @@ -34,10 +34,14 @@ <%= sc[i].contests.collect {|c| c.name}.join(', ') %> - <% else %> - <%= sc[i][0] %> - <% total += sc[i][0] %> - <% num_passed += 1 if sc[i][1] %> + <% else %> + <% if sc[i][0] != nil %> + <%= sc[i][0] %> + <% total += sc[i][0] %> + <% num_passed += 1 if sc[i][1] %> + <% else %> + - + <% end %> <% end %> <% end %> <%= total %>