dev_forum
SylorHuang 5 years ago
parent 91661cbee8
commit 03797ce1fa

@ -1173,7 +1173,7 @@ class ExercisesController < ApplicationController
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin begin
@current_user_id = current_user.id @current_user_id = current_user.id
@exercise = @exercise.includes(:exercise_questions) @exercise = @exercise
exercise_ids = [@exercise.id] exercise_ids = [@exercise.id]
@exercise_status = @exercise.get_exercise_status(current_user.id) @exercise_status = @exercise.get_exercise_status(current_user.id)
@course_all_members = @course.students @course_all_members = @course.students
@ -1297,7 +1297,7 @@ class ExercisesController < ApplicationController
if @user_course_identity > Course::ASSISTANT_PROFESSOR if @user_course_identity > Course::ASSISTANT_PROFESSOR
tip_exception(403,"无权限操作") tip_exception(403,"无权限操作")
else else
if @exercise_users_size.size > 0 if @exercise_users_size == 0
normal_status(-1,"暂无用户提交") normal_status(-1,"暂无用户提交")
else else
get_export_users(@exercise,@course,@export_ex_users) get_export_users(@exercise,@course,@export_ex_users)

@ -924,7 +924,7 @@ class PollsController < ApplicationController
# 全部页面,需返回 # 全部页面,需返回
# @poll_questions_count = @poll_questions.size # @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_users = @poll.poll_users
@poll_commit_ids = @poll_users.commit_by_status(1).pluck(:user_id) #问卷提交用户的id @poll_commit_ids = @poll_users.commit_by_status(1).pluck(:user_id) #问卷提交用户的id
@page = params[:page] || 1 @page = params[:page] || 1

@ -62,7 +62,7 @@ class ZipsController < ApplicationController
if default_ex_users_size == 0 if default_ex_users_size == 0
normal_status(-1,"导出失败,暂时没有已提交的学生") normal_status(-1,"导出失败,暂时没有已提交的学生")
elsif default_ex_users_size > 100 elsif default_ex_users_size > 100
normal_status(-1,"导出数量超过100,请分班导出或联系网站管理员导出") normal_status(-2,"100")
end end
end end
rescue Exception => e rescue Exception => e

Loading…
Cancel
Save