|
|
|
@ -305,14 +305,21 @@ class HomeworksService
|
|
|
|
|
|
|
|
|
|
myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil
|
|
|
|
|
|
|
|
|
|
if work.work_status == 0
|
|
|
|
|
is_complete = myshixun_endtime && (myshixun_endtime < setting_time.end_time)
|
|
|
|
|
if is_complete || (myshixun.created_at < setting_time.end_time && (!homework.allow_late || setting_time.end_time >= Time.now))
|
|
|
|
|
|
|
|
|
|
# if work.work_status == 0
|
|
|
|
|
# if is_complete || (myshixun.created_at < setting_time.end_time && (!homework.allow_late || setting_time.end_time >= Time.now))
|
|
|
|
|
# work.work_status = 1
|
|
|
|
|
# elsif homework.allow_late && myshixun.created_at < homework.late_time
|
|
|
|
|
# work.work_status = 2
|
|
|
|
|
# end
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
if !homework.allow_late || is_complete
|
|
|
|
|
work.work_status = 1
|
|
|
|
|
elsif homework.allow_late && myshixun.created_at < homework.late_time
|
|
|
|
|
elsif myshixun.created_at < homework.late_time
|
|
|
|
|
work.work_status = 2
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if work.work_status != 0
|
|
|
|
|
if myshixun_endtime.present?
|
|
|
|
|