Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

courseware
caicai8 5 years ago
commit 798e78de6c

@ -130,8 +130,14 @@ class Weapps::AttendancesController < ApplicationController
def end def end
a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time
tip_exception("该签到已截止") unless @attendance.current_attendance? tip_exception("该签到已截止") if a_end_time < Time.now
@attendance.update!(end_time: Time.current)
a_start_time = "#{@attendance.attendance_date} #{@attendance.start_time}".to_time
if a_start_time > Time.now
@attendance.update!(end_time: Time.current, start_time: Time.current, attendance_date: Date.current)
else
@attendance.update!(end_time: Time.current)
end
render_ok render_ok
end end

@ -348,7 +348,7 @@ module ExportHelper
normal_head_cells = %w(作品描述 教师评分 教辅评分) normal_head_cells = %w(作品描述 教师评分 教辅评分)
anon_boolean = homework.anonymous_comment anon_boolean = homework.anonymous_comment
if anon_boolean if anon_boolean
head_cells_add = %w(匿名评分 缺评扣分 违规匿评申诉扣分) head_cells_add = %w(匿名评分 已评数 缺评扣分 违规匿评申诉扣分)
else else
head_cells_add = [] head_cells_add = []
end end
@ -395,36 +395,37 @@ module ExportHelper
w_10 = w.teaching_asistant_score.nil? ? "未评分" : w.teaching_asistant_score.round(1) w_10 = w.teaching_asistant_score.nil? ? "未评分" : w.teaching_asistant_score.round(1)
if anon_boolean if anon_boolean
w_11 = w.student_score.nil? ? "未评分" : w.student_score.round(1) w_11 = w.student_score.nil? ? "未评分" : w.student_score.round(1)
w_12 = (homework.teacher_priority == 1 && !w.teacher_score.nil?) ? 0 : w.absence_penalty #缺评扣分 w_12 = w.user_comment_num
w_13 = (homework.teacher_priority == 1 && !w.teacher_score.nil?) ? 0 : w.absence_penalty #缺评扣分
home_work_de = homework.homework_detail_manual home_work_de = homework.homework_detail_manual
w_13 = home_work_de.present? ? home_work_de.appeal_penalty : "--" #违规匿评申诉扣分 w_14 = home_work_de.present? ? home_work_de.appeal_penalty : "--" #违规匿评申诉扣分
else else
w_11,w_12,w_13 = nil w_11,w_12,w_13,w_14 = nil
end end
if allow_late_boolean #允许迟交 if allow_late_boolean #允许迟交
w_14 = (homework.teacher_priority == 1 && !w.teacher_score.nil?) ? 0 : w.late_penalty #迟交扣分 w_15 = (homework.teacher_priority == 1 && !w.teacher_score.nil?) ? 0 : w.late_penalty #迟交扣分
else else
w_14 = nil w_15 = nil
end end
w_15 = w.work_score.nil? ? "未评分" : w.work_score.round(1) w_16 = w.work_score.nil? ? "未评分" : w.work_score.round(1)
w_16 = w.commit_time ? format_time(w.commit_time) : "--" w_17 = w.commit_time ? format_time(w.commit_time) : "--"
w_17 = w.update_time ? format_time(w.update_time) : "--" w_18 = w.update_time ? format_time(w.update_time) : "--"
teacher_comments = w.student_works_scores teacher_comments = w.student_works_scores
if teacher_comments.present? if teacher_comments.present?
w_18 = "" w_19 = ""
teacher_comments.each do |t| teacher_comments.each do |t|
user_name = t.user&.real_name user_name = t.user&.real_name
user_time = format_time(t.updated_at) user_time = format_time(t.updated_at)
user_score = t&.score user_score = t&.score
user_comment = t.comment.present? ? t.comment : "--" user_comment = t.comment.present? ? t.comment : "--"
comment_title = "#{user_name} #{user_time.to_s} #{user_score.to_s}\n#{user_comment}\n\n" comment_title = "#{user_name} #{user_time.to_s} #{user_score.to_s}\n#{user_comment}\n\n"
w_18 = w_18 + comment_title w_19 = w_19 + comment_title
end end
else else
w_18 = "--" w_19 = "--"
end end
row_cells_column = [w_1,w_2,w_3,w_3_1,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,w_14,w_15,w_16,w_17,w_18] row_cells_column = [w_1,w_2,w_3,w_3_1,w_4,w_5,w_6,w_7,w_8,w_9,w_10,w_11,w_12,w_13,w_14,w_15,w_16,w_17,w_18,w_19]
row_cells_column = row_cells_column.reject(&:blank?) row_cells_column = row_cells_column.reject(&:blank?)
@work_cells_column.push(row_cells_column) @work_cells_column.push(row_cells_column)
end end

Loading…
Cancel
Save