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.
|
|
|
|
json.polls_counts do
|
|
|
|
|
json.polls_total_counts @polls_count #全部问卷数
|
|
|
|
|
json.polls_all_counts @polls_select_count #选择后的问卷数
|
|
|
|
|
json.polls_unpublish_counts @polls_unpublish_counts #未发布问卷数
|
|
|
|
|
json.polls_published_counts @polls_published_counts #已发布问卷数
|
|
|
|
|
# json.polls_ended_counts @polls_ended_counts #已截止问卷数
|
|
|
|
|
json.left_banner_id @left_banner_id
|
|
|
|
|
json.left_banner_name @left_banner_name
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
json.course_types do
|
|
|
|
|
json.course_status @course_status # 课堂的当前是否结束,如结束,则为1,否则为0
|
|
|
|
|
json.course_is_public @course_is_public #判断课堂是否为公开,只有公开课才有设为公开的按钮
|
|
|
|
|
json.user_permission @is_teacher_or # 当前用户存在且为课堂教师/管理员/超级管理员时为1 ,课堂成员为2,否则为0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if @polls_count > 0
|
|
|
|
|
json.polls do
|
|
|
|
|
json.array! @polls do |poll|
|
|
|
|
|
poll_index_array = poll_index_show(poll,@course,@is_teacher_or,@current_user_)
|
|
|
|
|
json.extract! poll, :id, :polls_name,:is_public,:created_at
|
|
|
|
|
json.polls_status poll_index_array[:polls_status]
|
|
|
|
|
json.lock_status poll_index_array[:lock_icon]
|
|
|
|
|
json.publish_time poll_index_array[:publish_time] # 问卷的发布时间
|
|
|
|
|
json.end_time poll_index_array[:end_time] # 问卷的截止时间
|
|
|
|
|
json.poll_answer poll_index_array[:poll_answer] # 已提交问卷的用户
|
|
|
|
|
json.poll_unanswer poll_index_array[:poll_unanswer] # 已查看问卷/开始答题,但是未提交问卷的用户
|
|
|
|
|
json.current_status poll_index_array[:current_status] #答题的状态
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
json.polls []
|
|
|
|
|
end
|
|
|
|
|
|