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.
educoder/app/views/graduation_tasks/index.json.jbuilder

32 lines
1.0 KiB

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.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]
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