diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 7653be94d..61944ca2c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -254,8 +254,8 @@ class CoursesController < ApplicationController end @is_remote = true @result_count = @results.count - @results = paginateHelper @results - + @results = paginateHelper @results, 10 + @search_name = q end def addgroups @@ -428,17 +428,34 @@ class CoursesController < ApplicationController # @results = paginateHelper @results@score_sort_by = "desc" @is_remote = true @score_sort_by = params[:sort_by] if params[:sort_by] + @search_name = params[:search_name] if params[:search_name] group_id = params[:group_id] - if group_id == '0' - page = params[:page].nil? ? 0 : (params['page'].to_i - 1) - @results = student_homework_score(0,page, 10,@score_sort_by) + if !@search_name.nil? + if group_id == '0' + page = params[:page].nil? ? 0 : (params['page'].to_i - 1) - @results = paginateHelper_for_members @results, 10 + @results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by), @search_name) + @result_count = @results.count + @results = paginateHelper @results, 10 + else + @group = CourseGroup.find(group_id) + @results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by),@search_name) + @result_count = @results.count + @results = paginateHelper @results, 10 + end else - @group = CourseGroup.find(group_id) - @results = student_homework_score(group_id, 0, 0,@score_sort_by) - @results = paginateHelper @results, 10 + if group_id == '0' + page = params[:page].nil? ? 0 : (params['page'].to_i - 1) + @results = student_homework_score(0,page, 10,@score_sort_by) + + @results = paginateHelper_for_members @results, 10 + else + @group = CourseGroup.find(group_id) + @results = student_homework_score(group_id, 0, 0,@score_sort_by) + @results = paginateHelper @results, 10 + end end + end # 显示每个学生的作业评分详情 def show_member_score diff --git a/app/views/courses/_member_list.html.erb b/app/views/courses/_member_list.html.erb index dd543ec2c..11bfd9f81 100644 --- a/app/views/courses/_member_list.html.erb +++ b/app/views/courses/_member_list.html.erb @@ -25,7 +25,7 @@