<%= q.question_number %>、
@@ -68,45 +67,39 @@
(<%= q&.question_score %>分)
-
-
- <% q_markdown = to_markdown(q.question_title) %>
<% if q.question_type == 5 %>
- <% q_markdown_name = to_markdown(q.shixun_name) %>
-
<%= q_markdown_name %>
+
<%= to_markdown(q.shixun_name) %>
- <%= q_markdown %>
+ <%= to_markdown(q.question_title) %>
<% else %>
-
<%= q_markdown %>
+
<%= to_markdown(q.question_title) %>
<% end %>
<% if q.question_type == 0 %>
- <% q.exercise_choices.each_with_index do |s,index| %>
-
-
- <%= convert_to_char((index+1).to_s)%>
- <%= to_markdown(s.choice_text) %>
-
+ <% q.exercise_choices.each do |s| %>
+
+
+ <%= to_markdown(s.choice_text) %>
+
<% end %>
<% elsif q.question_type == 1 %>
- <% q.exercise_choices.each_with_index do |s,index| %>
-
-
- <%= convert_to_char((index+1).to_s)%>
- <%= to_markdown(s.choice_text) %>
-
+ <% q.exercise_choices.each do |s| %>
+
+
+ <%= to_markdown(s.choice_text) %>
+
<% end %>
<% elsif q.question_type == 2 %>
-
- <% q.exercise_choices.each_with_index do |s,index| %>
-
-
- <%= to_markdown(s.choice_text) %>
+
+ <% q.exercise_choices.each do |s| %>
+
+
+ <%= s.choice_text %>
<% end %>
-
+
<% elsif q.question_type == 3 %>
<% st_counts = q.exercise_standard_answers.pluck(:exercise_choice_id).uniq %>
<% st_counts.each_with_index do |s,index| %>
diff --git a/app/templates/exercise_export/exercise_export.css b/app/templates/exercise_export/exercise_export.css
index 9190e9251..a72b26782 100644
--- a/app/templates/exercise_export/exercise_export.css
+++ b/app/templates/exercise_export/exercise_export.css
@@ -44,6 +44,9 @@ p{
.mbt10{
margin: 10px 0;
}
+.mt5{
+ margin-top:5px;
+}
.pull-right{
float:right;
}
@@ -82,9 +85,15 @@ p{
.ml20{
margin-left:20px;
}
+.ml10{
+ margin-left:10px;
+}
.mr3{
margin-right:3px;
}
+.mr8{
+ margin-right:8px;
+}
.mr15{
margin-right:15px;
}
@@ -309,6 +318,13 @@ textarea{
clear:both;
zoom:1;
}
+.line-24{
+ line-height: 24px;
+}
+.line-24 p{
+ margin-bottom:0;
+}
+
diff --git a/app/templates/exercise_export/exercise_user.html.erb b/app/templates/exercise_export/exercise_user.html.erb
index 5770c5921..1679692b3 100644
--- a/app/templates/exercise_export/exercise_user.html.erb
+++ b/app/templates/exercise_export/exercise_user.html.erb
@@ -167,41 +167,39 @@
<% end %>
- <% q_title = q.question_title&.html_safe %>
- <% if q_type == 5 %>
- <% q_name = q.shixun_name&.html_safe %>
-
<%= q_name&.include?("src=\"") ? q_name&.gsub("src=\"","src=\"#{@request_url}") : q_name %>
+ <% if q.question_type == 5 %>
+
<%= to_markdown(q.shixun_name) %>
- <%= q_title&.include?("src=\"") ? q_title&.gsub("src=\"","src=\"#{@request_url}") : q_title %>
+ <%= to_markdown(q.question_title) %>
<% else %>
-
<%= q_title&.include?("src=\"") ? q_title&.gsub("src=\"","src=\"#{@request_url}") : q_title %>
+
<%= to_markdown(q.question_title) %>
<% end %>
<% if q_type == 0 %>
- <% q.exercise_choices.each_with_index do |s,index| %>
+ <% q.exercise_choices.each do |s| %>
<% check_answer = (user_answer.present? && (s.id == user_answer.first.exercise_choice_id)) ? "choose-answer" : '' %>
-
-
- <%= convert_to_char((index+1).to_s)%><%= s.choice_text%>
-
+
+
+ <%= to_markdown(s.choice_text) %>
+
<% end %>
<% elsif q_type == 1 %>
- <% q.exercise_choices.each_with_index do |s,index| %>
+ <% q.exercise_choices.each do |s| %>
<% check_answer = (user_answer.present? && (user_answer.pluck(:exercise_choice_id).include?(s.id))) ? true : false %>
-
+
<% if check_answer %>
-
+
<% else %>
-
+
<% end %>
- <%= convert_to_char((index+1).to_s)%><%= s.choice_text%>
-
+ <%= to_markdown(s.choice_text) %>
+
<% end %>
<% elsif q_type == 2 %>
-
+
<% q.exercise_choices.each do |s| %>
<% if user_answer.present? && (s.id == user_answer.first.exercise_choice_id) %>
<% check_answer = 'choose-answer' %>
@@ -213,7 +211,7 @@
<%= s.choice_text %>
<% end %>
-
+
<% elsif q_type == 3 %>
<% st_counts = q.exercise_standard_answers.pluck(:exercise_choice_id).uniq %>
<% st_counts.each_with_index do |s,index| %>
@@ -224,13 +222,13 @@
<% end %>
答案(填空<%= index+1 %>):
- <%= check_answer&.html_safe %>
+ <%= to_markdown(check_answer) %>
<% end %>
<% elsif q_type == 4 %>
<% check_answer = (user_answer.present? ? user_answer.first.answer_text : '--') %>
- <%= check_answer&.html_safe %>
+ <%= to_markdown(check_answer) %>
<% else %>