From 56f0a9bfb017d1684850fd8052156fe57434315e Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Tue, 16 Jul 2019 14:39:20 +0800 Subject: [PATCH] fixbug --- app/controllers/exercises_controller.rb | 2 +- app/helpers/exercises_helper.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index c9aeba395..6b2804716 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1294,7 +1294,7 @@ class ExercisesController < ApplicationController def export_exercise @request_url = request.base_url @exercise_questions = @exercise.exercise_questions.includes(:exercise_choices).order("question_number ASC") - filename_ = "#{@exercise.user.real_name}_#{@course.name}__#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf" + filename_ = "#{@exercise.user.real_name}_#{@course.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf" stylesheets = "#{Rails.root}/app/templates/exercise_export/exercise_export.css" render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets end diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index b799fa40c..61baac4be 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -130,7 +130,7 @@ module ExercisesHelper # end user_ids.each do |user_id| - answer_choice_array = ExerciseChoice.where(id:effictive_users.map{|e| e.exercise_choice_id if a.user_id == user_id}).pluck(:choice_position).uniq + answer_choice_array = ExerciseChoice.where(id:effictive_users.map{|e| e.exercise_choice_id if e.user_id == user_id}).pluck(:choice_position).uniq if answer_choice_array.sort == standard_answer right_users_count += 1 end