课堂选用实训

dev_video
cxt 5 years ago
parent 74992bcc2b
commit 8636f2d2e8

@ -4,12 +4,17 @@ json.courses @courses do |course|
json.created_at course.created_at json.created_at course.created_at
end end
json.stages @subject.stages do |stage| json.stages @subject.stages.includes(shixuns: [user: :user_extension]) do |stage|
index = 1 index = 1
json.shixuns stage.shixuns do |shixun| 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_id shixun.id
json.shixun_name "#{stage.position}-#{index} #{shixun.name}" 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 end
index += 1 index += 1
end end

@ -4,7 +4,6 @@ json.shixun_list @results do |obj|
json.level level_to_s(obj.trainee) json.level level_to_s(obj.trainee)
json.study_count obj.myshixuns_count json.study_count obj.myshixuns_count
json.author_name obj.user.real_name json.author_name obj.user.real_name
json.author_school_name obj.user.school_name
json.author_img url_to_avatar(obj.user) json.author_img url_to_avatar(obj.user)
end end
json.shixuns_count @total_count json.shixuns_count @total_count
Loading…
Cancel
Save