dev_forum
SylorHuang 6 years ago
parent e365005af1
commit 81950469b4

@ -80,15 +80,15 @@
<% if q.question_type == 0 %>
<% q.exercise_choices.each do |s| %>
<div class="pbt5 clearfix">
<span class="choose-radio pull-left line-24"></span>
<span class="inline-block pull-left line-24"><%= to_markdown(s.choice_text) %></span>
<span class="choose-radio pull-left line-24 mt5"></span>
<span class="inline-block pull-left line-24 ml10"><%= to_markdown(s.choice_text) %></span>
</div>
<% end %>
<% elsif q.question_type == 1 %>
<% q.exercise_choices.each do |s| %>
<div class="pbt5 clearfix">
<span class="choose-checkbox pull-left line-24"></span>
<span class="inline-block pull-left line-24"><%= to_markdown(s.choice_text) %></span>
<span class="choose-checkbox pull-left line-24 mt5"></span>
<span class="inline-block pull-left line-24 ml10"><%= to_markdown(s.choice_text) %></span>
</div>
<% end %>
<% elsif q.question_type == 2 %>

@ -44,6 +44,9 @@ p{
.mbt10{
margin: 10px 0;
}
.mt5{
margin-top:5px;
}
.pull-right{
float:right;
}
@ -82,9 +85,15 @@ p{
.ml20{
margin-left:20px;
}
.ml10{
margin-left:10px;
}
.mr3{
margin-right:3px;
}
.mr8{
margin-right:8px;
}
.mr15{
margin-right:15px;
}
@ -318,3 +327,4 @@ textarea{

@ -167,41 +167,39 @@
<% end %>
</div>
<div class="pbt5">
<% q_title = q.question_title&.html_safe %>
<% if q_type == 5 %>
<% q_name = q.shixun_name&.html_safe %>
<span class="ques-title"><%= q_name&.include?("src=\"") ? q_name&.gsub("src=\"","src=\"#{@request_url}") : q_name %></span>
<% if q.question_type == 5 %>
<span class="ques-title" ><%= to_markdown(q.shixun_name) %></span>
<div class="mt8 text-gray">
<span><%= q_title&.include?("src=\"") ? q_title&.gsub("src=\"","src=\"#{@request_url}") : q_title %></span>
<span><%= to_markdown(q.question_title) %></span>
</div>
<% else %>
<span class="ques-title"><%= q_title&.include?("src=\"") ? q_title&.gsub("src=\"","src=\"#{@request_url}") : q_title %></span>
<span class="ques-title"><%= to_markdown(q.question_title) %></span>
<% end %>
</div>
</div>
<div class="pbt5">
<% if q_type == 0 %>
<% q.exercise_choices.each_with_index do |s,index| %>
<% q.exercise_choices.each do |s| %>
<% check_answer = (user_answer.present? && (s.id == user_answer.first.exercise_choice_id)) ? "choose-answer" : '' %>
<p class="pbt5">
<span class="choose-radio <%= check_answer %>"></span>
<span class="mr15"><%= convert_to_char((index+1).to_s)%></span><%= s.choice_text%>
</p>
<div class="pbt5 clearfix">
<span class="choose-radio <%= check_answer %> pull-left line-24 mt5"></span>
<span class="inline-block pull-left line-24 ml10"><%= to_markdown(s.choice_text) %></span>
</div>
<% end %>
<% elsif q_type == 1 %>
<% q.exercise_choices.each_with_index do |s,index| %>
<% q.exercise_choices.each do |s| %>
<% check_answer = (user_answer.present? && (user_answer.pluck(:exercise_choice_id).include?(s.id))) ? true : false %>
<p class="pbt5">
<div class="pbt5 clearfix">
<% if check_answer %>
<span class="choose-checkbox choose-answer-multi" ></span>
<span class="choose-checkbox choose-answer-multi pull-left line-24 mt5" ></span>
<% else %>
<span class="choose-checkbox"></span>
<span class="choose-checkbox pull-left line-24 mt5"></span>
<% end %>
<span class="mr15"><%= convert_to_char((index+1).to_s)%></span><%= s.choice_text%>
</p>
<span class="inline-block pull-left line-24 ml10"><%= to_markdown(s.choice_text) %></span>
</div>
<% end %>
<% elsif q_type == 2 %>
<p class="pbt5">
<div class="pbt5 clearfix">
<% q.exercise_choices.each do |s| %>
<% if user_answer.present? && (s.id == user_answer.first.exercise_choice_id) %>
<% check_answer = 'choose-answer' %>
@ -213,7 +211,7 @@
<span class="mlr5"><%= s.choice_text %></span>
</span>
<% end %>
</p>
</div>
<% elsif q_type == 3 %>
<% st_counts = q.exercise_standard_answers.pluck(:exercise_choice_id).uniq %>
<% st_counts.each_with_index do |s,index| %>
@ -224,13 +222,13 @@
<% end %>
<p class="pbt10 flex-nowrap">
<span class="pull-left line-34">答案(填空<%= index+1 %></span>
<span class="null-answer"><%= check_answer&.html_safe %></span>
<span class="null-answer"><%= to_markdown(check_answer) %></span>
</p>
<% end %>
<% elsif q_type == 4 %>
<% check_answer = (user_answer.present? ? user_answer.first.answer_text : '--') %>
<p class="flex-nowrap">
<span class="null-answer main-height"><%= check_answer&.html_safe %></span>
<span class="null-answer main-height"><%= to_markdown(check_answer) %></span>
</p>
<% else %>
<div class="mbt10">

Loading…
Cancel
Save