From 0576924ab636945a1047e6ecfc2f0d8bd393495b Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 28 Jun 2019 14:49:42 +0800 Subject: [PATCH] fix bug --- app/helpers/exercises_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 3595b5866..a2a80c311 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -636,7 +636,7 @@ module ExercisesHelper exercise_answers = q.exercise_answers.search_exercise_answer("user_id",ex_answerer_id) #试卷用户的回答 end if student_status == 2 #当前为老师,或为学生且已提交 - user_score_pre = exercise_answers.score_reviewed.pluck(:score).sum + user_score_pre = exercise_answers.score_reviewed user_score = user_score_pre.present? ? user_score_pre.pluck(:score).sum : nil end