|
|
|
@ -4,12 +4,17 @@ json.courses @courses do |course|
|
|
|
|
|
json.created_at course.created_at
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
json.stages @subject.stages do |stage|
|
|
|
|
|
json.stages @subject.stages.includes(shixuns: [user: :user_extension]) do |stage|
|
|
|
|
|
index = 1
|
|
|
|
|
json.shixuns stage.shixuns do |shixun|
|
|
|
|
|
if shixun.status == 2 && !@none_shixun_ids.include?(shixun.id)
|
|
|
|
|
if shixun.status == 2 && !shixun.is_jupyter && !@none_shixun_ids.include?(shixun.id)
|
|
|
|
|
json.shixun_id shixun.id
|
|
|
|
|
json.shixun_name "#{stage.position}-#{index} #{shixun.name}"
|
|
|
|
|
json.title shixun.name
|
|
|
|
|
json.level level_to_s(shixun.trainee)
|
|
|
|
|
json.study_count shixun.myshixuns_count
|
|
|
|
|
json.author_name shixun.user.real_name
|
|
|
|
|
json.author_img url_to_avatar(shixun.user)
|
|
|
|
|
end
|
|
|
|
|
index += 1
|
|
|
|
|
end
|
|
|
|
|