Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_course
cxt 5 years ago
commit c74f36f35d

@ -511,7 +511,7 @@ module ExercisesHelper
exercise_user_id = ex_user_user.id exercise_user_id = ex_user_user.id
ex_user_exercise_status = exercise.get_exercise_status(ex_user_user) ex_user_exercise_status = exercise.get_exercise_status(ex_user_user)
ex_user_student_id = ex_user_user.student_id 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 #继续答题 commit_status = 2 #继续答题
else else
commit_status = ex_user.commit_status commit_status = ex_user.commit_status

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

Loading…
Cancel
Save