Merge branch 'develop' into 'develop'

bug修复



See merge request !97
This commit is contained in:
黄井泉 2016-12-30 21:14:55 +08:00
commit 5599395446
1 changed files with 4 additions and 1 deletions

View File

@ -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