dev_forum
SylorHuang 6 years ago
parent 1c5b0155c3
commit c3087d7b4e

@ -350,6 +350,7 @@ module ApplicationHelper
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,options) markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,options)
m_t = markdown.render(text) m_t = markdown.render(text)
m_t&.include?("src=\"") ? m_t&.gsub("src=\"","src=\"#{request_url}") : m_t m_t&.include?("src=\"") ? m_t&.gsub("src=\"","src=\"#{request_url}") : m_t
Rails.logger.info("###########__________request_url_________###################{request_url}")
end end
end end

@ -79,16 +79,16 @@
<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 do |s| %>
<div class="pbt5 clearfix"> <div class="pbt5 clearfix main-choice">
<span class="choose-radio pull-left line-24 mt5"></span> <span class="choose-radio pull-left mt8"></span>
<span class="inline-block pull-left line-24 ml10"><%= to_markdown(s.choice_text) %></span> <span class="inline-block pull-left choice-text ml10"><%= to_markdown(s.choice_text) %></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 do |s| %>
<div class="pbt5 clearfix"> <div class="pbt5 clearfix main-choice">
<span class="choose-checkbox pull-left line-24 mt5"></span> <span class="choose-checkbox pull-left mt8"></span>
<span class="inline-block pull-left line-24 ml10"><%= to_markdown(s.choice_text) %></span> <span class="inline-block pull-left choice-text ml10"><%= to_markdown(s.choice_text) %></span>
</div> </div>
<% end %> <% end %>
<% elsif q.question_type == 2 %> <% elsif q.question_type == 2 %>

@ -257,7 +257,7 @@ table{
text-align:center; text-align:center;
} }
table, tr, td, th, tbody, thead, tfoot,textarea{ table, tr, td, th, tbody, thead, tfoot,textarea,.main-choice{
page-break-inside: avoid; page-break-inside: avoid;
} }
table th{ table th{
@ -318,10 +318,8 @@ textarea{
clear:both; clear:both;
zoom:1; zoom:1;
} }
.line-24{
line-height: 24px; .choice-text p{
}
.line-24 p{
margin-bottom:0; margin-bottom:0;
} }

@ -181,21 +181,21 @@
<% if q_type == 0 %> <% if q_type == 0 %>
<% q.exercise_choices.each do |s| %> <% q.exercise_choices.each do |s| %>
<% 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="pbt5 clearfix"> <div class="pbt5 clearfix main-choice">
<span class="choose-radio <%= check_answer %> pull-left line-24 mt5"></span> <span class="choose-radio <%= check_answer %> pull-left mt8"></span>
<span class="inline-block pull-left line-24 ml10"><%= to_markdown(s.choice_text) %></span> <span class="inline-block pull-left ml10 choice-text"><%= to_markdown(s.choice_text) %></span>
</div> </div>
<% end %> <% end %>
<% elsif q_type == 1 %> <% elsif q_type == 1 %>
<% q.exercise_choices.each do |s| %> <% q.exercise_choices.each do |s| %>
<% 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="pbt5 clearfix"> <div class="pbt5 clearfix main-choice">
<% if check_answer %> <% if check_answer %>
<span class="choose-checkbox choose-answer-multi pull-left line-24 mt5" ></span> <span class="choose-checkbox choose-answer-multi mt8" ></span>
<% else %> <% else %>
<span class="choose-checkbox pull-left line-24 mt5"></span> <span class="choose-checkbox pull-left mt8"></span>
<% end %> <% end %>
<span class="inline-block pull-left line-24 ml10"><%= to_markdown(s.choice_text) %></span> <span class="inline-block pull-left choice-text ml10"><%= to_markdown(s.choice_text) %></span>
</div> </div>
<% end %> <% end %>
<% elsif q_type == 2 %> <% elsif q_type == 2 %>

Loading…
Cancel
Save