From 77bb60f3235a0642628835491a27acfa75b52e9f Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 10:17:56 +0800 Subject: [PATCH 1/5] =?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/5] =?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 From ab8ee2575aa9c77cd518235207c396ce8abbbf48 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 11:53:18 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=AF=84=E6=B5=8B=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 6e495cdf..6217532c 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).reorder("consume_time desc") + @recodes = EvaluateRecord.where("created_at > ?", Time.now - 1.days).reorder("consume_time desc") @recodes_count = @recodes.size @record_pages = Paginator.new @recodes_count, 20, page || 1 @offset ||= @record_pages.offset From 028fe8e05e6584c17d3c4732d01a6c72b32c5070 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 11:55:47 +0800 Subject: [PATCH 4/5] .. --- db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb b/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb index 0b054e3c..79faa534 100644 --- a/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb +++ b/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb @@ -1,5 +1,5 @@ class AddExecTimeToEvaluateRecords < ActiveRecord::Migration def change - add_column :evaluate_records, :exec_time, :integer + # add_column :evaluate_records, :exec_time, :integer end end From 7fa583ab430b2e3fac0d76ac0357bebd1ebbe788 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 11:56:30 +0800 Subject: [PATCH 5/5] .. --- db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb b/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb index 79faa534..0b054e3c 100644 --- a/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb +++ b/db/migrate/20190803022733_add_exec_time_to_evaluate_records.rb @@ -1,5 +1,5 @@ class AddExecTimeToEvaluateRecords < ActiveRecord::Migration def change - # add_column :evaluate_records, :exec_time, :integer + add_column :evaluate_records, :exec_time, :integer end end