|
|
|
@ -115,7 +115,7 @@ class GamesService
|
|
|
|
|
# 区分评测过未评测过,未评测过按需求取数据
|
|
|
|
|
sql =
|
|
|
|
|
if max_query_index > 0
|
|
|
|
|
"SELECT
|
|
|
|
|
"SELECT
|
|
|
|
|
b.code, b.actual_output, b.out_put, b.result, b.compile_success, a.is_public, a.input, a.output
|
|
|
|
|
FROM
|
|
|
|
|
(SELECT position, input, output, challenge_id, is_public FROM test_sets where challenge_id=#{game_challenge.id}) a
|
|
|
|
@ -154,7 +154,7 @@ class GamesService
|
|
|
|
|
Rails.logger.warn(latest_output)
|
|
|
|
|
|
|
|
|
|
output_hash = {:test_sets => test_sets}.merge(:had_test_count => had_test_count, :test_sets_count => test_sets_count,
|
|
|
|
|
:had_passed_testsests_error_count => had_passed_testsests_error_count)
|
|
|
|
|
:had_passed_testsests_error_count => had_passed_testsests_error_count)
|
|
|
|
|
multi_webssh = shixun.webssh == 2 && shixun.multi_webssh
|
|
|
|
|
result = {:tpm_modified => tpm_modified, :tpm_cases_modified => tpm_cases_modified, :hide_code => shixun.hide_code, :forbid_copy => shixun.forbid_copy,
|
|
|
|
|
:output_sets => output_hash, :latest_output => latest_output, :mirror_name => mirror_name, :multi_webssh => multi_webssh,
|
|
|
|
@ -528,7 +528,7 @@ class GamesService
|
|
|
|
|
# 三类实训只取基础部分数据
|
|
|
|
|
game = Game.select([:myshixun_id, :status, :challenge_id, :id, :evaluate_count]).find_by_identifier(params[:identifier])
|
|
|
|
|
myshixun = Myshixun.select([:updated_at, :gpid, :id, :shixun_id]).find(game.myshixun_id)
|
|
|
|
|
shixun = Shixun.select([:id, :evaluate_script, :webssh, :exec_time, :sigle_training, :identifier, :status, :evaluate_count]).find(myshixun.shixun_id)
|
|
|
|
|
shixun = Shixun.select([:id, :evaluate_script, :webssh, :exec_time, :sigle_training, :identifier, :status]).find(myshixun.shixun_id)
|
|
|
|
|
game_challenge = Challenge.select([:id, :position, :picture_path]).find(game.challenge_id)
|
|
|
|
|
|
|
|
|
|
# 更新评测次数
|
|
|
|
@ -599,9 +599,9 @@ class GamesService
|
|
|
|
|
return {:result => "success", :resubmit => resubmit, :ableToCreate => res['ableToCreate'], :waitNum => res['waitNum'],
|
|
|
|
|
:waitingTime => res['waitingTime'], :position => game_challenge.position, :port => res['port'],
|
|
|
|
|
:had_done => game.had_done}
|
|
|
|
|
# rescue Exception => e
|
|
|
|
|
# Rails.logger.error("评测出错,详情:" + e.message)
|
|
|
|
|
# return {:result => 'fail', :contents =>"实训云平台繁忙(繁忙等级:502),请稍后刷新并重试", :position => game_challenge.position, :had_done => game.had_done}
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
Rails.logger.error("评测出错,详情:" + e.message)
|
|
|
|
|
return {:result => 'fail', :contents =>"实训云平台繁忙(繁忙等级:502),请稍后刷新并重试", :position => game_challenge.position, :had_done => game.had_done}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 单评测类型(比较快的类型,实时返回结果,即不用中间层再回调trainint_task_status)
|
|
|
|
|