From 1632aadee024192b42b75ceb80950113fad3aa00 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Sat, 1 Jun 2019 09:36:30 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/exercise/_statistics_result_table.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/exercise/_statistics_result_table.html.erb b/app/views/exercise/_statistics_result_table.html.erb
index 964def05..1a07a5c9 100755
--- a/app/views/exercise/_statistics_result_table.html.erb
+++ b/app/views/exercise/_statistics_result_table.html.erb
@@ -1,8 +1,8 @@
-<% @exercise_questions.each do |exercise_question| %>
+<% @exercise_questions.each_with_index do |exercise_question, index| %>
- 第<%= exercise_question.question_number %>题:[<%= exercise_question.question_type_name %>]
+ 第<%= index + 1 %>题:[<%= exercise_question.question_type_name %>]
正确率:<%= question_correct_rate exercise_question, @user_ids %>%
From b13aeaed6f40884947d881d9214936210c7725f2 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Sat, 1 Jun 2019 10:12:56 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/zip_service.rb | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/app/services/zip_service.rb b/app/services/zip_service.rb
index 8be197f4..402017ee 100755
--- a/app/services/zip_service.rb
+++ b/app/services/zip_service.rb
@@ -53,8 +53,8 @@ module ZipService
exercise_users.each_with_index do |exercise_user, index|
member = members.where(:user_id => exercise_user.user_id).first
group_name = member.try(:course_group_id).to_i == 0 ? '未分班' : member.course_group.name
- # export_file_name = "#{group_name}-#{exercise.course_id}-#{exercise.exercise_name}-#{exercise_user.user.user_extensions.student_id}-#{exercise_user.user.show_real_name}" + ".pdf"
- export_file_name = "#{exercise.id}-#{exercise_user.user.user_extensions.student_id}-#{index}" + ".pdf"
+ export_file_name = "#{group_name}-#{exercise.course_id}-#{exercise.exercise_name}-#{exercise_user.user.user_extensions.student_id}-#{exercise_user.user.show_real_name}" + ".pdf"
+ # export_file_name = "#{exercise.id}-#{exercise_user.user.user_extensions.student_id}-#{index}" + ".pdf"
out_file = export_user_exercise(exercise, exercise_user, export_file_name)
file_name = File::expand_path(out_file)
@@ -190,10 +190,9 @@ module ZipService
# file_name = "#{exercise.course_id}-#{exercise.exercise_name}-#{exercise_user.user.user_extensions.student_id}-#{exercise_user.user.show_real_name}" + ".pdf"
# file_name = "#{Time.now.strftime("%Y%m%d%H%M%S").to_s}-#{exercise.course_id}-#{exercise.id}-#{exercise_user.user.user_extensions.student_id}" + ".pdf"
file_name.gsub!(" ", "-")
- Rails.logger.info("###################file_name: #{file_name}")
+ file_name.gsub!("/", "-")
kit.to_file("#{OUTPUT_FOLDER}/#{file_name}")
out_file = "#{OUTPUT_FOLDER}/#{file_name}"
- Rails.logger.info("#################out_file_file_name: #{out_file}")
out_file
end