|
|
|
@ -37,7 +37,7 @@ class GraduationTasksController < ApplicationController
|
|
|
|
|
@all_count = @course.graduation_tasks.size
|
|
|
|
|
@published_count = @course.graduation_tasks.where("publish_time <= '#{Time.now}'").size
|
|
|
|
|
@task_count = @tasks.size
|
|
|
|
|
@tasks = @tasks.reorder("#{default_order}").page(page).per(15).includes(:graduation_works, course: [course_members: :teacher_course_groups])
|
|
|
|
|
@tasks = @tasks.reorder("#{default_order}").page(page).per(15).includes(:graduation_works)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 任务问答
|
|
|
|
@ -72,7 +72,7 @@ class GraduationTasksController < ApplicationController
|
|
|
|
|
|
|
|
|
|
@work_list = @task.graduation_works.where(user_id: user_ids).includes(user: [:user_extension])
|
|
|
|
|
@all_work_count = @work_list.count
|
|
|
|
|
@teachers = @course.teachers.where.not(user_id: current_user.id)
|
|
|
|
|
@teachers = @course.teachers.where.not(user_id: current_user.id).includes(:user)
|
|
|
|
|
# 教师评阅搜索 0: 未评, 1 已评
|
|
|
|
|
unless params[:teacher_comment].blank?
|
|
|
|
|
graduation_work_ids = GraduationWorkScore.where(graduation_work_id: @work_list.map(&:id)).pluck(:graduation_work_id)
|
|
|
|
@ -123,6 +123,8 @@ class GraduationTasksController < ApplicationController
|
|
|
|
|
@work_count = @work_list.count
|
|
|
|
|
@work_excel = @work_list
|
|
|
|
|
@work_list = @work_list.page(page).per(limit)
|
|
|
|
|
@students = @course.students
|
|
|
|
|
@assign_power = @user_course_identity < Course::STUDENT && @task.cross_comment && @task.comment_status == 2
|
|
|
|
|
|
|
|
|
|
if params[:format] == "xlsx"
|
|
|
|
|
complete_works = @work_excel.where("work_status > 0").size
|
|
|
|
|