|
|
|
@ -182,16 +182,16 @@
|
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
<div class="pbt5">
|
|
|
|
|
<% if q_type == 0 %>
|
|
|
|
|
<% q.exercise_choices.each do |s| %>
|
|
|
|
|
<% q.exercise_choices.each_with_index do |s,index| %>
|
|
|
|
|
<% check_answer = (user_answer.present? && (s.id == user_answer.first.exercise_choice_id)) ? "choose-answer" : '' %>
|
|
|
|
|
<div class="pbt10 clearfix 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>
|
|
|
|
|
<span class="inline-block pull-left ml10 choice-text mt-2"><%= to_markdown("#{(index+65).chr}.#{s.choice_text}",@request_url) %></span>
|
|
|
|
|
</div>
|
|
|
|
|
<% end %>
|
|
|
|
|
<div class="clearfix"></div>
|
|
|
|
|
<% elsif q_type == 1 %>
|
|
|
|
|
<% q.exercise_choices.each do |s| %>
|
|
|
|
|
<% q.exercise_choices.each_with_index do |s,index| %>
|
|
|
|
|
<% check_answer = (user_answer.present? && (user_answer.pluck(:exercise_choice_id).include?(s.id))) ? true : false %>
|
|
|
|
|
<div class="pbt10 clearfix main-choice">
|
|
|
|
|
<% if check_answer %>
|
|
|
|
@ -199,13 +199,13 @@
|
|
|
|
|
<% else %>
|
|
|
|
|
<span class="choose-checkbox pull-left mt10"></span>
|
|
|
|
|
<% end %>
|
|
|
|
|
<span class="inline-block pull-left choice-text ml10 mt-2"><%= to_markdown(s.choice_text,@request_url) %></span>
|
|
|
|
|
<span class="inline-block pull-left choice-text ml10 mt-2"><%= to_markdown("#{(index+65).chr}.#{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| %>
|
|
|
|
|
<% q.exercise_choices.each_with_index do |s,index| %>
|
|
|
|
|
<% if user_answer.present? && (s.id == user_answer.first.exercise_choice_id) %>
|
|
|
|
|
<% check_answer = 'choose-answer' %>
|
|
|
|
|
<% else %>
|
|
|
|
@ -213,7 +213,7 @@
|
|
|
|
|
<% end %>
|
|
|
|
|
<span class="mr15">
|
|
|
|
|
<span class="choose-radio <%= check_answer %>"></span>
|
|
|
|
|
<span class="mlr5"><%= s.choice_text %></span>
|
|
|
|
|
<span class="mlr5"><%= "#{(index+65).chr}.#{s.choice_text}" %></span>
|
|
|
|
|
</span>
|
|
|
|
|
<% end %>
|
|
|
|
|
</div>
|
|
|
|
|