From 18542f59831f1ea00374bd7d797f989f270eee8e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 4 Jun 2019 15:12:24 +0800 Subject: [PATCH] 1 --- app/services/games_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/services/games_service.rb b/app/services/games_service.rb index db78c5dc..baa26aeb 100755 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -156,9 +156,10 @@ class GamesService actual_output = test_set.attributes.count > 4 ? test_set.try(:actual_output) : nil result = test_set.attributes.count > 4 ? test_set.try(:result) : nil compile_success = test_set.attributes.count > 4 ? test_set.try(:compile_success) : nil + status = test_set.attributes.count > 4 ? test_set.try(:code) : nil #actual_output = Base64.encode64(actual_output) - actual_output = (compile_success.to_s == "0" ? "编译失败,请在测试结果中查看具体的错误信息" : actual_output) + actual_output = (compile_success.to_s == "0" && status.to_s == "-1" ? "编译失败,请在测试结果中查看具体的错误信息" : actual_output) public_result = {:is_public => (test_set.is_public ? 1 : 0), :result => result, :actual_output => actual_output, :compile_success => compile_success}