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 @@ -78,10 +78,10 @@ ustat[0] = u.login @problems.each do |p| c, sub = Submission.find_by_user_and_problem(u.id,p.id) - if c!=0 - ustat << sub.points + if (c!=0) and (sub.points!=nil) + ustat << [sub.points, (sub.points>=p.full_score)] else - ustat << 0 + ustat << [0,false] end end @scorearray << ustat diff --git a/app/views/main/list.rhtml b/app/views/main/list.rhtml --- a/app/views/main/list.rhtml +++ b/app/views/main/list.rhtml @@ -4,10 +4,6 @@ <%= user_options %> -
<%= flash[:notice] %>
-<%= flash[:notice] %>
+
-
User | <% @problems.each do |p| %> @@ -16,11 +15,18 @@ <% @scorearray.each do |sc| %>||||
<%= i %> | - <% total += i.to_i %> + <% num_passed = 0 %> + <% sc.each_index do |i| %> + <% if i==0 %> +<%= sc[i] %> | + <% else %> +<%= sc[i][0] %> | + <% total += sc[i][0] %> + <% num_passed += 1 if sc[i][1] %> + <% end %> <% end %><%= total %> | +<%= num_passed %> |