diff --git a/app/models/exercise.rb b/app/models/exercise.rb index 61c5c8eab..825f7cd9f 100644 --- a/app/models/exercise.rb +++ b/app/models/exercise.rb @@ -127,7 +127,7 @@ class Exercise < ApplicationRecord #判断是否为分班,如果分班,试卷的截止时间为当前分班时间,否则为试卷的截止时间 def get_exercise_status(user) - if course.end_date.present? && course.end_date <= Time.now + if course.is_end status = 4 else if user.present? && user.student_of_course?(course) #当为学生的时候,需根据分班来判断试卷状态 @@ -145,7 +145,6 @@ class Exercise < ApplicationRecord status = exercise_status #当为老师的时候,则为试卷的总状态 end end - status end diff --git a/app/models/poll.rb b/app/models/poll.rb index 52b814bb3..7f0d2fd94 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -100,7 +100,7 @@ class Poll < ApplicationRecord end def get_poll_status(user) - if course.end_date.present? && course.end_date <= Time.now + if course.is_end status = 4 else if user.present? && user.student_of_course?(course)