From 77bb60f3235a0642628835491a27acfa75b52e9f Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 10:17:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9C=80=E5=A4=A7=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 2 +- app/views/managements/evaluate_simple.html.erb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 6217532c..6e495cdf 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -878,7 +878,7 @@ class ManagementsController < ApplicationController def evaluate_simple page = params[:page] - @recodes = EvaluateRecord.where("created_at > ?", Time.now - 1.days).reorder("consume_time desc") + @recodes = EvaluateRecord.where("created_at < ?", Time.now).reorder("consume_time desc") @recodes_count = @recodes.size @record_pages = Paginator.new @recodes_count, 20, page || 1 @offset ||= @record_pages.offset diff --git a/app/views/managements/evaluate_simple.html.erb b/app/views/managements/evaluate_simple.html.erb index 30e8cd39..514223a3 100644 --- a/app/views/managements/evaluate_simple.html.erb +++ b/app/views/managements/evaluate_simple.html.erb @@ -5,7 +5,6 @@ ID 总耗时 - 作品更新 文件更新 中间层总耗时 pull代码 @@ -15,7 +14,8 @@ 前端轮询 结果存储 创建时间 - 最大执行时间 + 评测时最大时间 + 最新执行时间 唯一标识 实训名称 @@ -26,7 +26,6 @@ <%= record.id %> <%= record.consume_time %> - <%= record.student_work %> <%= record.file_update %> <%= record.brige %> <%= record.git_pull %> @@ -37,8 +36,9 @@ <%= record.test_cases %> <%= format_time record.created_at %> <% challenge = Game.find(record.game_id).challenge %> + <%= record.try(:exec_time) %> <%= challenge.try(:exec_time) %> - <%= record.shixun.try(:identifier) %> + <%= record.try(:identifier) %> <%= link_to record.shixun.try(:name), task_path(record.game), :target => "_blank", :title => "#{record.shixun.try(:name)}" %> <% end %> From a01ce10bf846008c78d78fbc749dd2a61aa743a9 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 10:30:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20190803022733_add_exec_time_to_evaluate_records.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb diff --git a/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb b/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb new file mode 100644 index 00000000..0b054e3c --- /dev/null +++ b/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb @@ -0,0 +1,5 @@ +class AddExecTimeToEvaluateRecords < ActiveRecord::Migration + def change + add_column :evaluate_records, :exec_time, :integer + end +end