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/subjects/statistics.json.jbuilder

20 lines
601 B

6 years ago
json.subject_id @subject.id
json.subject_name @subject.name
json.learn_count @learn_count
json.course_count @course_count
json.schools_count @schools_count
json.school_total_count @school_total_count
json.schools @schools.try(:each) do |school|
json.name school[:name]
json.course_count school[:course_count]
json.student_count school[:student_count]
json.homework_count school[:homework_count]
end
index = 0
json.stage_info @stage_user_info.each do |stage|
json.stage_no "第#{index + 1}章"
json.value @sum == 0 ? 0 : (stage * 100 / @sum.to_f).round
index += 1
end