解决参数为空的bug
This commit is contained in:
parent
7dc16775dc
commit
81e2827277
|
@ -449,11 +449,11 @@ class ExerciseController < ApplicationController
|
|||
# 问答题有多个答案
|
||||
if question.question_type == 3
|
||||
if standard_answer.exercise_choice_id.include?(answer.exercise_choice_id)
|
||||
score = score + question.question_score
|
||||
score += question.question_score unless question.question_score.empty?
|
||||
end
|
||||
else
|
||||
if answer.exercise_choice_id == standard_answer.exercise_choice_id
|
||||
score = score + question.question_score
|
||||
score += question.question_score unless question.question_score.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -65,7 +65,9 @@ module ExerciseHelper
|
|||
score = 0
|
||||
unless exercise.nil?
|
||||
exercise.exercise_questions.each do |exercise_question|
|
||||
score += exercise_question.question_score
|
||||
unless exercise_question.question_score.nil?
|
||||
score += exercise_question.question_score
|
||||
end
|
||||
end
|
||||
return score
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue