Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_forum
jingquan huang 6 years ago
commit 77c0791d62

@ -41,9 +41,7 @@ class Discuss < ApplicationRecord
# end
def child_discuss(user)
user.admin? ?
Discuss.where(parent_id: self.id).includes(:user).reorder(created_at: :asc) :
Discuss.where(parent_id: self.id, :hidden => false).includes(:user).reorder(created_at: :asc)
Discuss.where(parent_id: self.id).includes(:user).reorder(created_at: :asc)
end
private

@ -81,25 +81,25 @@
</div>
<div class="pbt5">
<% 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">
<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>
<% end %>
<% 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">
<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>
<% end %>
<% elsif q.question_type == 2 %>
<div class="pbt5 clearfix">
<% q.exercise_choices.each do |s| %>
<% q.exercise_choices.each_with_index do |s,index| %>
<span class="mr15">
<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>
<% end %>
</div>

@ -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>

Loading…
Cancel
Save