|
|
|
@ -578,19 +578,7 @@ class ShixunsController < ApplicationController
|
|
|
|
|
onclick_time: Time.now, commit_id: commit_id)
|
|
|
|
|
uid_logger("myshixun_id is #{myshixun.id}")
|
|
|
|
|
|
|
|
|
|
# 如果实训是纯选择题,则不需要去fork仓库以及中间层的相关操作了
|
|
|
|
|
unless is_choice_type
|
|
|
|
|
# fork仓库
|
|
|
|
|
project_fork(myshixun, @repo_path, current_user.login)
|
|
|
|
|
|
|
|
|
|
rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path )
|
|
|
|
|
uid_logger("start openGameInstance")
|
|
|
|
|
uri = "#{cloud_bridge}/bridge/game/openGameInstance"
|
|
|
|
|
logger.info("end openGameInstance")
|
|
|
|
|
params = {tpiID: "#{myshixun.id}", tpmGitURL:rep_url, tpiRepoName: myshixun.repo_name.split("/").last}
|
|
|
|
|
uid_logger("openGameInstance params is #{params}")
|
|
|
|
|
interface_post uri, params, 83, "实训云平台繁忙(繁忙等级:83)"
|
|
|
|
|
end
|
|
|
|
|
# 其它创建关卡等操作
|
|
|
|
|
challenges = @shixun.challenges
|
|
|
|
|
# 之所以增加user_id是为了方便统计查询性能
|
|
|
|
@ -605,6 +593,20 @@ class ShixunsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 如果实训是纯选择题,则不需要去fork仓库以及中间层的相关操作了
|
|
|
|
|
unless is_choice_type
|
|
|
|
|
# fork仓库
|
|
|
|
|
project_fork(myshixun, @repo_path, current_user.login)
|
|
|
|
|
|
|
|
|
|
rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path )
|
|
|
|
|
uid_logger("start openGameInstance")
|
|
|
|
|
uri = "#{cloud_bridge}/bridge/game/openGameInstance"
|
|
|
|
|
logger.info("end openGameInstance")
|
|
|
|
|
params = {tpiID: "#{myshixun.id}", tpmGitURL:rep_url, tpiRepoName: myshixun.repo_name.split("/").last}
|
|
|
|
|
uid_logger("openGameInstance params is #{params}")
|
|
|
|
|
interface_post uri, params, 83, "实训云平台繁忙(繁忙等级:83)"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@current_task = myshixun.current_task(myshixun.games)
|
|
|
|
|
uid_logger("## shixun exec: myshixun id is #{myshixun.id}")
|
|
|
|
|
rescue Exception => e
|
|
|
|
|