|
|
|
@ -630,14 +630,16 @@ module ExercisesHelper
|
|
|
|
|
user_score = nil
|
|
|
|
|
shixun_type = 0
|
|
|
|
|
question_comment = []
|
|
|
|
|
if q.question_type == 5
|
|
|
|
|
if ques_type == 5
|
|
|
|
|
exercise_answers = q.exercise_shixun_answers.search_shixun_answers("user_id",ex_answerer_id)
|
|
|
|
|
else
|
|
|
|
|
exercise_answers = q.exercise_answers.search_exercise_answer("user_id",ex_answerer_id) #试卷用户的回答
|
|
|
|
|
end
|
|
|
|
|
if student_status == 2 #当前为老师,或为学生且已提交
|
|
|
|
|
user_score = exercise_answers.score_reviewed.pluck(:score).sum
|
|
|
|
|
user_score_pre = exercise_answers.score_reviewed.pluck(:score).sum
|
|
|
|
|
user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if user_score.present? && (user_score > q.question_score)
|
|
|
|
|
user_score = q.question_score
|
|
|
|
|
end
|
|
|
|
@ -667,7 +669,7 @@ module ExercisesHelper
|
|
|
|
|
question_comment = q.exercise_answer_comments.search_answer_comments("exercise_answer_id",q_answer_id)
|
|
|
|
|
end
|
|
|
|
|
{
|
|
|
|
|
"user_score": user_score.present? ? user_score.round(1) : nil,
|
|
|
|
|
"user_score": (user_score.present? ? user_score.round(1).to_s : nil),
|
|
|
|
|
"answered_content":answered_content,
|
|
|
|
|
"shixun_type":shixun_type,
|
|
|
|
|
"question_comment":question_comment
|
|
|
|
|