json.course_identity @identity json.course_public @course.is_public == 1 json.is_end @course.is_end json.all_count @all_count json.published_count @published_count json.unpublished_count @all_count - @published_count json.task_count @task_count 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_private json.task_status task.status #6.12 -hs json.status task_curr_status(task, @course)[:status] json.status_time task_curr_status(task, @course)[:time] unless task_curr_status(task, @course)[: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