|
|
|
@ -42,7 +42,6 @@ class ZipsController < ApplicationController
|
|
|
|
|
begin
|
|
|
|
|
@exercise = Exercise.includes(:exercise_users,:exercise_questions).find_by(id:params[:exercise_id])
|
|
|
|
|
@request_url = request.base_url
|
|
|
|
|
logger.info("######################____________@request_url____________##########################{@request_url}")
|
|
|
|
|
group_id = params[:exercise_group_id]
|
|
|
|
|
if @exercise.blank?
|
|
|
|
|
normal_status(-1,"试卷不存在")
|
|
|
|
@ -50,12 +49,12 @@ class ZipsController < ApplicationController
|
|
|
|
|
@course = @exercise.course
|
|
|
|
|
|
|
|
|
|
default_ex_users = @exercise.all_exercise_users(current_user.id).exercise_user_committed
|
|
|
|
|
@ex_users = default_ex_users #仅导出已提交的,截止后则是全部为提交的。
|
|
|
|
|
@ex_users = default_ex_users.limit 1 #仅导出已提交的,截止后则是全部为提交的。
|
|
|
|
|
#可以分班选择
|
|
|
|
|
if group_id.present?
|
|
|
|
|
exercise_students = @course.students.where(course_group_id: group_id) # 试卷所分班的全部人数
|
|
|
|
|
user_ids = exercise_students.pluck(:user_id).reject(&:blank?).uniq
|
|
|
|
|
@ex_users = @ex_users.where(user_id: user_ids)
|
|
|
|
|
@ex_users = @ex_users.where(user_id: user_ids).limit 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
default_ex_users_size = @ex_users.size
|
|
|
|
|