|
|
|
@ -59,7 +59,8 @@ class GraduationTasksController < ApplicationController
|
|
|
|
|
# 任务发布的情况下: 是老师身份或者任务已截止的情况下公开任务了作品设置的学生也能查看其他人的作品
|
|
|
|
|
if @task.published? && (@user_course_identity < Course::STUDENT ||
|
|
|
|
|
(@user_course_identity == Course::STUDENT && @work.present? && @work.take.work_status > 0 &&
|
|
|
|
|
@task.status > 1 && @task.open_work))
|
|
|
|
|
((!@task.allow_late && @task.status > 1) || (@task.allow_late && @task.late_time && @task.late_time < Time.now)) &&
|
|
|
|
|
(@task.open_work || @task.open_score)))
|
|
|
|
|
# 如有有分班则看分班内的学生,否则看所有学生的作品
|
|
|
|
|
user_ids =
|
|
|
|
|
if @user_course_identity < Course::STUDENT
|
|
|
|
@ -117,6 +118,7 @@ class GraduationTasksController < ApplicationController
|
|
|
|
|
@work_list = @work_list.joins(user: :user_extension).order("user_extensions.#{rorder} #{b_order}")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
@view_work = @task.open_work || @user_course_identity < Course::STUDENT
|
|
|
|
|
|
|
|
|
|
@work_count = @work_list.count
|
|
|
|
|
@work_excel = @work_list
|
|
|
|
@ -150,6 +152,7 @@ class GraduationTasksController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
@work_list = @work
|
|
|
|
|
@view_work = false
|
|
|
|
|
@work_count = @work_list.count
|
|
|
|
|
@all_work_count = @work_list.count
|
|
|
|
|
respond_to do |format|
|
|
|
|
|