修复试卷的答题试卷导出

dev_forum
SylorHuang 5 years ago
parent 07e7f0d206
commit c6e1fd3f8d

@ -48,16 +48,16 @@ class ZipsController < ApplicationController
@course = @exercise.course
default_ex_users = @exercise.all_exercise_users(current_user.id).exercise_user_committed
default_ex_users_size = default_ex_users.size
@ex_users = default_ex_users #仅导出已提交的,截止后则是全部为提交的。
#可以分班选择
if group_id.present?
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)
default_ex_users_size = @ex_users.size
if default_ex_users_size == 0
normal_status(-1,"导出失败,暂时没有已提交的学生")
elsif default_ex_users_size > 100

Loading…
Cancel
Save