|
|
@ -30,19 +30,19 @@ wb.styles do |s|
|
|
|
|
sheet_answer_row.push(answer_users_count)
|
|
|
|
sheet_answer_row.push(answer_users_count)
|
|
|
|
sheet_answer_percent.push(answer_percent.to_s)
|
|
|
|
sheet_answer_percent.push(answer_percent.to_s)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
sheet.add_row sheet_row, :style => blue_cell
|
|
|
|
sheet.add_row sheet_row, :height =>20,:style => blue_cell
|
|
|
|
sheet.add_row sheet_answer_row, :style => sz_all
|
|
|
|
sheet.add_row sheet_answer_row, :height =>20, :style => sz_all
|
|
|
|
sheet.add_row sheet_answer_percent, :style => sz_all
|
|
|
|
sheet.add_row sheet_answer_percent, :height =>20, :style => sz_all
|
|
|
|
sheet.add_row sheet_answer_useful, :style => sz_all
|
|
|
|
sheet.add_row sheet_answer_useful, :height =>20, :style => sz_all
|
|
|
|
#合并单元格,但无法填充style
|
|
|
|
#合并单元格,但无法填充style
|
|
|
|
# sheet.merge_cells (Axlsx::cell_r(1,sheet.rows.last.row_index) + ':' + Axlsx::cell_r(sheet_row.count-1,sheet.rows.last.row_index))
|
|
|
|
# sheet.merge_cells (Axlsx::cell_r(1,sheet.rows.last.row_index) + ':' + Axlsx::cell_r(sheet_row.count-1,sheet.rows.last.row_index))
|
|
|
|
# sheet.rows[sheet.rows.last.row_index].style = sz_all
|
|
|
|
# sheet.rows[sheet.rows.last.row_index].style = sz_all
|
|
|
|
sheet.add_row []
|
|
|
|
sheet.add_row []
|
|
|
|
else #主观题答案
|
|
|
|
else #主观题答案
|
|
|
|
main_show_row = ["第#{q.question_number}题",q.question_title]
|
|
|
|
main_show_row = ["第#{q.question_number}题",q.question_title]
|
|
|
|
sheet.add_row main_show_row, :style => blue_cell
|
|
|
|
sheet.add_row main_show_row,:height =>20, :style => blue_cell
|
|
|
|
q.poll_votes.each do |v| #主观题的答案
|
|
|
|
q.poll_votes.each do |v| #主观题的答案
|
|
|
|
sheet.add_row ["",v.vote_text.present? ? v.vote_text : "--"], :style => sz_all
|
|
|
|
sheet.add_row ["",v.vote_text.present? ? v.vote_text : "--"],:height =>20, :style => sz_all
|
|
|
|
end
|
|
|
|
end
|
|
|
|
sheet.add_row [], :style => sz_all
|
|
|
|
sheet.add_row [], :style => sz_all
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -86,7 +86,7 @@ wb.styles do |s|
|
|
|
|
user_cell += [user_login,user_name, u_user.mail, user_student_id]
|
|
|
|
user_cell += [user_login,user_name, u_user.mail, user_student_id]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
all_user_cell = user_cell + user_answer_array
|
|
|
|
all_user_cell = user_cell + user_answer_array
|
|
|
|
sheet.add_row all_user_cell, :style => sz_all
|
|
|
|
sheet.add_row all_user_cell, :height =>20,:style => sz_all
|
|
|
|
end
|
|
|
|
end
|
|
|
|
sheet.column_widths *([25]*sheet.column_info.count)
|
|
|
|
sheet.column_widths *([25]*sheet.column_info.count)
|
|
|
|
sheet.column_info.first.width = 10
|
|
|
|
sheet.column_info.first.width = 10
|
|
|
|