|
|
|
@ -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
|
|
|
|
|
|
|
|
|
|