From 77bb60f3235a0642628835491a27acfa75b52e9f Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 10:17:56 +0800 Subject: [PATCH 1/8] =?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/8] =?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 7e5a779c33b07e900beb77651509d4b1284f763f Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Sat, 3 Aug 2019 10:43:02 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=95=99=E5=AD=A6=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=E7=9A=84=E5=85=A5=E5=BA=93=E6=A0=87=E5=87=86=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E8=AF=B4=E5=9C=B0=E5=9D=80=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/libraries/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index c5bb2ecd..e5878176 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -90,7 +90,7 @@
  • 温馨提示
  • From ab8ee2575aa9c77cd518235207c396ce8abbbf48 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Sat, 3 Aug 2019 11:53:18 +0800 Subject: [PATCH 4/8] =?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 5/8] .. --- 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 6/8] .. --- 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 From ef7d306815adadc55619a9e9c003c4cde5086318 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 3 Aug 2019 13:44:00 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E8=BF=90=E8=90=A5=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=94=BE=E5=BC=80=E5=9F=B9=E8=AE=AD=E4=BC=9A=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=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 6217532c..1dbed521 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -5,7 +5,7 @@ class ManagementsController < ApplicationController :editmd_template, :subject_level_system, :subject_setting_list, :shixun_authorization, :ec_template, :codemirror_template, :course_guide_template, :shixun_quality_score, :tech_system, :update_notice, :setting_banner, - :training_2018, :create_standard] + :create_standard] layout 'base_management' include ManagementsHelper include SortHelper From 784955cbf48f49d357bde3d731ad378e2a25560c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Sat, 3 Aug 2019 14:01:03 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E8=BF=90=E8=90=A5=E4=BA=BA=E5=91=98?= =?UTF-8?q?=E6=94=BE=E5=BC=80=E5=9F=B9=E8=AE=AD=E4=BC=9A=E7=9A=84=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 35 +++++++++++------------ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 1dbed521..d946c12b 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -100,26 +100,23 @@ class ManagementsController < ApplicationController @pay_type = params[:pay_type] @page = params[:page] || 1 @status = params[:status] - if User.current.admin? - @trainings = Training.includes(:training_payinfo) - if params[:search] && params[:search].strip != "" - @trainings = @trainings.where("trainings.name like '%#{params[:search]}%'") - end - if params[:training_type] && params[:training_type].to_i != -1 - @trainings = @trainings.where("training_type = #{params[:training_type]}") - end - if params[:pay_type] && params[:pay_type].to_i != -1 - @trainings = @trainings.where("training_payinfos.pay_type = #{params[:pay_type]}") - end - if params[:status] && params[:status].to_i != -1 - @trainings = @trainings.where("training_payinfos.status = #{params[:status]}") - end - @page = params[:page] || 1 - @all_trainings = @trainings.reorder("trainings.created_at desc") - @trainings = paginateHelper @trainings.reorder("trainings.created_at desc"), 50 - else - render_403 + @trainings = Training.includes(:training_payinfo) + if params[:search] && params[:search].strip != "" + @trainings = @trainings.where("trainings.name like '%#{params[:search]}%'") end + if params[:training_type] && params[:training_type].to_i != -1 + @trainings = @trainings.where("training_type = #{params[:training_type]}") + end + if params[:pay_type] && params[:pay_type].to_i != -1 + @trainings = @trainings.where("training_payinfos.pay_type = #{params[:pay_type]}") + end + if params[:status] && params[:status].to_i != -1 + @trainings = @trainings.where("training_payinfos.status = #{params[:status]}") + end + @page = params[:page] || 1 + @all_trainings = @trainings.reorder("trainings.created_at desc") + @trainings = paginateHelper @trainings.reorder("trainings.created_at desc"), 50 + respond_to do |format| format.js format.html