|
|
@ -280,7 +280,6 @@ class ShixunsController < ApplicationController
|
|
|
|
@small_type = shixun_small_type
|
|
|
|
@small_type = shixun_small_type
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# 注意这里传参都应该使用params[:shixun]['name']这种格式
|
|
|
|
|
|
|
|
def create
|
|
|
|
def create
|
|
|
|
# 评测脚本的一些操作
|
|
|
|
# 评测脚本的一些操作
|
|
|
|
main_type, sub_type = params[:main_type], params[:small_type]
|
|
|
|
main_type, sub_type = params[:main_type], params[:small_type]
|
|
|
@ -388,7 +387,8 @@ class ShixunsController < ApplicationController
|
|
|
|
ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => mirror)
|
|
|
|
ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => mirror)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
logger.info("#######shixun_params: ##{shixun_params}")
|
|
|
|
|
|
|
|
logger.info("#######shixun_info_params: ##{shixun_info_params}")
|
|
|
|
@shixun.update_attributes(shixun_params)
|
|
|
|
@shixun.update_attributes(shixun_params)
|
|
|
|
@shixun.shixun_info.update_attributes(shixun_info_params)
|
|
|
|
@shixun.shixun_info.update_attributes(shixun_info_params)
|
|
|
|
@shixun.shixun_schools.delete_all
|
|
|
|
@shixun.shixun_schools.delete_all
|
|
|
@ -735,7 +735,7 @@ private
|
|
|
|
def shixun_params
|
|
|
|
def shixun_params
|
|
|
|
raise("实训名称不能为空") if params[:shixun][:name].blank?
|
|
|
|
raise("实训名称不能为空") if params[:shixun][:name].blank?
|
|
|
|
params.require(:shixun).permit(:name, :trainee, :webssh, :can_copy, :use_scope, :vnc, :test_set_permission,
|
|
|
|
params.require(:shixun).permit(:name, :trainee, :webssh, :can_copy, :use_scope, :vnc, :test_set_permission,
|
|
|
|
:task_pass, :repo_name, :multi_webssh, :opening_time, :mirror_script_id, :code_hidden,
|
|
|
|
:task_pass, :multi_webssh, :opening_time, :mirror_script_id, :code_hidden,
|
|
|
|
:hide_code, :forbid_copy)
|
|
|
|
:hide_code, :forbid_copy)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
def shixun_info_params
|
|
|
|
def shixun_info_params
|
|
|
|