diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 567250cdb..a1d8d6820 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -14,7 +14,7 @@ class MyshixunsController < ApplicationController jsonTestDetails = JSON.parse(params[:jsonTestDetails]) status = jsonTestDetails['status'] game_id = jsonTestDetails['buildID'] - outPut = Base64.urlsafe_decode64(jsonTestDetails['outPut']) unless jsonTestDetails['outPut'].blank? + outPut = Base64.urlsafe_decode64(jsonTestDetails['outPut'].gsub(" ", "+")) unless jsonTestDetails['outPut'].blank? jenkins_testsets = jsonTestDetails['msg'] # message = Base64.decode64(params[:msg]) unless params[:msg].blank? game = Game.find(game_id) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 6fe2a5180..e84eb0343 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -131,6 +131,10 @@ module ApplicationHelper return time end + def consume_time time + time.strftime('%Y/%m/%d %H:%M:%S') + end + def avg_spend_time shixun_id, position Game.find_by_sql("SELECT avg(g.updated_at - g.created_at) as avg_time FROM `games` g, `challenges` c where c.id=g.challenge_id and g.status =2 and c.position = #{position} and g.myshixun_id in (SELECT id FROM `myshixuns` where shixun_id= #{shixun_id});").first.try(:avg_time).to_i end diff --git a/app/views/games/_code_actions.html.erb b/app/views/games/_code_actions.html.erb index 890f11dd2..2d5f4bcf8 100644 --- a/app/views/games/_code_actions.html.erb +++ b/app/views/games/_code_actions.html.erb @@ -1,4 +1,4 @@ -耗时:<%= @consume_time %> +
<% if @game.status == 0 %> 评测 @@ -17,6 +17,34 @@ <% end %>