json.group_list do
  json.array! @course_groups do |course_group|
    json.id course_group.id
    json.name course_group.name
    json.works_count homework_works_count @homework, course_group
    json.last_review_time last_review_time @homework, course_group
  end
end
# 未分班展示情况放在最后
if (@course_groups.count != 0 && @course_groups.count < @limit.to_i) ||
    ((@page.to_i - 1)*@limit.to_i == @course_member_count && @course_groups.count == 0)
  ungroup_work_count = homework_ungroup_works_count(@homework, @ungroup_user_ids)
  if ungroup_work_count > 0
    json.ungroup_list do
      json.id 0
      json.name "未分班"
      json.work_count ungroup_work_count
      json.last_review_time ungroup_last_review_time @homework
    end
  end
end