Show More
Commit Description:
associate logins with users
Commit Description:
associate logins with users
References:
File last commit:
Show/Diff file:
Action:
app/controllers/contest_management_controller.rb | 50 lines | 1.2 KiB | text/x-ruby | RubyLexer |
Jittat Fakcharoenphol
added contest model
r266 class ContestManagementController < ApplicationController
before_filter :admin_authorization
def index
Jittat Fakcharoenphol
CRUD for contests. combined new contest pages with old contest management. fixed styling.
r267 @num_contests = Contest.count()
Jittat Fakcharoenphol
added contest model
r266 end
def user_stat
Jittat Fakcharoenphol
renamed model Configuration to GraderConfiguration, renamed rhtml views to erb, fixed other small errors
r320 if not GraderConfiguration.indv_contest_mode?
Jittat Fakcharoenphol
added contest model
r266 redirect_to :action => 'index' and return
end
@users = User.find(:all)
@start_times = {}
UserContestStat.find(:all).each do |stat|
@start_times[stat.user_id] = stat.started_at
end
end
def clear_stat
user = User.find(params[:id])
if user.contest_stat!=nil
user.contest_stat.destroy
end
redirect_to :action => 'user_stat'
end
def clear_all_stat
Jittat Fakcharoenphol
renamed model Configuration to GraderConfiguration, renamed rhtml views to erb, fixed other small errors
r320 if not GraderConfiguration.indv_contest_mode?
Jittat Fakcharoenphol
added contest model
r266 redirect_to :action => 'index' and return
end
UserContestStat.delete_all()
flash[:notice] = 'All start time statistic cleared.'
redirect_to :action => 'index'
end
Jittat Fakcharoenphol
CRUD for contests. combined new contest pages with old contest management. fixed styling.
r267 def change_contest_mode
wytesk133
Added an option to change to Analysis Mode
r369 if ['standard', 'contest', 'indv-contest', 'analysis'].include? params[:id]
Jittat Fakcharoenphol
renamed model Configuration to GraderConfiguration, renamed rhtml views to erb, fixed other small errors
r320 config = GraderConfiguration.find_by_key('system.mode')
Jittat Fakcharoenphol
CRUD for contests. combined new contest pages with old contest management. fixed styling.
r267 config.value = params[:id]
config.save
else
flash[:notice] = 'Wrong contest mode value'
end
redirect_to :action => 'index'
end
Jittat Fakcharoenphol
added contest model
r266 end