dev_forum
SylorHuang 6 years ago
parent 939a536d3a
commit 3587b33a81

@ -13,7 +13,8 @@ module ExercisesHelper
ques_score = q.exercise_answers.search_answer_users("user_id",user_id).score_reviewed.pluck(:score).sum ques_score = q.exercise_answers.search_answer_users("user_id",user_id).score_reviewed.pluck(:score).sum
end end
if ques_score == q.question_score #满分作答为正确 if ques_score >= q.question_score #满分作答为正确
ques_score = q.question_score
stand_answer = 1 stand_answer = 1
elsif ques_score > 0.0 #部分作答 elsif ques_score > 0.0 #部分作答
stand_answer = 2 stand_answer = 2
@ -35,7 +36,8 @@ module ExercisesHelper
exercise_sub_status.each do |s| exercise_sub_status.each do |s|
sub_answer = s.exercise_answers.search_answer_users("user_id",user_id) #主观题只有一个回答 sub_answer = s.exercise_answers.search_answer_users("user_id",user_id) #主观题只有一个回答
if sub_answer.present? && sub_answer.first.score >= 0.0 if sub_answer.present? && sub_answer.first.score >= 0.0
if s.question_score == sub_answer.first.score
if s.question_score <= sub_answer.first.score
stand_status = 1 stand_status = 1
else else
stand_status = 2 stand_status = 2

Loading…
Cancel
Save