作业下拉列表显示全部作业

This commit is contained in:
cxt 2016-04-14 14:45:42 +08:00
parent 19861ba8c6
commit d91d2bfa17
1 changed files with 2 additions and 2 deletions

View File

@ -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]