|
|
|
@ -45,7 +45,7 @@ class GamesService
|
|
|
|
|
|
|
|
|
|
# 高性能取上一关、下一关
|
|
|
|
|
prev_game = Game.prev_identifier(shixun.id, game.myshixun_id, game_challenge.position)
|
|
|
|
|
next_game = if current_user.is_certification_teacher || shixun_manager(shixun, current_user) || game.status || shixun.task_pass
|
|
|
|
|
next_game = if shixun.vnc || current_user.is_certification_teacher || shixun_manager(shixun, current_user) || game.status || shixun.task_pass
|
|
|
|
|
Game.next_game(shixun.id, game.myshixun_id, game_challenge.position).try(:identifier)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -87,13 +87,19 @@ class GamesService
|
|
|
|
|
if res && res['code'].to_i != 0
|
|
|
|
|
raise("实训云平台繁忙(繁忙等级:99)")
|
|
|
|
|
end
|
|
|
|
|
url = service_host +":#{res['port']}/vnc.html"
|
|
|
|
|
url = service_host +":#{res['port']}/vnc_lite.html"
|
|
|
|
|
Rails.logger.info("66666666sssssss#{url}")
|
|
|
|
|
container = container.merge(:vnc_url => url)
|
|
|
|
|
Rails.logger.info("777777666sssssss#{container}")
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
logger.error(e.message)
|
|
|
|
|
Rails.logger.error(e.message)
|
|
|
|
|
end
|
|
|
|
|
container = container.merge(:vnc_url => url)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if myshixun_manager
|
|
|
|
|
zip_path = Gitlab.endpoint.to_s + "/projects/" + myshixun.gpid.to_s + "/repository/archive?&private_token=" + Gitlab.private_token.to_s
|
|
|
|
|
container = container.merge(:zip_path => zip_path)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 区分选择题和编程题,st:0编程题;
|
|
|
|
|
if st == 0
|
|
|
|
|