|
|
|
@ -128,7 +128,7 @@ module ExportHelper
|
|
|
|
|
shixun_time_cells << "第#{i}关评语"
|
|
|
|
|
end
|
|
|
|
|
@work_head_cells = (head_cells_format + shixun_head_cells + eff_score_cell + shixun_time_cells).reject(&:blank?)
|
|
|
|
|
works.includes(:student_works_scores, user: :user_extension, myshixun: :games).each_with_index do |w, index|
|
|
|
|
|
works.includes(:shixun_work_comments, :student_works_scores, user: :user_extension, myshixun: :games).each_with_index do |w, index|
|
|
|
|
|
myshixun = w.try(:myshixun)
|
|
|
|
|
w_user = w.user
|
|
|
|
|
w_1 = (index + 1)
|
|
|
|
@ -168,7 +168,7 @@ module ExportHelper
|
|
|
|
|
w_16 = w.update_time ? format_time(w.update_time) : "--" "更新时间"
|
|
|
|
|
myshixun_complete = myshixun && myshixun.status == 1
|
|
|
|
|
w_17 = myshixun_complete && w.cost_time ? (game_spend_time w.cost_time) : "未完成"
|
|
|
|
|
teacher_comment = w.shixun_work_comments.find_by(challenge_id: 0)
|
|
|
|
|
teacher_comment = w.shixun_work_comments.select{|comment| comment.challenge_id == 0}.first
|
|
|
|
|
if teacher_comment.present?
|
|
|
|
|
w_18 = "学生可见:\n #{teacher_comment.comment.to_s} \n\n 老师可见:\n#{teacher_comment.hidden_comment.to_s}"
|
|
|
|
|
else
|
|
|
|
@ -178,8 +178,8 @@ module ExportHelper
|
|
|
|
|
|
|
|
|
|
# 关卡评语
|
|
|
|
|
shixun.challenges.pluck(:id) do |challenge_id|
|
|
|
|
|
challenge_comment = w.shixun_work_comments.find_by(challenge_id: challenge_id)
|
|
|
|
|
row_cells_column << "学生可见:\n #{challenge_comment.comment.to_s} \n\n 老师可见:\n#{challenge_comment.hidden_comment.to_s}"
|
|
|
|
|
challenge_comment = w.shixun_work_comments.select{|comment| comment.challenge_id == challenge_id}.first
|
|
|
|
|
row_cells_column << challenge_comment ? "学生可见:\n #{challenge_comment.comment.to_s} \n\n 老师可见:\n#{challenge_comment.hidden_comment.to_s}" : "--"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
row_cells_column = row_cells_column.reject(&:blank?)
|
|
|
|
|