commit
5599395446
|
@ -3,7 +3,10 @@
|
||||||
namespace :contest_work_evaluation do
|
namespace :contest_work_evaluation do
|
||||||
desc "start and end evaluation"
|
desc "start and end evaluation"
|
||||||
def get_assigned_contestant_works(judges, n, index, num)
|
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
|
end
|
||||||
# 获取竞赛的评委人员
|
# 获取竞赛的评委人员
|
||||||
def contest_judges contest
|
def contest_judges contest
|
||||||
|
|
Loading…
Reference in New Issue