socialforge/app/views/exercise/_exercise_content.html.erb

42 lines
2.3 KiB
Plaintext

<% mc_question_list = exercise.exercise_questions.where("question_type=1") %>
<% mcq_question_list = exercise.exercise_questions.where("question_type=2") %>
<% single_question_list = exercise.exercise_questions.where("question_type=3") %>
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单选题</h3>
<% mc_question_list.each do |exercise_question| %>
<div id="poll_questions_<%= exercise_question.id%>">
<div id="show_poll_questions_<%= exercise_question.id %>">
<%= render :partial => 'show_MC', :locals => {:exercise_question => exercise_question} %>
</div>
<div id="edit_poll_questions_<%= exercise_question.id %>" style="display: none;">
<%= render :partial => 'edit_MC', :locals => {:exercise_question => exercise_question} %>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="mcq_question_list" style="display: <%=mcq_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多选题</h3>
<% mcq_question_list.each do |exercise_question| %>
<div id="poll_questions_<%= exercise_question.id%>">
<div id="show_poll_questions_<%= exercise_question.id %>">
<%= render :partial => 'show_MCQ', :locals => {:exercise_question => exercise_question} %>
</div>
<div id="edit_poll_questions_<%= exercise_question.id %>" style="display: none;">
<%= render :partial => 'edit_MCQ', :locals => {:exercise_question => exercise_question} %>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="single_question_list" style="display: <%=single_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">填空题</h3>
<% single_question_list.each do |exercise_question| %>
<div id="poll_questions_<%= exercise_question.id%>">
<div id="show_poll_questions_<%= exercise_question.id %>">
<%= render :partial => 'show_single', :locals => {:exercise_question => exercise_question} %>
</div>
<div id="edit_poll_questions_<%= exercise_question.id %>" style="display: none;">
<%= render :partial => 'edit_single', :locals => {:exercise_question => exercise_question} %>
</div>
</div>
<% end %>
</div>