diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 18b8fbb2f..b3cf1f0be 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1173,7 +1173,7 @@ class ExercisesController < ApplicationController ActiveRecord::Base.transaction do begin @current_user_id = current_user.id - @exercise = @exercise.includes(:exercise_questions) + @exercise = @exercise exercise_ids = [@exercise.id] @exercise_status = @exercise.get_exercise_status(current_user.id) @course_all_members = @course.students @@ -1297,7 +1297,7 @@ class ExercisesController < ApplicationController if @user_course_identity > Course::ASSISTANT_PROFESSOR tip_exception(403,"无权限操作") else - if @exercise_users_size.size > 0 + if @exercise_users_size == 0 normal_status(-1,"暂无用户提交") else get_export_users(@exercise,@course,@export_ex_users) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 151a2a098..eb03345e7 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -924,7 +924,7 @@ class PollsController < ApplicationController # 全部页面,需返回 # @poll_questions_count = @poll_questions.size # 分页 - @poll = @poll.includes(:poll_users,user: :user_extension,) + # @poll = @poll.includes(:poll_users,user: :user_extension) @poll_users = @poll.poll_users @poll_commit_ids = @poll_users.commit_by_status(1).pluck(:user_id) #问卷提交用户的id @page = params[:page] || 1 diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index c20546701..a70d4c332 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -62,7 +62,7 @@ class ZipsController < ApplicationController if default_ex_users_size == 0 normal_status(-1,"导出失败,暂时没有已提交的学生") elsif default_ex_users_size > 100 - normal_status(-1,"导出数量超过100,请分班导出或联系网站管理员导出") + normal_status(-2,"100") end end rescue Exception => e