Description:
remove junk from ealier merge
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r484:a0c51d75908c - - 1 file changed: 0 inserted, 28 deleted
@@ -144,52 +144,24 | |||||
|
144 | sub = Submission.find_last_by_user_and_problem(u.id,p.id) |
|
144 | sub = Submission.find_last_by_user_and_problem(u.id,p.id) |
|
145 | if (sub!=nil) and (sub.points!=nil) |
|
145 | if (sub!=nil) and (sub.points!=nil) |
|
146 | ustat << [(sub.points.to_f*100/p.full_score).round, (sub.points>=p.full_score)] |
|
146 | ustat << [(sub.points.to_f*100/p.full_score).round, (sub.points>=p.full_score)] |
|
147 | else |
|
147 | else |
|
148 | ustat << [0,false] |
|
148 | ustat << [0,false] |
|
149 | end |
|
149 | end |
|
150 | end |
|
150 | end |
|
151 | @scorearray << ustat |
|
151 | @scorearray << ustat |
|
152 | end |
|
152 | end |
|
153 | end |
|
153 | end |
|
154 |
|
154 | ||
|
155 | def user_stat_max |
|
155 | def user_stat_max |
|
156 | - @problems = Problem.find_available_problems |
|
||
|
157 | - @users = User.find(:all, :include => [:contests, :contest_stat]) |
|
||
|
158 | - @scorearray = Array.new |
|
||
|
159 | - #set up range from param |
|
||
|
160 | - since_id = params.fetch(:since_id, 0).to_i |
|
||
|
161 | - until_id = params.fetch(:until_id, 0).to_i |
|
||
|
162 | - @users.each do |u| |
|
||
|
163 | - ustat = Array.new |
|
||
|
164 | - ustat[0] = u |
|
||
|
165 | - @problems.each do |p| |
|
||
|
166 | - max_points = 0 |
|
||
|
167 | - Submission.find_in_range_by_user_and_problem(u.id,p.id,since_id,until_id).each do |sub| |
|
||
|
168 | - max_points = sub.points if sub and sub.points and (sub.points > max_points) |
|
||
|
169 | - end |
|
||
|
170 | - ustat << [(max_points.to_f*100/p.full_score).round, (max_points>=p.full_score)] |
|
||
|
171 | - end |
|
||
|
172 | - @scorearray << ustat |
|
||
|
173 | - end |
|
||
|
174 | - |
|
||
|
175 | - if params[:commit] == 'download csv' then |
|
||
|
176 | - csv = gen_csv_from_scorearray(@scorearray,@problems) |
|
||
|
177 | - send_data csv, filename: 'last_score.csv' |
|
||
|
178 | - else |
|
||
|
179 | - render template: 'user_admin/user_stat' |
|
||
|
180 | - end |
|
||
|
181 | - end |
|
||
|
182 | - |
|
||
|
183 | - def user_stat_max |
|
||
|
184 | if params[:commit] == 'download csv' |
|
156 | if params[:commit] == 'download csv' |
|
185 | @problems = Problem.all |
|
157 | @problems = Problem.all |
|
186 | else |
|
158 | else |
|
187 | @problems = Problem.find_available_problems |
|
159 | @problems = Problem.find_available_problems |
|
188 | end |
|
160 | end |
|
189 | @users = User.find(:all, :include => [:contests, :contest_stat]) |
|
161 | @users = User.find(:all, :include => [:contests, :contest_stat]) |
|
190 | @scorearray = Array.new |
|
162 | @scorearray = Array.new |
|
191 | #set up range from param |
|
163 | #set up range from param |
|
192 | since_id = params.fetch(:since_id, 0).to_i |
|
164 | since_id = params.fetch(:since_id, 0).to_i |
|
193 | until_id = params.fetch(:until_id, 0).to_i |
|
165 | until_id = params.fetch(:until_id, 0).to_i |
|
194 | @users.each do |u| |
|
166 | @users.each do |u| |
|
195 | ustat = Array.new |
|
167 | ustat = Array.new |
You need to be logged in to leave comments.
Login now