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.
31 lines
1.0 KiB
31 lines
1.0 KiB
6 years ago
|
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
|
||
|
|