|
|
@ -160,7 +160,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
# 作品状态 0: 未提交, 1 按时提交, 2 延迟提交
|
|
|
|
# 作品状态 0: 未提交, 1 按时提交, 2 延迟提交
|
|
|
|
if params[:work_status].present?
|
|
|
|
if params[:work_status].present?
|
|
|
|
params_work_status = request.get? ? params[:work_status].split(",") : params[:work_status]
|
|
|
|
params_work_status = params[:work_status]
|
|
|
|
work_status = params_work_status.map{|status| status.to_i}
|
|
|
|
work_status = params_work_status.map{|status| status.to_i}
|
|
|
|
all_student_works = @student_works.left_joins(:myshixun)
|
|
|
|
all_student_works = @student_works.left_joins(:myshixun)
|
|
|
|
@student_works = all_student_works.where(work_status: work_status)
|
|
|
|
@student_works = all_student_works.where(work_status: work_status)
|
|
|
@ -171,7 +171,7 @@ class HomeworkCommonsController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
# 分班情况
|
|
|
|
# 分班情况
|
|
|
|
unless params[:course_group].blank?
|
|
|
|
unless params[:course_group].blank?
|
|
|
|
group_ids = request.get? ? params[:course_group].split(",") : params[:course_group]
|
|
|
|
group_ids = params[:course_group]
|
|
|
|
group_user_ids = @course.students.where(course_group_id: group_ids).pluck(:user_id)
|
|
|
|
group_user_ids = @course.students.where(course_group_id: group_ids).pluck(:user_id)
|
|
|
|
# 有分组只可能是老师身份查看列表
|
|
|
|
# 有分组只可能是老师身份查看列表
|
|
|
|
@student_works = @student_works.where(user_id: group_user_ids)
|
|
|
|
@student_works = @student_works.where(user_id: group_user_ids)
|
|
|
|