From b31ba3e5c7318549f4f113570a7300b292d961fc Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 29 Feb 2020 15:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=8A=B6=E6=80=81=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_commons_helper.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb index ffbc61b53..534abea6f 100644 --- a/app/helpers/homework_commons_helper.rb +++ b/app/helpers/homework_commons_helper.rb @@ -117,9 +117,16 @@ module HomeworkCommonsHelper time = "提交剩余时间:" + how_much_time(max_end_time) time_status = 1 else - status << "已截止" - time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : "" - time_status = 5 + if max_end_time.present? && max_end_time < Time.now && homework_common.allow_late && + (homework_common.late_time.nil? || homework_common.late_time > Time.now) + status << "补交中" + time = "补交剩余时间:" + how_much_time(homework_common.late_time) + time_status = 2 + else + status << "已截止" + time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : "" + time_status = 5 + end end end end