From 4303995003e44804998bb1fe1d05a6b8c1d8a225 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 18 Jul 2019 15:33:47 +0800 Subject: [PATCH] fixbug --- app/models/exercise.rb | 3 +-- app/models/poll.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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)