|
|
|
@ -90,7 +90,7 @@ class PollsController < ApplicationController
|
|
|
|
|
@limit = params[:limit] || 15
|
|
|
|
|
|
|
|
|
|
@polls = @polls.page(@page).per(@limit)
|
|
|
|
|
@polls = @polls.includes(:poll_users,:poll_questions,:poll_group_settings)
|
|
|
|
|
@polls = @polls&.includes(:poll_users,:poll_questions,:poll_group_settings)
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
@polls = []
|
|
|
|
@ -183,7 +183,7 @@ class PollsController < ApplicationController
|
|
|
|
|
else
|
|
|
|
|
@is_teacher_or = 0
|
|
|
|
|
end
|
|
|
|
|
@poll_questions = @poll.poll_questions.order("question_number ASC")
|
|
|
|
|
@poll_questions = @poll.poll_questions&.includes(:poll_answers).order("question_number ASC")
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
uid_logger_error(e.message)
|
|
|
|
|
tip_exception("没有权限")
|
|
|
|
@ -1148,7 +1148,7 @@ class PollsController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def get_questions_count
|
|
|
|
|
@poll_questions = @poll.poll_questions.order("question_number ASC")
|
|
|
|
|
@poll_questions = @poll.poll_questions&.includes(:poll_answers,:poll_votes).order("question_number ASC")
|
|
|
|
|
@poll_questions_count = @poll_questions.count # 全部的题目数
|
|
|
|
|
@poll_question_singles = @poll_questions.ques_count(1).all.count # 单选题
|
|
|
|
|
@poll_question_doubles = @poll_questions.ques_count(2).all.count # 多选题
|
|
|
|
|