dev_forum
SylorHuang 5 years ago
parent 51dc8ae124
commit fba4bf3184

@ -49,12 +49,12 @@ class ZipsController < ApplicationController
@course = @exercise.course @course = @exercise.course
default_ex_users = @exercise.all_exercise_users(current_user.id).exercise_user_committed default_ex_users = @exercise.all_exercise_users(current_user.id).exercise_user_committed
@ex_users = default_ex_users.limit 1 #仅导出已提交的,截止后则是全部为提交的。 @ex_users = default_ex_users #仅导出已提交的,截止后则是全部为提交的。
#可以分班选择 #可以分班选择
if group_id.present? if group_id.present?
exercise_students = @course.students.where(course_group_id: group_id) # 试卷所分班的全部人数 exercise_students = @course.students.where(course_group_id: group_id) # 试卷所分班的全部人数
user_ids = exercise_students.pluck(:user_id).reject(&:blank?).uniq user_ids = exercise_students.pluck(:user_id).reject(&:blank?).uniq
@ex_users = @ex_users.where(user_id: user_ids).limit 1 @ex_users = @ex_users.where(user_id: user_ids)
end end
default_ex_users_size = @ex_users.size default_ex_users_size = @ex_users.size

Loading…
Cancel
Save