超级管理员的课堂列表Excel导出功能也增加 课堂学生的“评测次数”统计数据

dev_ec
daiao 6 years ago
parent d648ecb8ed
commit 3d959e025a

@ -4208,7 +4208,7 @@ end
sheet1 = book.create_worksheet :name => "course"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat(["ID","课堂名称","成员","资源","普通作业"," 实训作业","试卷","私有","状态","创建者单位","创建者","动态时间","创建时间"])
sheet1.row(0).concat(["ID","课堂名称","成员","资源","普通作业"," 实训作业","试卷","评测次数", "私有","状态","创建者单位","创建者","动态时间","创建时间"])
count_row = 1
courses.each do |course|
school = course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.school_name
@ -4220,6 +4220,7 @@ end
sheet1[count_row,4] = course.homework_commons.where(:homework_type => 1).count
sheet1[count_row,5] = course.homework_commons.where(:homework_type => 4).count
sheet1[count_row,6] = course.exercises.count
sheet1[count_row,6] = course.evaluate_count
sheet1[count_row,7] = course.is_public.to_i == 1 ? '否' : '是'
sheet1[count_row,8] = course.is_end ? "已结束" : "正在进行"
sheet1[count_row,9] = school

Loading…
Cancel
Save