|
|
|
@ -27,8 +27,9 @@ module HomeworkCommonsHelper
|
|
|
|
|
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 << "补交中"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
|
|
|
|
|
time_status = 2
|
|
|
|
|
else
|
|
|
|
|
ho_detail_manual = homework_common.homework_detail_manual
|
|
|
|
|
if ho_detail_manual
|
|
|
|
|
# 作业状态大于“提交”状态时,不用考虑分班权限
|
|
|
|
@ -57,13 +58,6 @@ module HomeworkCommonsHelper
|
|
|
|
|
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
|
|
|
|
|
time_status = 5
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 如果还在补交阶段则显示补交结束时间
|
|
|
|
|
if homework_common.end_time && homework_common.end_time < Time.now && homework_common.allow_late &&
|
|
|
|
|
homework_common.late_time && homework_common.late_time > Time.now
|
|
|
|
|
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
|
|
|
|
|
time_status = 2
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
# member = course.course_members.find_by(user_id: user.id, is_active: 1)
|
|
|
|
|
# teacher_course_groups = member.try(:teacher_course_groups)
|
|
|
|
@ -88,6 +82,7 @@ module HomeworkCommonsHelper
|
|
|
|
|
time_status = 2
|
|
|
|
|
else
|
|
|
|
|
status << "已截止"
|
|
|
|
|
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
|
|
|
|
|
time_status = 5
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -123,12 +118,9 @@ module HomeworkCommonsHelper
|
|
|
|
|
status << "提交中"
|
|
|
|
|
time = "提交剩余时间:" + how_much_time(max_end_time)
|
|
|
|
|
time_status = 1
|
|
|
|
|
elsif homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now)
|
|
|
|
|
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
|
|
|
|
|
time_status = 2
|
|
|
|
|
else
|
|
|
|
|
status << "已截止"
|
|
|
|
|
time = ""
|
|
|
|
|
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
|
|
|
|
|
time_status = 5
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -137,9 +129,11 @@ module HomeworkCommonsHelper
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# 如果作业状态都没有的话,在课堂结束前,都显示已截止
|
|
|
|
|
if status.blank?
|
|
|
|
|
status << "已截止"
|
|
|
|
|
time = course.end_date.present? ? ("评阅剩余时间:" + how_much_time(course.end_date.end_of_day)) : ""
|
|
|
|
|
time_status = 5
|
|
|
|
|
end
|
|
|
|
|
result[:status] = status
|
|
|
|
|