|
|
|
@ -22,21 +22,21 @@ module ExportHelper
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
shixun_homeworks = shixun_homeworks&.includes(score_student_works: :user)
|
|
|
|
|
shixun_homeworks = shixun_homeworks&.includes(:score_student_works)
|
|
|
|
|
|
|
|
|
|
common_homeworks = homeworks.search_homework_type(1) #全部普通作业
|
|
|
|
|
common_titles = common_homeworks.pluck(:name)+ ["总得分"]
|
|
|
|
|
common_homeworks = common_homeworks&.includes(score_student_works: :user)
|
|
|
|
|
common_homeworks = common_homeworks&.includes(:score_student_works)
|
|
|
|
|
|
|
|
|
|
group_homeworks = homeworks.search_homework_type(3) #全部分组作业
|
|
|
|
|
group_titles = group_homeworks.pluck(:name)+ ["总得分"]
|
|
|
|
|
group_homeworks = group_homeworks&.includes(score_student_works: :user)
|
|
|
|
|
group_homeworks = group_homeworks&.includes(:score_student_works)
|
|
|
|
|
|
|
|
|
|
task_titles = tasks.pluck(:name) + ["总得分"]
|
|
|
|
|
tasks = tasks&.includes(user: :user_extension, score_graduation_works: :user)
|
|
|
|
|
tasks = tasks&.includes(:score_graduation_works)
|
|
|
|
|
|
|
|
|
|
exercise_titles = exercises.pluck(:exercise_name) + ["总得分"]
|
|
|
|
|
exercises = exercises&.includes(user: :user_extension, score_exercise_users: :user)
|
|
|
|
|
exercises = exercises&.includes(:score_exercise_users)
|
|
|
|
|
|
|
|
|
|
total_user_score_array = [] #学生总成绩集合
|
|
|
|
|
|
|
|
|
@ -163,9 +163,12 @@ module ExportHelper
|
|
|
|
|
count_2 = common_homeworks.size
|
|
|
|
|
count_3 = group_homeworks.size
|
|
|
|
|
count_4 = tasks.size
|
|
|
|
|
|
|
|
|
|
all_user_ids = all_members.pluck(:user_id)
|
|
|
|
|
|
|
|
|
|
#实训作业
|
|
|
|
|
shixun_homeworks.each_with_index do |s,index|
|
|
|
|
|
all_student_works = s.score_student_works #该实训题的全部用户回答
|
|
|
|
|
all_student_works = s.score_student_works.where(user_id: all_user_ids) #该实训题的全部用户回答
|
|
|
|
|
title_no = index.to_i + 1
|
|
|
|
|
student_work_to_xlsx(all_student_works,s)
|
|
|
|
|
shixun_work_display_name = format_sheet_name (title_no.to_s + "." + s.name).strip.first(30)
|
|
|
|
@ -175,7 +178,7 @@ module ExportHelper
|
|
|
|
|
|
|
|
|
|
#普通作业
|
|
|
|
|
common_homeworks.each_with_index do |c,index|
|
|
|
|
|
all_student_works = c.score_student_works #当前用户的对该作业的回答
|
|
|
|
|
all_student_works = c.score_student_works.where(user_id: all_user_ids) #当前用户的对该作业的回答
|
|
|
|
|
title_no = count_1 + index.to_i + 1
|
|
|
|
|
student_work_to_xlsx(all_student_works,c)
|
|
|
|
|
|
|
|
|
@ -187,7 +190,7 @@ module ExportHelper
|
|
|
|
|
|
|
|
|
|
#分组作业
|
|
|
|
|
group_homeworks.each_with_index do |c,index|
|
|
|
|
|
all_student_works = c.score_student_works #当前用户的对该作业的回答
|
|
|
|
|
all_student_works = c.score_student_works.where(user_id: all_user_ids) #当前用户的对该作业的回答
|
|
|
|
|
title_no = count_1 + count_2 + index.to_i + 1
|
|
|
|
|
student_work_to_xlsx(all_student_works,c)
|
|
|
|
|
work_name = format_sheet_name (title_no.to_s + "." + c.name).strip.first(30)
|
|
|
|
@ -197,7 +200,7 @@ module ExportHelper
|
|
|
|
|
|
|
|
|
|
#毕设任务
|
|
|
|
|
tasks.each_with_index do |c,index|
|
|
|
|
|
all_student_works = c.score_graduation_works #当前用户的对该作业的回答
|
|
|
|
|
all_student_works = c.score_graduation_works.where(user_id: all_user_ids) #当前用户的对该作业的回答
|
|
|
|
|
title_no = count_1 + count_2 + count_3 + index.to_i + 1
|
|
|
|
|
graduation_work_to_xlsx(all_student_works,c,current_user)
|
|
|
|
|
work_name = format_sheet_name (title_no.to_s + "." + c.name).strip.first(30)
|
|
|
|
@ -207,7 +210,7 @@ module ExportHelper
|
|
|
|
|
|
|
|
|
|
#试卷的导出
|
|
|
|
|
exercises.each_with_index do |c,index|
|
|
|
|
|
all_student_works = c.score_exercise_users #当前用户的对该作业的回答
|
|
|
|
|
all_student_works = c.score_exercise_users.where(user_id: all_user_ids) #当前用户的对该作业的回答
|
|
|
|
|
title_no = count_1 + count_2 + count_3 + count_4 + index.to_i + 1
|
|
|
|
|
get_export_users(c,course,all_student_works)
|
|
|
|
|
work_name = format_sheet_name (title_no.to_s + "." + c.exercise_name).strip.first(30)
|
|
|
|
|