代码测试截取ERROR_MSG时只在编译错误下截取

yuanke_org
yuanke 9 years ago
parent 6056505f96
commit e24470db4c

@ -123,7 +123,9 @@ class StudentWorkController < ApplicationController
#-1 默认值 0全部正确并结束 2 超时 -2 编译错误 #-1 默认值 0全部正确并结束 2 超时 -2 编译错误
resultObj[:status] = -1 resultObj[:status] = -1
resultObj[:results] = result["results"].first #本次测试结果 resultObj[:results] = result["results"].first #本次测试结果
result["error_msg"] = result["error_msg"][0..2047] if result["status"].to_i == -2 #编译错误
result["error_msg"] = result["error_msg"][0..2047]
end
resultObj[:error_msg] = result["error_msg"] #编译错误时的信息 resultObj[:error_msg] = result["error_msg"] #编译错误时的信息
#该状态用于存入CodeTests #该状态用于存入CodeTests

Loading…
Cancel
Save