diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 999090962..b0bde0f9d 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -217,6 +217,10 @@ class CoursesController < ApplicationController group.course_id = @course.id group.save end + @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' + @is_remote = true + @members = searchStudent(@course) + @membercount = @members.count @course_groups = @course.course_groups end @@ -228,6 +232,8 @@ class CoursesController < ApplicationController end @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @is_remote = true + @members = searchStudent(@course) + @membercount = @members.count @course_groups = @course.course_groups end def join_group @@ -236,7 +242,8 @@ class CoursesController < ApplicationController member.course_group_id = group.id member.save @group = group - + @members = searchStudent(@course) + @membercount = @members.count search_group_members group end def unjoin_group @@ -245,7 +252,8 @@ class CoursesController < ApplicationController member.course_group_id = 0 member.save @group = group - + @members = searchStudent(@course) + @membercount = @members.count search_group_members group end def searchgroupmembers @@ -258,14 +266,16 @@ class CoursesController < ApplicationController else @results = searchStudent(@course) end - + @members = searchStudent(@course) + @membercount = @members.count @results = paginateHelper @results end def search_group_members group @render_file = 'member_list' @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' @is_remote = true - + @members = searchStudent(@course) + @membercount = @members.count @results = searchStudent_by_group(group, @course) @results = paginateHelper @results end @@ -284,11 +294,10 @@ class CoursesController < ApplicationController @members = searchTeacherAndAssistant(@course) when '2' @subPage_title = l :label_student_list - if @course_group_id - @members = search_student_in_group(@course, @course_group_id) - else + @members = searchStudent(@course) - end + @membercount = @members.count + else @subPage_title = '' @members = @course.member_principals.includes(:roles, :principal).all.sort diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index 479bf27a5..2a53e2780 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -22,7 +22,7 @@ validate_groupname_null(value1); document.getElementsByName('group_name')[0].value = ""; } -" +