|
|
json.course do
|
|
|
json.partial! "polls/course_name",locals:{course:@course}
|
|
|
end
|
|
|
json.poll_types do
|
|
|
if @poll_current_user_status == 0
|
|
|
json.published_count @poll_publish_count
|
|
|
json.unpublish_count @poll_unpublish_count
|
|
|
json.un_anonymous @poll.un_anonymous
|
|
|
json.unified_setting @poll.unified_setting
|
|
|
end
|
|
|
json.poll_users_count @poll_users_count
|
|
|
json.total_users @poll_users_size
|
|
|
json.answer_users @poll_answers
|
|
|
json.unanswer_users @poll_unanswers
|
|
|
json.user_permission @poll_current_user_status #当前用户存在且为课堂教师/管理员/超级管理员时为0 ,其他否则为1
|
|
|
json.poll_id @poll.id
|
|
|
json.poll_end_time @poll.end_time
|
|
|
json.groups_count @poll_group_counts
|
|
|
end
|
|
|
|
|
|
if @poll_current_user_status == 0
|
|
|
if @poll_course_groups.present?
|
|
|
json.course_groups do
|
|
|
json.array! @poll_course_groups do |group|
|
|
|
json.course_group_id group[:course_id] #班级id
|
|
|
json.group_group_name group[:course_name] #班级名称
|
|
|
json.count group[:student_count] #班级人数
|
|
|
end
|
|
|
end
|
|
|
else
|
|
|
json.course_groups []
|
|
|
end
|
|
|
# json.course_groups course_group_info @course, @current_user.id
|
|
|
end
|
|
|
|
|
|
if @poll_users_size > 0
|
|
|
json.poll_users do
|
|
|
json.array! @poll_users_list do |poll_user|
|
|
|
user_details = poll_user_info(poll_user,@course_all_members,@course)
|
|
|
json.user_id user_details[:user_id]
|
|
|
json.login user_details[:login]
|
|
|
json.user_name user_details[:user_name]
|
|
|
json.user_group_id user_details[:group_id]
|
|
|
json.user_group_name user_details[:group_name]
|
|
|
json.student_id user_details[:student_id]
|
|
|
json.commit_status poll_user.commit_status
|
|
|
json.end_at poll_user.end_at
|
|
|
end
|
|
|
end
|
|
|
else
|
|
|
json.poll_users []
|
|
|
end
|