|
|
|
@ -52,12 +52,12 @@ class Poll < ApplicationRecord
|
|
|
|
|
|
|
|
|
|
# 统一设置,为当前老师有权限的分班学生,分班设置,也为当前老师有权限的分班的学生
|
|
|
|
|
def all_poll_users(user_id)
|
|
|
|
|
poll_users = self.poll_users
|
|
|
|
|
poll_all_users = poll_users
|
|
|
|
|
group_ids = poll_published_ids(user_id)
|
|
|
|
|
if group_ids.present?
|
|
|
|
|
poll_users = poll_users.where(user_id: course.students.where(course_group_id: group_ids).pluck(:user_id))
|
|
|
|
|
poll_all_users = poll_all_users.where(user_id: course.students.where(course_group_id: group_ids).pluck(:user_id).uniq)
|
|
|
|
|
end
|
|
|
|
|
poll_users
|
|
|
|
|
poll_all_users
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#当前用户已发布的班级id和试卷分组已发布的班级id的交集
|
|
|
|
|