获取语言

dev_aliyun2
daiao 5 years ago committed by harry
parent 5dbcc331de
commit f3b428f829

@ -13,7 +13,8 @@ class HackUserLastestCodesController < ApplicationController
end end
def update_code def update_code
@my_hack.update_attribute(:code, params[:code]) # 防止tpm改动了语言所以更新语言字段
@my_hack.update_attributes(code: params[:code], language: @hack.language)
render_ok render_ok
end end
@ -100,7 +101,7 @@ class HackUserLastestCodesController < ApplicationController
if ojEvaResult['execMode'] == "debug" if ojEvaResult['execMode'] == "debug"
save_debug_data ds_params save_debug_data ds_params
elsif ojEvaResult['execMode'] == "submit" elsif ojEvaResult['execMode'] == "submit"
save_submit_data ds_params.merge(expected_output: testCase['expectedOutput'], save_submit_data ds_params.merge(expected_output: testCase['expectedOutput'], language: @hack.language,
error_test_set_id: ojEvaResult['failCaseNum']) error_test_set_id: ojEvaResult['failCaseNum'])
end end
# 评测完成后,还原评测中的状态 # 评测完成后,还原评测中的状态
@ -138,7 +139,7 @@ class HackUserLastestCodesController < ApplicationController
debug_params = {execMode: exec_mode, debug_params = {execMode: exec_mode,
tpiID: @my_hack.identifier, tpiID: @my_hack.identifier,
testCases: testCases, testCases: testCases,
platform: @my_hack.language, platform: @hack.language,
codeFileContent: @my_hack.code, codeFileContent: @my_hack.code,
timeLimit: @hack.time_limit, timeLimit: @hack.time_limit,
sec_key: Time.now.to_i} sec_key: Time.now.to_i}

Loading…
Cancel
Save