|
|
@ -14,6 +14,7 @@ namespace :excellent_course_exercise do
|
|
|
|
course = Course.find_by(id: course_id)
|
|
|
|
course = Course.find_by(id: course_id)
|
|
|
|
|
|
|
|
|
|
|
|
course.exercises.each_with_index do |exercise, index|
|
|
|
|
course.exercises.each_with_index do |exercise, index|
|
|
|
|
|
|
|
|
if exercise.exercise_users.where(commit_status: 1).count == 0
|
|
|
|
# 第一个试卷的参与人数和通过人数都是传的数据,后续的随机
|
|
|
|
# 第一个试卷的参与人数和通过人数都是传的数据,后续的随机
|
|
|
|
if index == 0
|
|
|
|
if index == 0
|
|
|
|
members = course.students.order("id asc").limit(participant_count)
|
|
|
|
members = course.students.order("id asc").limit(participant_count)
|
|
|
@ -27,6 +28,7 @@ namespace :excellent_course_exercise do
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def update_exercise_user exercise, members, pass_count
|
|
|
|
def update_exercise_user exercise, members, pass_count
|
|
|
|
exercise_question_ids = exercise.exercise_questions.where(question_type: 0).pluck(:id)
|
|
|
|
exercise_question_ids = exercise.exercise_questions.where(question_type: 0).pluck(:id)
|
|
|
|