From 5c39b86f66863afb7b79016de18f6e44fec2c369 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 00:11:06 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9C=AA=E5=BC=80=E5=A7=8B=E7=9A=84?= =?UTF-8?q?=E7=AD=BE=E5=88=B0=E4=B9=9F=E5=8F=AF=E4=BB=A5=E6=88=AA=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/attendances_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index 7da852393..ea2688cc5 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -130,8 +130,14 @@ class Weapps::AttendancesController < ApplicationController def end a_end_time = "#{@attendance.attendance_date} #{@attendance.end_time}".to_time - tip_exception("该签到已截止") unless @attendance.current_attendance? - @attendance.update!(end_time: Time.current) + tip_exception("该签到已截止") if a_end_time < Time.now + + 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) + else + @attendance.update!(end_time: Time.current) + end render_ok end From d0b8a4e0fcd9a26ee857b7a7f34032fae9f35d9e Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 19:55:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/attendances_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/weapps/attendances_controller.rb b/app/controllers/weapps/attendances_controller.rb index ea2688cc5..6cc2dda4e 100644 --- a/app/controllers/weapps/attendances_controller.rb +++ b/app/controllers/weapps/attendances_controller.rb @@ -134,7 +134,7 @@ class Weapps::AttendancesController < ApplicationController 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.update!(end_time: Time.current, start_time: Time.current, attendance_date: Date.current) else @attendance.update!(end_time: Time.current) end From 5259846636527f3dd091509e8429eecfbedab290 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 10 Mar 2020 20:01:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=9C=E5=93=81=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E7=9A=84=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/export_helper.rb | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/helpers/export_helper.rb b/app/helpers/export_helper.rb index 64ad114bd..6d0ae2422 100644 --- a/app/helpers/export_helper.rb +++ b/app/helpers/export_helper.rb @@ -348,7 +348,7 @@ module ExportHelper normal_head_cells = %w(作品描述 教师评分 教辅评分) anon_boolean = homework.anonymous_comment if anon_boolean - head_cells_add = %w(匿名评分 缺评扣分 违规匿评申诉扣分) + head_cells_add = %w(匿名评分 已评数 缺评扣分 违规匿评申诉扣分) else head_cells_add = [] end @@ -395,36 +395,37 @@ module ExportHelper w_10 = w.teaching_asistant_score.nil? ? "未评分" : w.teaching_asistant_score.round(1) if anon_boolean 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 - w_13 = home_work_de.present? ? home_work_de.appeal_penalty : "--" #违规匿评申诉扣分 + w_14 = home_work_de.present? ? home_work_de.appeal_penalty : "--" #违规匿评申诉扣分 else - w_11,w_12,w_13 = nil + w_11,w_12,w_13,w_14 = nil end 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 - w_14 = nil + w_15 = nil end - w_15 = w.work_score.nil? ? "未评分" : w.work_score.round(1) - w_16 = w.commit_time ? format_time(w.commit_time) : "--" - w_17 = w.update_time ? format_time(w.update_time) : "--" + w_16 = w.work_score.nil? ? "未评分" : w.work_score.round(1) + w_17 = w.commit_time ? format_time(w.commit_time) : "--" + w_18 = w.update_time ? format_time(w.update_time) : "--" teacher_comments = w.student_works_scores if teacher_comments.present? - w_18 = "" + w_19 = "" teacher_comments.each do |t| user_name = t.user&.real_name user_time = format_time(t.updated_at) user_score = t&.score user_comment = t.comment.present? ? t.comment : "--" 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 else - w_18 = "--" + w_19 = "--" 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?) @work_cells_column.push(row_cells_column) end