|
|
|
@ -265,7 +265,12 @@ class ShixunsController < ApplicationController
|
|
|
|
|
project_fork(@new_shixun, @repo_path, current_user.login)
|
|
|
|
|
|
|
|
|
|
ShixunMember.create!(:user_id => User.current.id, :shixun_id => @new_shixun.try(:id), :role => 1)
|
|
|
|
|
|
|
|
|
|
# 如果是jupyter,先创建一个目录,为了挂载(因为后续数据集,开启Pod后环境在没销毁前,你上传数据集是挂载不上目录的,因此要先创建目录,方便中间层挂载)
|
|
|
|
|
if @new_shixun.is_jupyter?
|
|
|
|
|
folder = EduSetting.get('shixun_folder')
|
|
|
|
|
path = "#{folder}/#{@new_shixun.identifier}"
|
|
|
|
|
FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path)
|
|
|
|
|
end
|
|
|
|
|
# 同步复制关卡
|
|
|
|
|
if @shixun.challenges.present?
|
|
|
|
|
@shixun.challenges.each do |challenge|
|
|
|
|
|