|
|
|
@ -524,11 +524,11 @@ class GamesController < ApplicationController
|
|
|
|
|
else
|
|
|
|
|
{updated_at: Time.now}
|
|
|
|
|
end
|
|
|
|
|
logger.info("#############myshixuns_update: ##{myshixuns_update}")
|
|
|
|
|
#logger.info("#############myshixuns_update: ##{myshixuns_update}")
|
|
|
|
|
@myshixun.update_attributes!(myshixuns_update)
|
|
|
|
|
gitUrl = repo_ip_url @myshixun.repo_path
|
|
|
|
|
|
|
|
|
|
logger.info("#############giturl: ##{gitUrl}")
|
|
|
|
|
#logger.info("#############giturl: ##{gitUrl}")
|
|
|
|
|
gitUrl = Base64.urlsafe_encode64(gitUrl)
|
|
|
|
|
|
|
|
|
|
shixun_tomcat = edu_setting('cloud_bridge')
|
|
|
|
@ -554,7 +554,7 @@ class GamesController < ApplicationController
|
|
|
|
|
testSet << test_cases
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
logger.info("##############testSet: #{testSet}")
|
|
|
|
|
#logger.info("##############testSet: #{testSet}")
|
|
|
|
|
|
|
|
|
|
testCases = Base64.urlsafe_encode64(testSet.to_json) unless testSet.blank?
|
|
|
|
|
# 评测类型: 0,1,2 用于webssh的评测, 3用于vnc
|
|
|
|
@ -581,7 +581,7 @@ class GamesController < ApplicationController
|
|
|
|
|
if secret_rep&.repo_name
|
|
|
|
|
secretGitUrl = repo_ip_url secret_rep.repo_path
|
|
|
|
|
br_params.merge!({secretGitUrl: Base64.urlsafe_encode64(secretGitUrl), secretDir: secret_rep.secret_dir_path})
|
|
|
|
|
logger.info("#######br_params:#{br_params}")
|
|
|
|
|
#logger.info("#######br_params:#{br_params}")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 中间层交互
|
|
|
|
@ -700,10 +700,10 @@ class GamesController < ApplicationController
|
|
|
|
|
resubmit_identifier = @game.resubmit_identifier
|
|
|
|
|
# 如果没有超时并且正在评测中
|
|
|
|
|
# 判断评测中的状态有两种:1、如果之前没有通关的,只需判断status为1即可;如果通过关,则判断game的resubmit_identifier是否更新
|
|
|
|
|
uid_logger("################game_status: #{@game.status}")
|
|
|
|
|
uid_logger("################params[:resubmit]: #{params[:resubmit]}")
|
|
|
|
|
uid_logger("################resubmit_identifier: #{resubmit_identifier}")
|
|
|
|
|
uid_logger("################time_out: #{params[:time_out]}")
|
|
|
|
|
#uid_logger("################game_status: #{@game.status}")
|
|
|
|
|
#uid_logger("################params[:resubmit]: #{params[:resubmit]}")
|
|
|
|
|
#uid_logger("################resubmit_identifier: #{resubmit_identifier}")
|
|
|
|
|
#uid_logger("################time_out: #{params[:time_out]}")
|
|
|
|
|
sec_key = params[:sec_key]
|
|
|
|
|
if (params[:time_out] == "false") && ((params[:resubmit].blank? && @game.status == 1) || (params[:resubmit].present? &&
|
|
|
|
|
(params[:resubmit] != resubmit_identifier)))
|
|
|
|
@ -762,7 +762,7 @@ class GamesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
uid_logger("game is #{@game.id}, record id is #{e_record.try(:id)}, time is**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
|
|
|
|
|
#uid_logger("game is #{@game.id}, record id is #{e_record.try(:id)}, time is**** #{Time.now.strftime("%Y-%m-%d %H:%M:%S.%L")}")
|
|
|
|
|
# 记录前端总耗时
|
|
|
|
|
record_consume_time = e_record.try(:pod_execute)
|
|
|
|
|
max_mem = e_record.try(:max_mem)
|
|
|
|
@ -848,7 +848,7 @@ class GamesController < ApplicationController
|
|
|
|
|
@allowed_hidden_testset = @identity < User::EDU_GAME_MANAGER || @game.test_sets_view #解锁的用户
|
|
|
|
|
|
|
|
|
|
if max_query_index > 0
|
|
|
|
|
uid_logger("max_query_index is #{max_query_index} game id is #{@game.id}, challenge_id is #{challenge.id}")
|
|
|
|
|
#uid_logger("max_query_index is #{max_query_index} game id is #{@game.id}, challenge_id is #{challenge.id}")
|
|
|
|
|
@qurey_test_sets = TestSet.find_by_sql("SELECT o.code, o.actual_output, o.out_put, o.result, o.test_set_position, o.ts_time, o.ts_mem,
|
|
|
|
|
o.query_index, t.is_public, t.input, t.output, o.compile_success FROM outputs o, games g, challenges c,
|
|
|
|
|
test_sets t where g.id=#{@game.id} and c.id=#{challenge.id} and o.query_index=#{max_query_index}
|
|
|
|
|