diff --git a/app/services/games_service.rb b/app/services/games_service.rb index ece6de68..b40edbf4 100644 --- a/app/services/games_service.rb +++ b/app/services/games_service.rb @@ -846,7 +846,7 @@ class GamesService experience = 0 game_status = game.status had_done = game.had_done - game_challenge = Challenge.select([:id, :score, :position, :shixun_id, :web_route]).find(game.challenge_id) + game_challenge = Challenge.select([:id, :score, :position, :shixun_id, :web_route, :picture_path]).find(game.challenge_id) shixun = Shixun.select([:id, :status, :user_id, :test_set_permission]).find(game_challenge.shixun_id) if params[:resubmit].blank? # 非重新评测 @@ -904,8 +904,8 @@ class GamesService check_power = (power == 1 || game.test_sets_view) test_sets = test_set_static_data(qurey_test_sets, check_power) end - # 处理生成图片类型文件 - picture = (game.picture_path.nil? ? 0 : game.id) + # 处理生成图片类型文件,show_type: -1表示没设置效果展示方式 + picture = (game_challenge.show_type != -1 && game.picture_path.present? ? game.id : 0) # 针对web类型的实训 web_route = game_challenge.try(:web_route) mirror_name = shixun.mirror_name