|
|
|
@ -23,24 +23,12 @@ module HomeworkCommonsHelper
|
|
|
|
|
status << "已结束"
|
|
|
|
|
time = course.end_date.strftime("%Y-%m-%d")
|
|
|
|
|
time_status = 6
|
|
|
|
|
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
|
|
|
|
|
ho_detail_manual = homework_common.homework_detail_manual
|
|
|
|
|
if ho_detail_manual
|
|
|
|
|
# 作业状态大于“提交”状态时,不用考虑分班权限
|
|
|
|
|
if ho_detail_manual.comment_status > 1
|
|
|
|
|
case ho_detail_manual.comment_status
|
|
|
|
|
when 2
|
|
|
|
|
unless homework_common.allow_late
|
|
|
|
|
status << "已截止"
|
|
|
|
|
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
|
|
|
|
|
time_status = 5
|
|
|
|
|
end
|
|
|
|
|
when 3
|
|
|
|
|
if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now
|
|
|
|
|
status << "匿评中"
|
|
|
|
@ -53,11 +41,18 @@ module HomeworkCommonsHelper
|
|
|
|
|
time = "申诉剩余时间:" + how_much_time(ho_detail_manual.appeal_time)
|
|
|
|
|
time_status = 4
|
|
|
|
|
end
|
|
|
|
|
when 5, 6
|
|
|
|
|
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
|
|
|
|
|
status << "已截止"
|
|
|
|
|
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
|
|
|
|
|
time_status = 5
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
# member = course.course_members.find_by(user_id: user.id, is_active: 1)
|
|
|
|
|
# teacher_course_groups = member.try(:teacher_course_groups)
|
|
|
|
@ -129,7 +124,6 @@ module HomeworkCommonsHelper
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# 如果作业状态都没有的话,在课堂结束前,都显示已截止
|
|
|
|
|
if status.blank?
|
|
|
|
|
status << "已截止"
|
|
|
|
|