试卷pdf导出的样式修改

dev_forum
SylorHuang 5 years ago
parent 493e07e455
commit c3d545bc57

@ -81,25 +81,25 @@
</div> </div>
<div class="pbt5"> <div class="pbt5">
<% if q.question_type == 0 %> <% if q.question_type == 0 %>
<% q.exercise_choices.each do |s| %> <% q.exercise_choices.each_with_index do |s,index| %>
<div class="pbt5 clearfix main-choice"> <div class="pbt5 clearfix main-choice">
<span class="choose-radio pull-left mt8"></span> <span class="choose-radio pull-left mt8"></span>
<span class="inline-block pull-left choice-text ml10"><%= to_markdown(s.choice_text,@request_url) %></span> <span class="inline-block pull-left choice-text ml10"><%= to_markdown("#{(index+65).chr}.#{s.choice_text}",@request_url) %></span>
</div> </div>
<% end %> <% end %>
<% elsif q.question_type == 1 %> <% elsif q.question_type == 1 %>
<% q.exercise_choices.each do |s| %> <% q.exercise_choices.each_with_index do |s,index| %>
<div class="pbt5 clearfix main-choice"> <div class="pbt5 clearfix main-choice">
<span class="choose-checkbox pull-left mt8"></span> <span class="choose-checkbox pull-left mt8"></span>
<span class="inline-block pull-left choice-text ml10"><%= to_markdown(s.choice_text,@request_url) %></span> <span class="inline-block pull-left choice-text ml10"><%= to_markdown("#{(index+65).chr}.#{s.choice_text}",@request_url) %></span>
</div> </div>
<% end %> <% end %>
<% elsif q.question_type == 2 %> <% elsif q.question_type == 2 %>
<div class="pbt5 clearfix"> <div class="pbt5 clearfix">
<% q.exercise_choices.each do |s| %> <% q.exercise_choices.each_with_index do |s,index| %>
<span class="mr15"> <span class="mr15">
<span class="choose-radio "></span> <span class="choose-radio "></span>
<span class="mlr5 inline-block"><%= s.choice_text %></span> <span class="mlr5 inline-block"><%= "#{(index+65).chr}.#{s.choice_text}" %></span>
</span> </span>
<% end %> <% end %>
</div> </div>

@ -182,16 +182,16 @@
<div class="clearfix"></div> <div class="clearfix"></div>
<div class="pbt5"> <div class="pbt5">
<% if q_type == 0 %> <% 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" : '' %> <% check_answer = (user_answer.present? && (s.id == user_answer.first.exercise_choice_id)) ? "choose-answer" : '' %>
<div class="pbt10 clearfix main-choice"> <div class="pbt10 clearfix main-choice">
<span class="choose-radio <%= check_answer %> pull-left mt10"></span> <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> </div>
<% end %> <% end %>
<div class="clearfix"></div> <div class="clearfix"></div>
<% elsif q_type == 1 %> <% 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 %> <% check_answer = (user_answer.present? && (user_answer.pluck(:exercise_choice_id).include?(s.id))) ? true : false %>
<div class="pbt10 clearfix main-choice"> <div class="pbt10 clearfix main-choice">
<% if check_answer %> <% if check_answer %>
@ -199,13 +199,13 @@
<% else %> <% else %>
<span class="choose-checkbox pull-left mt10"></span> <span class="choose-checkbox pull-left mt10"></span>
<% end %> <% 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> </div>
<% end %> <% end %>
<div class="clearfix"></div> <div class="clearfix"></div>
<% elsif q_type == 2 %> <% elsif q_type == 2 %>
<div class="pbt5 clearfix"> <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) %> <% if user_answer.present? && (s.id == user_answer.first.exercise_choice_id) %>
<% check_answer = 'choose-answer' %> <% check_answer = 'choose-answer' %>
<% else %> <% else %>
@ -213,7 +213,7 @@
<% end %> <% end %>
<span class="mr15"> <span class="mr15">
<span class="choose-radio <%= check_answer %>"></span> <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> </span>
<% end %> <% end %>
</div> </div>

Loading…
Cancel
Save