dev_forum
SylorHuang 5 years ago
parent 857f2dcb3e
commit 2b2257b181

@ -186,7 +186,7 @@ class HomeworkCommonsController < ApplicationController
end end
@work_count = @student_works.size @work_count = @student_works.size
@work_excel = @student_works @work_excel = @student_works.includes(:student_works_scores)
@students = @course.students @students = @course.students
# 分页参数 # 分页参数
@ -207,6 +207,7 @@ class HomeworkCommonsController < ApplicationController
tip_exception(403, "无权限操作") tip_exception(403, "无权限操作")
else else
if @work_excel.present? if @work_excel.present?
@homework = @homework.includes()
student_work_to_xlsx(@work_excel,@homework) student_work_to_xlsx(@work_excel,@homework)
exercise_export_name = current_user.real_name + "_" + @course.name + "_" + @homework.name + "_" + Time.now.strftime('%Y%m%d_%H%M%S') exercise_export_name = current_user.real_name + "_" + @course.name + "_" + @homework.name + "_" + Time.now.strftime('%Y%m%d_%H%M%S')

@ -1005,11 +1005,6 @@ class PollsController < ApplicationController
if @poll_users_list.present? && @poll_users_list.count > 0 if @poll_users_list.present? && @poll_users_list.count > 0
if order == "student_id"
@poll_users_list = @poll_users_list.joins(user: [:user_extension]).order("user_extensions.student_id DESC")
else
@poll_users_list = @poll_users_list.order("end_at DESC")
end
#答题状态的选择 #答题状态的选择
if choose_type.present? if choose_type.present?
@ -1028,6 +1023,12 @@ class PollsController < ApplicationController
@poll_users_list = @poll_users_list.joins(user: :user_extension).where("CONCAT(lastname, firstname) like ? OR student_id like ?", "%#{search_content}%", "%#{search_content}%") @poll_users_list = @poll_users_list.joins(user: :user_extension).where("CONCAT(lastname, firstname) like ? OR student_id like ?", "%#{search_content}%", "%#{search_content}%")
end end
if order == "student_id"
@poll_users_list = @poll_users_list.joins(user: :user_extension).order("user_extensions.student_id DESC")
else
@poll_users_list = @poll_users_list.order("end_at DESC")
end
logger.info("#######F_______@poll_users_list_last___@users_ids________________####{@poll_users_list.pluck(:user_id)}") logger.info("#######F_______@poll_users_list_last___@users_ids________________####{@poll_users_list.pluck(:user_id)}")
@poll_users_size = @poll_users_list.count @poll_users_size = @poll_users_list.count

Loading…
Cancel
Save