From c6e1fd3f8d0cb2ffd2078582e1eb00a19f1af684 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 29 Jun 2019 17:26:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=95=E5=8D=B7=E7=9A=84?= =?UTF-8?q?=E7=AD=94=E9=A2=98=E8=AF=95=E5=8D=B7=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zips_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index 710846f64..4de85ec64 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -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