From 08a4a0d89ba71bf0ebbf045fd7bf695466470036 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Mon, 1 Jul 2019 15:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=9A=84=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E5=AF=BC=E5=87=BAhtml=E5=92=8Ccss=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zips_controller.rb | 4 ++-- app/templates/exercise_export/exercise_user.html.erb | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index c20546701..51761d023 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -49,12 +49,12 @@ class ZipsController < ApplicationController @course = @exercise.course default_ex_users = @exercise.all_exercise_users(current_user.id).exercise_user_committed - @ex_users = default_ex_users #仅导出已提交的,截止后则是全部为提交的。 + @ex_users = default_ex_users.limit 2 #仅导出已提交的,截止后则是全部为提交的。 #可以分班选择 if group_id.present? exercise_students = @course.students.where(course_group_id: group_id) # 试卷所分班的全部人数 user_ids = exercise_students.pluck(:user_id).reject(&:blank?).uniq - @ex_users = @ex_users.where(user_id: user_ids) + @ex_users = @ex_users.where(user_id: user_ids).limit 2 end default_ex_users_size = @ex_users.size diff --git a/app/templates/exercise_export/exercise_user.html.erb b/app/templates/exercise_export/exercise_user.html.erb index 1e3d88a44..62d2132ce 100644 --- a/app/templates/exercise_export/exercise_user.html.erb +++ b/app/templates/exercise_export/exercise_user.html.erb @@ -220,10 +220,10 @@ <% else %> <% check_answer = "--" %> <% end %> -

- 答案(填空<%= index+1 %>): - <%= to_markdown(check_answer,@request_url) %> -

+
+
答案(填空<%= index+1 %>):
+
<%= to_markdown(check_answer,@request_url) %>
+
<% end %> <% elsif q_type == 4 %> <% check_answer = (user_answer.present? ? user_answer.first.answer_text : '--') %>