dev_forum
SylorHuang 6 years ago
parent f6a5a0ebbc
commit e8e02abbbb

@ -127,7 +127,7 @@ class Exercise < ApplicationRecord
#判断是否为分班,如果分班,试卷的截止时间为当前分班时间,否则为试卷的截止时间
def get_exercise_status(user)
if course.end_time.present? && course.end_time <= Time.now
if course.end_date.present? && course.end_date <= Time.now
status = 4
else
if user.present? && user.student_of_course?(course) #当为学生的时候,需根据分班来判断试卷状态

@ -99,17 +99,15 @@ class Poll < ApplicationRecord
end
end
def get_poll_status(user)
if course.end_time.present? && course.end_time <= Time.now
def get_poll_status(user)s
if course.end_date.present? && course.end_date <= Time.now
status = 4
else
if user.present? && user.student_of_course?(course)
ex_time = get_poll_times(user_id,false)
pb_time = ex_time[:publish_time]
ed_time = ex_time[:end_time]
if course.end_time.present? && course.end_time <= Time.now
status = 4
elsif pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now
if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now
status = 2
elsif ed_time.present? && ed_time <= Time.now
status = 3

Loading…
Cancel
Save