评测增加创建pod和clone代码状态的信息

dev_ec
daiao 6 years ago
parent c67157ca7e
commit f31d1a4c11

@ -467,7 +467,7 @@ class MyshixunsController < ApplicationController
# taskId 即返回的game id
# 返回结果params [:stauts] 0 表示运行结果成功,其它则失败
# compile_success 1 表示成功; 0表示失败
# compile_success 1 表示成功; 0表示编译失败; -1 表示创建pod失败 -2 表示克隆代码失败
# msg 错误信息
# output 为测试用户编译输出结果
# myshixun:status 1为完成实训
@ -475,7 +475,7 @@ class MyshixunsController < ApplicationController
# resubmit 1表示已通关后重新评测0表示非重新评测
# retry_status 0初始值1重新评测失败2重新评测成功
# tpiRepoPath 中间层图片的workspace路径
# params[:jsonTestDetails] = '{"buildID":"19284","compileSuccess":"1",
# params[:jsonTestDetails] = '{"buildID":"19284","compileSuccess":"1","createPodStatus": "1", "downloadStatus": "1",
# "msg":[{"caseId":"1","expectedOutput":"MSAyIDMNCg","input":"MiAzIDE","output":"MSAyIDMNCg","passed":"1"},
# {"caseId":"2","expectedOutput":"LTMgMSA2DQo","input":"LTMgNiAx","output":"LTMgMSA2DQo","passed":"1"},
# {"caseId":"3","expectedOutput":"LTcgLTUgLTMNCg","input":"LTcgLTMgLTU","output":"LTcgLTUgLTMNCg","passed":"1"}],
@ -497,7 +497,18 @@ class MyshixunsController < ApplicationController
resubmit = jsonTestDetails['resubmit']
outPut = tran_base64_decode64(jsonTestDetails['outPut'])
jenkins_testsets = jsonTestDetails['msg']
compile_success = jsonTestDetails['compileSuccess']
# 创建pod的状态 0 失败 1 成功
create_pod_status = jsonTestDetails['createPodStatus']
# 克隆代码的装填 0 失败 1 成功
clone_code_status = jsonTestDetails['downloadStatus']
# 1表示编译成功0 表示运行异常; -1 表示克隆代码失败; -2 表示创建pod失败
compile_success = if clone_code_status == "0"
-1
elsif create_pod_status == "0"
-2
else
jsonTestDetails['compileSuccess']
end
# message = Base64.decode64(params[:msg]) unless params[:msg].blank?
logger.info(outPut)
game = Game.find(game_id)

@ -1,7 +1,7 @@
class Output < ActiveRecord::Base
# attr_accessible :title, :body
# actual_output 编程题:实际输出, 选择题: 用户提交的答案(如: 014 对应用户选择为A B E
# compile_success 1 表示程序未报错,有正常输出, 0.表示程序抛异常了,报错!
# compile_success 1 表示程序未报错,有正常输出, 0.表示程序抛异常了,报错! -1 表示克隆代码失败; -2 表示创建pod失败
default_scope :order => 'query_index desc'
belongs_to :game
#belongs_to :challenge_choose

Loading…
Cancel
Save