Description:
only grades users in the contest
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r94:1ba4bf8cd712 - - 1 file changed: 9 inserted, 6 deleted

@@ -108,14 +108,14
108 108 end
109 109
110 110 options[:dry_run] = (ARGV.delete('--dry') != nil)
111 - if options[:dry_run] and (not options[:mode] == 'prob')
112 - puts "Dry run currently works only for 'prob' mode."
111 + if options[:dry_run] and (not ['prob','contest'].include? options[:mode])
112 + puts "Dry run currently works only for 'prob' or 'contest' modes."
113 113 exit(0)
114 114 end
115 115
116 116 options[:report] = (ARGV.delete('--report') != nil)
117 117 if options[:report] and (not ['prob','contest'].include? options[:mode])
118 - puts "Report currently works only for 'prob' mode."
118 + puts "Report currently works only for 'prob' or 'contest' modes."
119 119 exit(0)
120 120 end
121 121
@@ -144,14 +144,14
144 144 puts " REPORT"
145 145 puts "---------------------"
146 146
147 - print "login"
147 + print "login,email"
148 148 @problems.each_value do |problem|
149 149 print ",#{problem.name}"
150 150 end
151 151 print "\n"
152 152
153 153 @users.each_value do |user|
154 - print "#{user.login}"
154 + print "#{user.login},#{user.email}"
155 155 @problems.each_value do |problem|
156 156 if @results.has_key? [user.id, problem.id]
157 157 print ",#{@results[[user.id,problem.id]][:points]}"
@@ -305,7 +305,10
305 305 contest.problems.each do |problem|
306 306 puts "Grading: #{problem.name}"
307 307 runner.grade_problem(problem,
308 - :user_conditions => lambda {|u| u.contest_finished?})
308 + :user_conditions => lambda do |u|
309 + u.contest_finished? and
310 + u.contest_ids.include?(contest.id)
311 + end)
309 312 end
310 313
311 314 if options[:report]
You need to be logged in to leave comments. Login now