diff --git a/app/services/homeworks_service.rb b/app/services/homeworks_service.rb index 59bd5dad4..a21614efc 100644 --- a/app/services/homeworks_service.rb +++ b/app/services/homeworks_service.rb @@ -328,10 +328,13 @@ class HomeworksService work.late_penalty = work.work_status == 2 ? homework.late_penalty : 0 work.commit_time = myshixun.created_at > setting_time.publish_time ? setting_time.publish_time : myshixun.created_at work.myshixun_id = myshixun.id - work.update_time = if myshixun_endtime.present? - myshixun_endtime > homework_end_or_late_time ? homework_end_or_late_time : myshixun_endtime + work.update_time = if myshixun_endtime.present? && myshixun_endtime <= homework_end_or_late_time + myshixun_endtime + elsif myshixun.updated_at > homework_end_or_late_time + last_pass_time = games.select{|game| game.status == 2 && game.end_time < homework_end_or_late_time}.map(&:end_time).max + last_pass_time.present? ? last_pass_time : myshixun.created_at else - myshixun.updated_at > homework_end_or_late_time ? homework_end_or_late_time : myshixun.updated_at + myshixun.updated_at end work.final_score = final_score