运行成功,评测却报错

dev_local
daiao 6 years ago
parent 18542f5983
commit 653c4d80b2

@ -94,13 +94,13 @@ class GamesService
# 区分评测过未评测过,未评测过按需求取数据
sql =
if max_query_index > 0
"SELECT
b.actual_output, b.out_put, b.result, b.compile_success, a.is_public, a.input, a.output
"SELECT
b.code, b.actual_output, b.out_put, b.result, b.compile_success, a.is_public, a.input, a.output
FROM
(SELECT position, input, output, challenge_id, is_public FROM test_sets where challenge_id=#{game_challenge.id}) a
LEFT JOIN
(SELECT
result, test_set_position, g.challenge_id, o.actual_output, o.out_put, o.compile_success
result, test_set_position, g.challenge_id, o.actual_output, o.out_put, o.compile_success, o.code
FROM
outputs o left join games g on g.id=o.game_id
WHERE
@ -321,7 +321,7 @@ class GamesService
max_query_index = game.query_index - 1
# 区分评测过未评测过,未评测过按需求取数据
if max_query_index > 0
qurey_test_sets = TestSet.find_by_sql("SELECT o.actual_output, o.out_put, o.result, o.compile_success, o.test_set_position, o.query_index,t.is_public,t.input, t.output, g.id as game_id, c.id as challenge_id FROM outputs o,games g ,challenges c,test_sets t where
qurey_test_sets = TestSet.find_by_sql("SELECT o.code, o.actual_output, o.out_put, o.result, o.compile_success, o.test_set_position, o.query_index,t.is_public,t.input, t.output, g.id as game_id, c.id as challenge_id FROM outputs o,games g ,challenges c,test_sets t where
g.id=#{game.id} and o.query_index=#{max_query_index} and g.id = o.game_id and c.id= g.challenge_id and t.challenge_id = c.id and t.position =o.test_set_position order by o.query_index
")
else
@ -841,7 +841,7 @@ class GamesService
max_query_index = game.query_index - 1
# 区分评测过未评测过,未评测过按需求取数据
if max_query_index > 0
qurey_test_sets = TestSet.find_by_sql("SELECT o.actual_output,o.result, o.compile_success, o.test_set_position, o.query_index,t.is_public,t.input, t.output, g.id as game_id, c.id as challenge_id FROM outputs o,games g ,challenges c,test_sets t where
qurey_test_sets = TestSet.find_by_sql("SELECT c.code, o.actual_output,o.result, o.compile_success, o.test_set_position, o.query_index,t.is_public,t.input, t.output, g.id as game_id, c.id as challenge_id FROM outputs o,games g ,challenges c,test_sets t where
g.id=#{game.id} and o.query_index=#{max_query_index} and g.id = o.game_id and c.id= g.challenge_id and t.challenge_id = c.id and t.position =o.test_set_position order by o.query_index
")
else

Loading…
Cancel
Save