|
|
|
@ -467,7 +467,7 @@ class ExerciseController < ApplicationController
|
|
|
|
|
standard_answer = get_user_standard_answer(question, user)
|
|
|
|
|
# 问答题有多个答案
|
|
|
|
|
if question.question_type == 3
|
|
|
|
|
if standard_answer.exercise_choice_id.include?(answer.exercise_choice_id)
|
|
|
|
|
if standard_answer.include?(answer.exercise_choice_id)
|
|
|
|
|
score += question.question_score unless question.question_score.empty?
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
@ -510,7 +510,14 @@ class ExerciseController < ApplicationController
|
|
|
|
|
|
|
|
|
|
# 获取问题的标准答案
|
|
|
|
|
def get_user_standard_answer(question,user)
|
|
|
|
|
standard_answer = question.exercise_standard_answers
|
|
|
|
|
if question.question_type == 3
|
|
|
|
|
standard_answer =[]
|
|
|
|
|
question.exercise_standard_answers.each do |answer|
|
|
|
|
|
standard_answer << answer.answer_text
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
standard_answer = question.exercise_standard_answers
|
|
|
|
|
end
|
|
|
|
|
standard_answer
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|