socialforge/app/views/poll/_show_MCQ.html.erb

62 lines
2.6 KiB
Plaintext
Raw Normal View History

2016-10-27 10:12:50 +08:00
<div class="poll-container">
2016-10-27 15:38:10 +08:00
<div class="poll-tool-bar" id="poll_tool_bar_<%= poll_question.id%>">
<%= render :partial => "poll_tool_bar", :locals => {:type => 'mcq', :poll_question => poll_question}%>
2015-01-13 18:21:46 +08:00
</div>
2016-10-27 10:12:50 +08:00
<div class="poll-content">
<div class="testEditTitle" style="padding-top:0;">
2016-10-27 10:12:50 +08:00
<span class="formatContainer m_w500"><%= poll_question.question_title %></span>
<span class="fontBlue">[多选题]</span>
2016-10-27 18:25:47 +08:00
<% if poll_question.min_choices != 0 || poll_question.max_choices != 0 %>
<p class="fontGrey2">
<% if poll_question.min_choices != 0 && poll_question.max_choices != 0 %>
答题时最少选<%=poll_question.min_choices %>项、最多选<%=poll_question.max_choices %>项
<% elsif poll_question.min_choices != 0 %>
答题时最少选<%=poll_question.min_choices %>项
<% elsif poll_question.max_choices != 0 %>
答题时最多选<%=poll_question.max_choices %>项
<% end %>
</p>
<% end %>
2016-10-27 10:12:50 +08:00
</div>
<a class="poll-edit" title="编辑" onclick="pollQuestionEdit(<%= poll_question.id%>);"></a>
2016-10-27 10:12:50 +08:00
<div class="cl"></div>
<div class="ur_inputs">
<table class="ur_table" style="width:647px;">
2016-10-27 10:12:50 +08:00
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<% if poll_answer.answer_text != '' %>
<label>
<input class="ur_radio" type="checkbox" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
<% else %>
<label>
<input class="ur_radio" name="<%= poll_question %>" value="" type="checkbox">
</label>
<input placeholder="其它" readonly="readonly" class="disabled questionnaire-input w300" type="text">
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div><!--多选题显示 end-->
<!-- 新增问题 -->
<div id="insert_new_poll_question_mcq_<%=poll_question.id%>">
2016-10-27 18:25:47 +08:00
</div>
<script>
$(".poll-add").mouseover(function(){
2016-10-28 15:42:45 +08:00
$(this).children('ul').show();
2016-10-27 18:25:47 +08:00
}).mouseout(function(){
2016-10-28 15:42:45 +08:00
$(this).children('ul').hide();
2016-10-27 18:25:47 +08:00
});
$(".poll-add-menu").mouseover(function(){
$(this).show();
}).mouseout(function(){
$(this).hide();
});
</script>