From 3eadedc9ad3ec611e67016d761870fe42f312f78 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Thu, 27 Jun 2019 14:11:38 +0800 Subject: [PATCH] fix bug --- app/services/exercise_user_pdf_service.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/services/exercise_user_pdf_service.rb b/app/services/exercise_user_pdf_service.rb index 663d8b042..d76e792c4 100644 --- a/app/services/exercise_user_pdf_service.rb +++ b/app/services/exercise_user_pdf_service.rb @@ -47,7 +47,7 @@ class ExerciseUserPdfService end def load_data - @exercise_questions = exercise.exercise_questions.joins(:exercise_choices,:exercise_shixun_challenges,:exercise_answers,:exercise_shixun_answers,:exercise_answer_comments) + @exercise_questions = exercise.exercise_questions @exercise_ques_count = @exercise_questions.count # 全部的题目数 @exercise_ques_scores = @exercise_questions.pluck(:question_score).sum @@ -80,8 +80,9 @@ class ExerciseUserPdfService exercise_ques_shixun = @exercise_questions.find_by_custom("question_type",5) @exercise_ques_shixun_count = exercise_ques_shixun.all.count @exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum + @exercise_questions = @exercise_questions.joins(:exercise_choices,:exercise_shixun_challenges,:exercise_answers,:exercise_shixun_answers,:exercise_answer_comments,:exercise_standard_answers) - challenge_ids = @exercise_questions.pluck("exercise_shixun_challenges.challenge_id") + # challenge_ids = @exercise_questions.pluck("exercise_shixun_challenges.challenge_id") get_each_student_exercise(exercise.id,@exercise_questions,@ex_user_user.id) # @games = @exercise_user.user.games.ch_games(challenge_ids)