diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 520caa3b0..ba475aa80 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -463,12 +463,20 @@ class StudentWorkController < ApplicationController @no_group_count = @course.members.where(:course_group_id => 0).select{|m| m.roles.to_s.include?("Student")}.count @left_nav_type = 3 @tab = params[:tab].to_i + @all_student_works = @stundet_works + @student_work_count = @stundet_works.count + @limit = 50 + @is_remote = true + @page = (params['page'] || 1).to_i + @student_work_pages = Paginator.new @student_work_count, @limit, @page + @offset ||= @student_work_pages.offset + @stundet_works = paginateHelper @stundet_works, @limit respond_to do |format| format.js format.html { render :layout => 'base_edu'} format.xls { filename = "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@homework.name}#{l(:excel_homework_list)}.xls" - send_data(homework_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present", + send_data(homework_to_xls(@all_student_works), :type => "text/excel;charset=utf-8; header=present", :filename => filename_for_content_disposition(filename)) } end diff --git a/app/views/student_work/_evaluation_un_common_work.html.erb b/app/views/student_work/_evaluation_un_common_work.html.erb index bd445b7bc..324e98f73 100644 --- a/app/views/student_work/_evaluation_un_common_work.html.erb +++ b/app/views/student_work/_evaluation_un_common_work.html.erb @@ -1,5 +1,5 @@ - <%= index + 1 %> + <%= (@page - 1) * @limit + index + 1 %> <%= link_to student_work.user.show_name, user_path(student_work.user) %> diff --git a/app/views/student_work/_evaluation_un_group_work.html.erb b/app/views/student_work/_evaluation_un_group_work.html.erb index 88db342eb..3dea36759 100644 --- a/app/views/student_work/_evaluation_un_group_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_work.html.erb @@ -1,5 +1,5 @@ - <%= index + 1 %> + <%= (@page - 1) * @limit + index + 1 %> <%= link_to student_work.user.show_name, user_path(student_work.user) %> diff --git a/app/views/student_work/_evaluation_un_pro_work.html.erb b/app/views/student_work/_evaluation_un_pro_work.html.erb index 381f61e68..7b79c091d 100644 --- a/app/views/student_work/_evaluation_un_pro_work.html.erb +++ b/app/views/student_work/_evaluation_un_pro_work.html.erb @@ -1,5 +1,5 @@ - <%= index + 1 %> + <%= (@page - 1) * @limit + index + 1 %> <%= link_to student_work.user.show_name, user_path(student_work.user) %> diff --git a/app/views/student_work/_evaluation_un_shixun_work.html.erb b/app/views/student_work/_evaluation_un_shixun_work.html.erb index db00ca287..881463a0b 100644 --- a/app/views/student_work/_evaluation_un_shixun_work.html.erb +++ b/app/views/student_work/_evaluation_un_shixun_work.html.erb @@ -1,5 +1,5 @@ - <%= index + 1 %> + <%= (@page - 1) * @limit + index + 1 %> <%= link_to student_work.user.show_name, user_path(student_work.user) %> diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index 9e2a286df..1b0e7ed12 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -2,7 +2,7 @@ <%= link_to "更新时间排序", student_work_index_path(:homework => @homework.id, :order => "updated_at", :sort => @score, :name => @name, :group => @group, :comment => @comment, :status => @status), :class => "#{@order == 'updated_at' ? 'color-blue' : ''} fl ml15", :remote => true %> | <%= link_to "最终成绩排序", student_work_index_path(:homework => @homework.id, :order => "work_score", :sort => @score, :name => @name, :group => @group, :comment => @comment, :status => @status), :class => "#{@order == 'work_score' ? 'color-blue' : ''} fl", :remote => true %> -

<%= @stundet_works.count %> 个检索结果(<%= @homework.course.student.count %> 学生)

+

<%= @student_work_count %> 个检索结果(<%= @homework.course.student.count %> 学生)

<% if @is_teacher %>
<%= link_to "导出成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :comment => @comment, :status => @status, :format => 'xls'),:class=>'fl mr5', :id => "export_student_work"%> @@ -24,3 +24,12 @@ <%= render :partial => "evaluation_un_title"%> <% end%>
+ +
+
+ +
+
+
\ No newline at end of file