diff --git a/app/templates/exercise_export/exercise_user.html.erb b/app/templates/exercise_export/exercise_user.html.erb index d79379596..e43af2fb9 100644 --- a/app/templates/exercise_export/exercise_user.html.erb +++ b/app/templates/exercise_export/exercise_user.html.erb @@ -21,8 +21,8 @@

<% if @exercise_single_ques_count > 0 %> - 单选题<%= @exercise_single_ques_count %>题, - 共<%= @exercise_single_ques_scores %> + 单选题<%= @exercise_single_ques_count %>题, + 共<%= @exercise_single_ques_scores %> <% end %> <% if @exercise_double_ques_count > 0 %> 多选题<%= @exercise_double_ques_count %>题, @@ -55,6 +55,7 @@

+
<% if @ex_obj_array.size > 0 %>
@@ -176,15 +177,17 @@ <% end %>
+
<% if q_type == 0 %> <% q.exercise_choices.each do |s| %> <% check_answer = (user_answer.present? && (s.id == user_answer.first.exercise_choice_id)) ? "choose-answer" : '' %> -
+
<%= to_markdown(s.choice_text,@request_url) %>
<% end %> +
<% elsif q_type == 1 %> <% q.exercise_choices.each do |s| %> <% check_answer = (user_answer.present? && (user_answer.pluck(:exercise_choice_id).include?(s.id))) ? true : false %> @@ -197,6 +200,7 @@ <%= to_markdown(s.choice_text,@request_url) %>
<% end %> +
<% elsif q_type == 2 %>
<% q.exercise_choices.each do |s| %> @@ -211,6 +215,7 @@ <% end %>
+
<% elsif q_type == 3 %> <% st_counts = q.exercise_standard_answers.pluck(:exercise_choice_id).uniq %> <% st_counts.each_with_index do |s,index| %> @@ -223,14 +228,16 @@ 答案(填空<%= index+1 %>): <%= to_markdown(check_answer,@request_url) %>
+
<% end %> <% elsif q_type == 4 %> <% check_answer = (user_answer.present? ? user_answer.first.answer_text : '--') %> -
+
<%= to_markdown(check_answer,@request_url) %>
+
<% else %>

@@ -327,6 +334,7 @@

<% end %>
+
<% end %>