竞赛作品的在线评审分布
This commit is contained in:
parent
b92bb88985
commit
57e2ab9ff1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue