|
|
@ -51,9 +51,9 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
# debug 与submit 公用的参数
|
|
|
|
# debug 与submit 公用的参数
|
|
|
|
|
|
|
|
|
|
|
|
ds_params = {input: testCase['input'], output: testCase['output'], hack_id: @hack.id,
|
|
|
|
ds_params = {input: testCase['input'], output: testCase['output'], hack_id: @hack.id,
|
|
|
|
user_id: @my_hack.user_id, error_line: error_line, status: ojEvaResult['status'],
|
|
|
|
code: ojEvaResult['codeFileContent'], user_id: @my_hack.user_id, error_line: error_line,
|
|
|
|
error_msg: ojEvaResult['outPut'], execute_time: ojEvaResult['executeTime'],
|
|
|
|
status: ojEvaResult['status'], error_msg: ojEvaResult['outPut'],
|
|
|
|
execute_memory: ojEvaResult['executeMem']}
|
|
|
|
execute_time: ojEvaResult['executeTime'], execute_memory: ojEvaResult['executeMem']}
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
# debug模式与submit模式
|
|
|
|
# debug模式与submit模式
|
|
|
|
if ojEvaResult['execMode'] == "debug"
|
|
|
|
if ojEvaResult['execMode'] == "debug"
|
|
|
@ -64,6 +64,7 @@ class HackUserLastestCodesController < ApplicationController
|
|
|
|
# 评测完成后,还原评测中的状态
|
|
|
|
# 评测完成后,还原评测中的状态
|
|
|
|
@my_hack.update_attribute(:submit_status, 0)
|
|
|
|
@my_hack.update_attribute(:submit_status, 0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
render_ok
|
|
|
|
rescue Exception => e
|
|
|
|
rescue Exception => e
|
|
|
|
logger.error("#########listen_result: #{e.message}")
|
|
|
|
logger.error("#########listen_result: #{e.message}")
|
|
|
|
end
|
|
|
|
end
|
|
|
|