dev_forum
SylorHuang 6 years ago
parent b679e1f0bf
commit 90a6f4d737

@ -21,8 +21,8 @@
<div class="ex-scores pd10 text-gray fs13">
<p class="clearfix">
<% if @exercise_single_ques_count > 0 %>
<span class="mr15">单选题<span class="mlr5"><%= @exercise_single_ques_count %></span>题,
共<span class="mlr5"><%= @exercise_single_ques_scores %></span>分</span>
<span class="mr15">单选题<span class="mlr5"><%= @exercise_single_ques_count %></span>题,
共<span class="mlr5"><%= @exercise_single_ques_scores %></span>分</span>
<% end %>
<% if @exercise_double_ques_count > 0 %>
<span class="mr15">多选题<span class="mlr5"><%= @exercise_double_ques_count %></span>题,
@ -55,6 +55,7 @@
</p>
</div>
</div>
<div class="clearfix"></div>
<div class="mbt10">
<% if @ex_obj_array.size > 0 %>
<div>
@ -176,15 +177,17 @@
<% end %>
</div>
</div>
<div class="clearfix"></div>
<div class="pbt5">
<% 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" : '' %>
<div class="pbt10 clearfix main-choice">
<div class="pbt10 main-choice">
<span class="choose-radio <%= check_answer %> pull-left mt10"></span>
<span class="inline-block pull-left ml10 choice-text mt-2"><%= to_markdown(s.choice_text,@request_url) %></span>
</div>
<% end %>
<div class="clearfix"></div>
<% 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 @@
<span class="inline-block pull-left choice-text ml10 mt-2"><%= to_markdown(s.choice_text,@request_url) %></span>
</div>
<% end %>
<div class="clearfix"></div>
<% elsif q_type == 2 %>
<div class="pbt5 clearfix">
<% q.exercise_choices.each do |s| %>
@ -211,6 +215,7 @@
</span>
<% end %>
</div>
<div class="clearfix"></div>
<% 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 @@
<span class="pull-left line-34">答案(填空<%= index+1 %></span>
<span class="null-answer pull-left"><%= to_markdown(check_answer,@request_url) %></span>
</div>
<div class="clearfix"></div>
<% end %>
<% elsif q_type == 4 %>
<% check_answer = (user_answer.present? ? user_answer.first.answer_text : '--') %>
<div class="flex-nowrap clearfix">
<div class="flex-nowrap">
<div class="null-answer main-height">
<%= to_markdown(check_answer,@request_url) %>
</div>
</div>
<div class="clearfix"></div>
<% else %>
<div class="mbt10">
<p class="text-gray mbt10">
@ -327,6 +334,7 @@
</div>
<% end %>
</div>
<div class="clearfix"></div>
<% end %>
</div>
</div>

Loading…
Cancel
Save