json.course_identity @identity
json.course_public @course.is_public == 1
json.is_end @course.is_end

json.tasks @tasks.each do |task|
  # task_private = @identity > Course::STUDENT && !task.is_public
  json.task_id task.id
  json.name task.name
  json.private_icon !task.is_public
  json.task_status task.status    #6.12 -hs
  task_curr_status = task_curr_status(task, @course)
  json.status task_curr_status[:status]
  json.status_time task_curr_status[:time]
  json.author task.user.real_name

  unless task_curr_status[:status].include?("未发布")
    json.commit_count grduationwork_count task, 1
    json.uncommit_count grduationwork_count task, 0
  end

  if @identity == Course::STUDENT
    work = task.user_work(@member.user_id)
    json.work_status graduation_work_status(task, @member.user_id, @course)
    json.work_id work.try(:id)
    json.un_commit_work !work.present? || work.work_status == 0
  end
end

json.all_count @all_count
json.published_count @published_count
json.unpublished_count @all_count - @published_count
json.task_count @task_count
