dev_course
SylorHuang 5 years ago
parent bf9796c8b5
commit 281a49a8b0

@ -511,7 +511,7 @@ module ExercisesHelper
exercise_user_id = ex_user_user.id
ex_user_exercise_status = exercise.get_exercise_status(ex_user_user)
ex_user_student_id = ex_user_user.student_id
if ex_user.start_at.present? && ex_user.commit_status == 0 #用户已回答,但未提交
if ex_user.start_at.present? && (ex_user.commit_status == 0) #用户已回答,但未提交
commit_status = 2 #继续答题
else
commit_status = ex_user.commit_status

@ -142,7 +142,7 @@ class Exercise < ApplicationRecord
user_ex_status = get_exercise_status(user)
user_status = 2
if ex_answer_user.exists? && (ex_answer_user.first&.start_at.present? || ex_answer_user.first&.end_at.present?) #学生有过答题的,或者立即截止,但学生未做试卷的
user_status = ex_answer_user.commit_status
user_status = ex_answer_user.first.commit_status
end
if ex_answer_user.exists? && ex_answer_user.first&.start_at.blank? && user_ex_status == 3
user_status = 4

@ -122,7 +122,7 @@ class Poll < ApplicationRecord
poll_answer_user = poll_users.where(user_id: user.id).select(:start_at,:end_at,:commit_status)
user_status = 2
if poll_answer_user.exists? && (poll_answer_user.first&.start_at.present? || poll_answer_user.first&.end_at.present?) #学生有过答题的,或者立即截止,但学生未做试卷的
user_status = poll_answer_user.commit_status
user_status = poll_answer_user.first.commit_status
end
user_status
end

Loading…
Cancel
Save