diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index e52b8434b..49e6ec290 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -18,10 +18,10 @@ class HomeworkCommonController < ApplicationController @is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course)) if @is_teacher @homeworks = @course.homework_commons.order("updated_at desc").limit(10).offset(@page * 10) - @homework_commons = @course.homework_commons.order("created_at desc").limit(10).offset(@page * 10) + @homework_commons = @course.homework_commons.order("created_at desc") else @homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("updated_at desc").limit(10).offset(@page * 10) - @homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc").limit(10).offset(@page * 10) + @homework_commons = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at desc") end @is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher)) @is_new = params[:is_new]