|
|
|
@ -65,19 +65,20 @@ class Admins::ShixunSettingsController < Admins::BaseController
|
|
|
|
|
sheet1.row(0).default_format = blue
|
|
|
|
|
sheet1.row(0).concat(["实训ID","实训名称","技术平台", "Fork源", "实践任务","选择题任务","挑战人数", "通关人数", "状态","创建者", "单位", "职业", "关卡序号","关卡名称","技能标签"])
|
|
|
|
|
count_row = 1
|
|
|
|
|
shixuns.find_each do |shixun|
|
|
|
|
|
shixuns.includes(:fork_shixuns, :myshixuns, :mirror_repositories, challenges: [:challenge_tags], user: [user_extension: :school]).find_each do |shixun|
|
|
|
|
|
sheet1[count_row, 0] = shixun.identifier
|
|
|
|
|
sheet1[count_row, 1] = shixun.name
|
|
|
|
|
sheet1[count_row, 2] = shixun.shixun_main_name
|
|
|
|
|
sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name
|
|
|
|
|
|
|
|
|
|
sheet1[count_row, 3] = shixun.fork_identifier
|
|
|
|
|
sheet1[count_row, 4] = shixun.challenges.practice_type.count
|
|
|
|
|
sheet1[count_row, 5] = shixun.challenges.choose_type.count
|
|
|
|
|
sheet1[count_row, 6] = shixun.myshixuns.count
|
|
|
|
|
sheet1[count_row, 7] = shixun.myshixuns.finished.count
|
|
|
|
|
sheet1[count_row, 4] = shixun.challenges.select{|c| c.st == 0}.size
|
|
|
|
|
sheet1[count_row, 5] = shixun.challenges.select{|c| c.st == 1}.size
|
|
|
|
|
sheet1[count_row, 6] = shixun.myshixuns_count
|
|
|
|
|
sheet1[count_row, 7] = shixun.myshixuns.select{|m| m.status == 1}.size
|
|
|
|
|
sheet1[count_row, 8] = shixun.shixun_status
|
|
|
|
|
sheet1[count_row, 9] = shixun.owner.show_real_name
|
|
|
|
|
sheet1[count_row, 10] = shixun.owner.school_name
|
|
|
|
|
sheet1[count_row, 11] = shixun.owner.identity
|
|
|
|
|
sheet1[count_row, 9] = shixun.user.show_real_name
|
|
|
|
|
sheet1[count_row, 10] = shixun.user.school_name
|
|
|
|
|
sheet1[count_row, 11] = shixun.user.identity
|
|
|
|
|
shixun.challenges.each do |challenge|
|
|
|
|
|
sheet1[count_row, 12] = "第#{challenge.position}关"
|
|
|
|
|
sheet1[count_row, 13] = challenge.subject
|
|
|
|
|