From c5a7baa45463035b81c12542e0363ff9ac0fbf5f Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 5 Dec 2014 16:21:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=88=E5=B9=B6=E5=BC=95?= =?UTF-8?q?=E8=B5=B7=E7=9A=84bug=20Signed-off-by:=20alan=20<547533434@qq.c?= =?UTF-8?q?om>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 25 +++++++++++++++++-------- app/views/courses/_groups_name.html.erb | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) 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 = ""; } -" +