|
|
@ -7,13 +7,13 @@ wb.styles do |s|
|
|
|
|
|
|
|
|
|
|
|
|
wb.add_worksheet(:name => "统计结果") do |sheet|
|
|
|
|
wb.add_worksheet(:name => "统计结果") do |sheet|
|
|
|
|
sheet.sheet_view.show_grid_lines = false
|
|
|
|
sheet.sheet_view.show_grid_lines = false
|
|
|
|
obj_commit = polls_user_commit[:obj_commit]
|
|
|
|
obj_commit = polls_user_commit[:obj_commit] || []
|
|
|
|
sub_commit = polls_user_commit[:sub_commit]
|
|
|
|
sub_commit = polls_user_commit[:sub_commit] || []
|
|
|
|
poll_user_info = polls_user_commit[:poll_users_info]
|
|
|
|
poll_user_info = polls_user_commit[:poll_users_info] || []
|
|
|
|
user_commit = polls_user_commit[:user_commit]
|
|
|
|
user_commit = polls_user_commit[:user_commit] || []
|
|
|
|
|
|
|
|
|
|
|
|
#客观题的导出
|
|
|
|
#客观题的导出
|
|
|
|
if obj_commit.size > 0
|
|
|
|
if obj_commit&.size > 0
|
|
|
|
obj_commit.each do |obj|
|
|
|
|
obj_commit.each do |obj|
|
|
|
|
sheet.add_row obj[:sheet_row], :height =>15,:style => blue_cell
|
|
|
|
sheet.add_row obj[:sheet_row], :height =>15,:style => blue_cell
|
|
|
|
sheet.add_row obj[:sheet_answer_row], :height =>15, :style => sz_all
|
|
|
|
sheet.add_row obj[:sheet_answer_row], :height =>15, :style => sz_all
|
|
|
@ -24,7 +24,7 @@ wb.styles do |s|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#主观题的导出
|
|
|
|
#主观题的导出
|
|
|
|
if sub_commit.size > 0
|
|
|
|
if sub_commit&.size > 0
|
|
|
|
sub_commit.each do |sub|
|
|
|
|
sub_commit.each do |sub|
|
|
|
|
main_sub_title = sub[:sub_tile]
|
|
|
|
main_sub_title = sub[:sub_tile]
|
|
|
|
main_sub_content = sub[:sub_user_votes]
|
|
|
|
main_sub_content = sub[:sub_user_votes]
|
|
|
@ -38,7 +38,7 @@ wb.styles do |s|
|
|
|
|
|
|
|
|
|
|
|
|
sheet.add_row poll_user_info, :height =>15, :style => blue_cell
|
|
|
|
sheet.add_row poll_user_info, :height =>15, :style => blue_cell
|
|
|
|
|
|
|
|
|
|
|
|
if user_commit.size > 0
|
|
|
|
if user_commit&.size > 0
|
|
|
|
user_commit.each do |com|
|
|
|
|
user_commit.each do |com|
|
|
|
|
sheet.add_row com, :height =>15,:style => sz_all
|
|
|
|
sheet.add_row com, :height =>15,:style => sz_all
|
|
|
|
end
|
|
|
|
end
|
|
|
|