json.course do json.partial! "polls/course_name",locals:{course:@course} end json.question_types do json.q_counts @poll_questions_count json.q_singles @poll_question_singles json.q_doubles @poll_question_doubles json.q_mains @poll_question_mains end if @poll_questions_count > 0 json.questions do json.array! @poll_questions do |question| json.partial! "polls/commit_answers_result", question: question, answers:question.poll_answers, question_votes:question.poll_votes #问题的全部答案 end end else json.questions [] end