From b17f7170f647eb160844a7a9b78d957e0b6f7013 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 27 Aug 2019 11:54:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=88=E6=9E=9C=E5=B1=95=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 58e4683e0..21854286d 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -739,7 +739,7 @@ class GamesController < ApplicationController 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, :show_type]).find(@game.challenge_id) if params[:resubmit].blank? # 非重新评测 if game_status == 2 # 通关 @@ -764,10 +764,16 @@ class GamesController < ApplicationController # 区分评测过未评测过,未评测过按需求取数据 testset_detail max_query_index.to_i, game_challenge - # 处理生成图片类型文件 - picture = (@game.picture_path.nil? ? 0 : @game.id) - # 针对web类型的实训 - web_route = game_challenge.try(:web_route) + picture = 0 + web_route = nil + # 有效果展示时 + if game_challenge.show_type.to_i != -1 + # 处理生成图片类型文件 + picture = (@game.picture_path.nil? ? 0 : @game.id) + # 针对web类型的实训 + web_route = game_challenge.try(:web_route) + end + mirror_name = @shixun.mirror_name e_record = EvaluateRecord.where(:identifier => sec_key).first