作品列表-分班过滤:点击“请选择分班”过滤显示所有学生

This commit is contained in:
daiao 2016-07-25 19:53:56 +08:00
commit 67bdea314a
1 changed files with 7 additions and 0 deletions

View File

@ -389,6 +389,13 @@ class StudentWorkController < ApplicationController
else
student_in_group = '(' + none_group_students.map{ |member| member.user_id }.join(',') + ')'
end
elsif @group == "-1"
all_group_students = @course.members.select{ |member| member.course_group_id }
if all_group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + all_group_students.map{ |member| member.user_id }.join(',') + ')'
end
else
course_group = CourseGroup.find_by_id(@group)
group_students = course_group.users