You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
964 B
29 lines
964 B
|
|
json.course do
|
|
json.partial! "polls/course_name",locals:{course:@course}
|
|
end
|
|
json.poll do
|
|
json.extract! @poll,:id,:polls_name,:polls_description,:end_time
|
|
json.user_poll_status @user_poll_status #当前用户的状态
|
|
json.left_banner_id @left_banner_id
|
|
json.left_banner_name @left_banner_name
|
|
json.poll_status @poll_status
|
|
end
|
|
|
|
json.question_answered @answer_status
|
|
|
|
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
|
|
json.user_name @answer_user.real_name
|
|
end
|
|
|
|
json.questions do
|
|
json.array! @poll_questions do | question|
|
|
json.partial! "poll_votes/poll_votes",question: question, #问题
|
|
answers:question.poll_answers, #问题的答案选项
|
|
votes:@answer_user.poll_votes.find_current_vote("poll_question_id",question.id) #问题的答案
|
|
end
|
|
end |