From d8c565959b157866388dbebbf897fe661d11608b Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 18 Dec 2019 09:58:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/homework_commons_helper.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/helpers/homework_commons_helper.rb b/app/helpers/homework_commons_helper.rb index 7327be2b6..ffc59dc94 100644 --- a/app/helpers/homework_commons_helper.rb +++ b/app/helpers/homework_commons_helper.rb @@ -28,6 +28,13 @@ module HomeworkCommonsHelper if ho_detail_manual # 作业状态大于“提交”状态时,不用考虑分班权限 if ho_detail_manual.comment_status > 1 + if homework_common.end_time && homework_common.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 + end + case ho_detail_manual.comment_status when 3 if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now @@ -42,12 +49,7 @@ module HomeworkCommonsHelper time_status = 4 end else - if homework_common.end_time && homework_common.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 + if status.blank? status << "已截止" time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : "" time_status = 5