diff --git a/app/helpers/polls_helper.rb b/app/helpers/polls_helper.rb index f6dc3fc89..52e90f559 100644 --- a/app/helpers/polls_helper.rb +++ b/app/helpers/polls_helper.rb @@ -3,12 +3,12 @@ module PollsHelper #获取试卷的已答/未答人数 def get_poll_answers(poll_users, status) if status == 1 + @poll_answers = 0 + @poll_unanswers = 0 + else @poll_answers = poll_users.commit_by_status(1).size #表示已经提交了的用户 course_all_members_count = poll_users.size @poll_unanswers = (course_all_members_count - @poll_answers) - else - @poll_answers = 0 - @poll_unanswers = 0 end end