编译失败提醒

dev_local
huang 6 years ago
parent 5a3447b5cf
commit 3ac9d7a736

@ -151,6 +151,9 @@ class GamesService
result = test_set.attributes.count > 4 ? test_set.try(:result) : nil
#actual_output = Base64.encode64(actual_output)
compile_success = (actual_output.blank? || actual_output.downcase.match(/error/).present?) ? 0 : 1
compile_success == 0 ? "编译失败,请在测试结果中查看具体的错误信息" : compile_success
public_result = {:is_public => (test_set.is_public ? 1 : 0), :result => result,
:actual_output => actual_output, :compile_success => compile_success}
# 测试集公开的话才返回input结果

Loading…
Cancel
Save