|
|
|
@ -52,15 +52,16 @@ class ZipsController < ApplicationController
|
|
|
|
|
@ex_users = default_ex_users #仅导出已提交的,截止后则是全部为提交的。
|
|
|
|
|
#可以分班选择
|
|
|
|
|
if group_id.present?
|
|
|
|
|
exercise_students = @course.students.course_find_by_ids("course_group_id",group_id) # 试卷所分班的全部人数
|
|
|
|
|
user_ids = exercise_students.pluck(:user_id).reject(&:blank?)
|
|
|
|
|
@ex_users = @ex_users.exercise_commit_users(user_ids)
|
|
|
|
|
exercise_students = @course.students.where(course_group_id: group_id) # 试卷所分班的全部人数
|
|
|
|
|
user_ids = exercise_students.pluck(:user_id).reject(&:blank?).uniq
|
|
|
|
|
logger.info("+++++++##################_________________user_ids_____________#########{user_ids}")
|
|
|
|
|
@ex_users = @ex_users.where(user_id: user_ids)
|
|
|
|
|
end
|
|
|
|
|
# @ex_users = @ex_users.first(200)
|
|
|
|
|
if default_ex_users_size == 0
|
|
|
|
|
normal_status(-1,"导出失败,暂时没有已提交的学生")
|
|
|
|
|
elsif default_ex_users_size > 200
|
|
|
|
|
normal_status(-1,"导出数量超过200,请分班导出或联系网站管理员导出")
|
|
|
|
|
elsif default_ex_users_size > 100
|
|
|
|
|
normal_status(-1,"导出数量超过100,请分班导出或联系网站管理员导出")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
rescue Exception => e
|
|
|
|
|