From 57e2ab9ff17a910af47b21bb3c33249cce9c3b0c Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 30 Dec 2016 19:35:43 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=BD=9C=E5=93=81=E7=9A=84?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E8=AF=84=E5=AE=A1=E5=88=86=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/contest_work_evaluation.rake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/tasks/contest_work_evaluation.rake b/lib/tasks/contest_work_evaluation.rake index d97d4ba3d..6d72d4f01 100644 --- a/lib/tasks/contest_work_evaluation.rake +++ b/lib/tasks/contest_work_evaluation.rake @@ -3,7 +3,10 @@ namespace :contest_work_evaluation do desc "start and end evaluation" def get_assigned_contestant_works(judges, n, index, num) - judges[(index % num) .. ((index + n - 1) % num)] + judges = judges + judges + first_index = (index * n) % num + last_index = (index * n + n - 1) % num < first_index ? ((index * n + n - 1) % num) + num : (index * n + n - 1) % num + judges[first_index .. last_index] end # 获取竞赛的评委人员 def contest_judges contest