diff --git a/app/templates/exercise_export/exercise_user.html.erb b/app/templates/exercise_export/exercise_user.html.erb index 70c023d26..3a651f89d 100644 --- a/app/templates/exercise_export/exercise_user.html.erb +++ b/app/templates/exercise_export/exercise_user.html.erb @@ -249,8 +249,8 @@ <% if @games.size > 0 %> <% @games.each_with_index do |game, index| %> - <% user_score = q.exercise_shixun_answers.where(exercise_shixun_challenge_id:game.challenge.id,user_id: @ex_user_user.id) %> <% game_score = q.exercise_shixun_challenges.where(challenge_id:game.challenge.id) %> + <% user_score = q.exercise_shixun_answers.where(exercise_shixun_challenge_id: game_score&.id,user_id: @ex_user_user.id) %> <%= index + 1 %>