Description:
fixed indv contest timing bug (same as in codejom), added user contest stat reset
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r247:bdb708ab847b - - 4 files changed: 16 inserted, 2 deleted
@@ -17,6 +17,14 | |||
|
17 | 17 | end |
|
18 | 18 | end |
|
19 | 19 | |
|
20 | + def clear_stat | |
|
21 | + user = User.find(params[:id]) | |
|
22 | + if user.contest_stat!=nil | |
|
23 | + user.contest_stat.destroy | |
|
24 | + end | |
|
25 | + redirect_to :action => 'user_stat' | |
|
26 | + end | |
|
27 | + | |
|
20 | 28 | def clear_all_stat |
|
21 | 29 | if not Configuration.indv_contest_mode? |
|
22 | 30 | redirect_to :action => 'index' and return |
@@ -10,7 +10,6 | |||
|
10 | 10 | if user = User.authenticate(params[:login], params[:password]) |
|
11 | 11 | session[:user_id] = user.id |
|
12 | 12 | session[:admin] = user.admin? |
|
13 | - UserContestStat.update_user_start_time(user) | |
|
14 | 13 | redirect_to :controller => 'main', :action => 'list' |
|
15 | 14 | else |
|
16 | 15 | flash[:notice] = 'Wrong password' |
@@ -3,6 +3,8 | |||
|
3 | 3 | before_filter :authenticate, :except => [:index, :login] |
|
4 | 4 | before_filter :check_viewability, :except => [:index, :login] |
|
5 | 5 | |
|
6 | + append_before_filter :update_user_start_time, :except => [:index, :login] | |
|
7 | + | |
|
6 | 8 | # COMMENTED OUT: filter in each action instead |
|
7 | 9 | # before_filter :verify_time_limit, :only => [:submit] |
|
8 | 10 | |
@@ -319,5 +321,10 | |||
|
319 | 321 | } |
|
320 | 322 | end |
|
321 | 323 | |
|
324 | + def update_user_start_time | |
|
325 | + user = User.find(session[:user_id]) | |
|
326 | + UserContestStat.update_user_start_time(user) | |
|
327 | + end | |
|
328 | + | |
|
322 | 329 | end |
|
323 | 330 |
You need to be logged in to leave comments.
Login now