Show More
Commit Description:
fig bugs in login report
Commit Description:
fig bugs in login report
File last commit:
Show/Diff file:
Action:
app/controllers/configurations_controller.rb | 42 lines | 1.4 KiB | text/x-ruby | RubyLexer |
jittat
[web] added configurations...
r76 class ConfigurationsController < ApplicationController
more test and clean up authorization
r756 before_action :admin_authorization
jittat
[web] added configurations...
r76
def index
change find(:xxx) to correct syntax for rails 4
r619 @configurations = GraderConfiguration.order(:key)
- fix various ui issues
r613 @group = GraderConfiguration.pluck("grader_configurations.key").map{ |x| x[0...(x.index('.'))] }.uniq.sort
jittat
[web] added configurations...
r76 end
def reload
Jittat Fakcharoenphol
renamed model Configuration to GraderConfiguration, renamed rhtml views to erb, fixed other small errors
r320 GraderConfiguration.reload
jittat
[web] added configurations...
r76 redirect_to :action => 'index'
end
add best_in_place...
r474 def update
@config = GraderConfiguration.find(params[:id])
* multiple ip login fix...
r531 User.clear_last_login if @config.key == GraderConfiguration::MULTIPLE_IP_LOGIN_KEY and @config.value == 'true' and params[:grader_configuration][:value] == 'false'
add best_in_place...
r474 respond_to do |format|
switch to strong parameter for mass update (have not finished the problem controller yet)
r617 if @config.update_attributes(configuration_params)
add best_in_place...
r474 format.json { head :ok }
else
format.json { respond_with_bip(@config) }
end
end
end
add autoset exam mode
r765 def set_exam_right
value = params[:value] || 'false'
GraderConfiguration.where(key: "right.bypass_agreement").update(value: value);
GraderConfiguration.where(key: "right.multiple_ip_login").update(value: value);
GraderConfiguration.where(key: "right.user_hall_of_fame").update(value: value);
GraderConfiguration.where(key: "right.user_view_submission ").update(value: value);
GraderConfiguration.where(key: "right.view_testcase ").update(value: value);
redirect_to :action => 'index'
end
switch to strong parameter for mass update (have not finished the problem controller yet)
r617 private
def configuration_params
params.require(:grader_configuration).permit(:key,:value_type,:value,:description)
end
jittat
[web] added configurations...
r76 end