diff --git a/app/models/exercise.rb b/app/models/exercise.rb index cc7c99f1b..0b4aca8eb 100644 --- a/app/models/exercise.rb +++ b/app/models/exercise.rb @@ -67,7 +67,7 @@ class Exercise < ApplicationRecord # 分班权限的老师可见的作品列表 def all_exercise_users user_id # member = course.course_member(user_id) - teacher_course_groups = course.teacher_course_groups.get_user_groups + teacher_course_groups = course.teacher_course_groups.get_user_groups(user_id) ex_users = self.all_works # 有分班权限的统计管理的分班且已发布的学生情况 if teacher_course_groups.exists? diff --git a/app/models/poll.rb b/app/models/poll.rb index 3edc3c661..d37ea8458 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -61,7 +61,7 @@ class Poll < ApplicationRecord # 分班权限的老师可见的作品列表 def all_poll_users user_id # member = course.course_member(user_id) - teacher_course_groups = course.teacher_course_groups.get_user_groups + teacher_course_groups = course.teacher_course_groups.get_user_groups(user_id) poll_users = self.all_works # 有分班权限的统计管理的分班且已发布的学生情况 if teacher_course_groups.exists?