diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index d919ac59a..db582c838 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -46,8 +46,7 @@ class GamesController < ApplicationController logger.info("7777************#{@entries} ") end logger.info("88888************#{@entries} ") - @latest_output = @game.latest_output.try(:out_put).to_s - outputs = @game.outputs + @test_cases = @game_challenge.test_sets (@myshixun.games.count == @game_challenge.position && @game.status ==2) ? @had_done = 1 : @had_done = 0 if outputs.count == 0 @results = [] diff --git a/app/models/test_set.rb b/app/models/test_set.rb index b42172970..90627a8db 100644 --- a/app/models/test_set.rb +++ b/app/models/test_set.rb @@ -1,4 +1,5 @@ class TestSet < ActiveRecord::Base - attr_accessible :challenge_id, :input, :output, :game_id + default_scope :order => 'id desc' + attr_accessible :challenge_id, :input, :output, :game_id, :actual_output belongs_to :challenge end diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index f8325d57e..0fd7e1a65 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -1,27 +1,80 @@ -
0/11 编译错误
-