|
|
|
@ -387,8 +387,6 @@ class ShixunsController < ApplicationController
|
|
|
|
|
ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => mirror)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
logger.info("#######shixun_params: ##{shixun_params}")
|
|
|
|
|
logger.info("#######shixun_info_params: ##{shixun_info_params}")
|
|
|
|
|
@shixun.update_attributes(shixun_params)
|
|
|
|
|
@shixun.shixun_info.update_attributes(shixun_info_params)
|
|
|
|
|
@shixun.shixun_schools.delete_all
|
|
|
|
@ -407,6 +405,8 @@ class ShixunsController < ApplicationController
|
|
|
|
|
# 超级管理员和运营人员才能保存 中间层服务器pod信息的配置
|
|
|
|
|
if current_user.admin? || current_user.business?
|
|
|
|
|
@shixun.shixun_service_configs.destroy_all
|
|
|
|
|
ActionController::Parameters.permit_all_parameters = true
|
|
|
|
|
logger.info("##--;;;;---#{params[:shixun_service_configs]}")
|
|
|
|
|
params[:shixun_service_configs].each do |config|
|
|
|
|
|
@shixun.shixun_service_configs.create!(config)
|
|
|
|
|
end
|
|
|
|
@ -738,6 +738,7 @@ private
|
|
|
|
|
:task_pass, :multi_webssh, :opening_time, :mirror_script_id, :code_hidden,
|
|
|
|
|
:hide_code, :forbid_copy)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def shixun_info_params
|
|
|
|
|
raise("实训描述不能为空") if params[:shixun_info][:description].blank?
|
|
|
|
|
raise("评测脚本不能为空") if params[:shixun_info][:evaluate_script].blank?
|
|
|
|
|