Merge branches 'dev_aliyun' and 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into ysm1

dev_sync_trustie
杨树明 5 years ago
commit 6562986351

@ -25,7 +25,7 @@ class CourseAddStudentCreateWorksJob < ApplicationJob
student_ids.each do |user_id|
same_attrs = {user_id: user_id}
course.homework_commons.where(homework_type: %i[normal group practice]).each do |homework|
next if homework.student_works.where(user_id: user_id).any?
next if StudentWork.where(user_id: user_id, homework_common_id: homework.id).any?
worker.add same_attrs.merge(homework_common_id: homework.id)
end
end
@ -36,7 +36,7 @@ class CourseAddStudentCreateWorksJob < ApplicationJob
student_ids.each do |user_id|
same_attrs = {user_id: user_id}
course.exercises.each do |exercise|
next if exercise.exercise_users.where(user_id: user_id).any?
next if ExerciseUser.where(user_id: user_id, exercise_id: exercise.id).any?
worker.add same_attrs.merge(exercise_id: exercise.id)
end
end
@ -47,7 +47,7 @@ class CourseAddStudentCreateWorksJob < ApplicationJob
student_ids.each do |user_id|
same_attrs = {user_id: user_id}
course.polls.each do |poll|
next if poll.poll_users.where(user_id: user_id).any?
next if PollUser.where(user_id: user_id, poll_id: poll.id).any?
worker.add same_attrs.merge(poll_id: poll.id)
end
end
@ -58,7 +58,7 @@ class CourseAddStudentCreateWorksJob < ApplicationJob
student_ids.each do |user_id|
same_attrs = {user_id: user_id, course_id: course.id}
course.graduation_tasks.each do |task|
next if task.graduation_works.where(user_id: user_id).any?
next if GraduationWork.where(user_id: user_id, graduation_task_id: task.id).any?
worker.add same_attrs.merge(graduation_task_id: task.id)
end
end

Loading…
Cancel
Save