educoder/app/views/homework_commons/show.json.jbuilder

26 lines
939 B

json.partial! "homework_public_navigation", locals: {homework: @homework, course: @course, user: @user}
json.partial! "homework_btn_check", locals: {identity: @user_course_identity, homework: @homework, user: @user}
json.partial! "student_btn_check", locals: {identity: @user_course_identity, homework: @homework, work: @work}
json.description @homework.description
# 实训作业才有说明
if @homework.homework_type == "practice"
json.explanation @homework.explanation
end
# 附件
json.attachments @attachments do |attachment|
json.partial! "attachments/attachment_simple", locals: {attachment: attachment}
end
# 分组要求
if @homework.homework_type == "group"
json.group_info do
json.max_num @homework.homework_detail_group.try(:max_num)
json.min_num @homework.homework_detail_group.try(:min_num)
json.base_on_project @homework.homework_detail_group.try(:base_on_project)
end
end