试卷的填空题显示问题

competitions
SylorHuang 5 years ago
parent 13b4340daf
commit 78a869e05b

@ -39,6 +39,11 @@ module ExercisesHelper
else
ques_score = 0.0
end
elsif q_type == Exercise::COMPLETION
ques_score = answers_content.select{|answer| answer.score >= 0.0}.pluck(:score).sum
if ques_score.to_s.split(".").last == "9"
ques_score = ques_score.to_f + 0.1
end
else
ques_score = answers_content.select{|answer| answer.score >= 0.0}.pluck(:score).sum
end

Loading…
Cancel
Save