1.增加单选题的显示

2.去掉无用页面
This commit is contained in:
sw 2015-01-14 16:15:33 +08:00
parent 0433f7c87f
commit 2a23eb8e17
5 changed files with 23 additions and 33 deletions

View File

@ -89,7 +89,8 @@ class PollController < ApplicationController
option = {
:is_necessary => params[:is_necessary] || true,
:question_title => question_title,
:question_type => params[:question_type] || 1
:question_type => params[:question_type] || 1,
:question_number => @poll.poll_questions.count + 1
}
@poll_questions = @poll.poll_questions.new option
if params[:question_answer]

View File

@ -62,6 +62,11 @@
<%= render :partial => 'edit_head'%>
<div>
<% @poll.poll_questions.each do |poll_question|%>
<%= render :partial => 'show_MC', :locals => {:poll_question => poll_question} %>
<% end%>
</div>
<div id="poll_content">
<%#= render :partial => 'edit_MC'%>
</div>

View File

@ -1,11 +0,0 @@
<li class="ur_item">
<label>
选项
<span class="ur_index">
</span>
</label>
<input type="text" name="option" placeholder="新建选项"/>
<a class="icon_add" title="向下插入选项" onclick="add_single_answer($(this));"></a>
<a class="icon_remove" title="删除" onclick="remove_single_answer($(this))"></a>
</li>
<div class="cl"></div>

View File

@ -1,10 +1,13 @@
<div class="ur_question_item radio ur_editor02">
<div class="ur_title">
<span class="title_index">
第<%= question_index%>题:
第<%= poll_question.question_number%>题:
</span>
<%= poll_questions.question_title%>
<%= poll_question.question_title %>
<%if poll_question.is_necessary == 1%>
<span class="ur_required" title="必答">*</span>
<%end%>
</div>
<a href="#" class="ur_icon_de" title="删除"></a>
<a href="#" class="ur_icon_edit" title="编辑"></a>
@ -12,24 +15,16 @@
<div class="ur_inputs">
<table class="ur_table" >
<tbody>
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
<tr>
<td>
<label>
<input class="ur_radio" type="radio" value="新建选项" >
新建选项
<input class="ur_radio" type="radio" name="<%= poll_question %>" value="<%= poll_answer.answer_text%>" >
<%= poll_answer.answer_text%>
</label>
</td>
</tr>
<tr >
<td>
<label ><input class="ur_radio" type="radio" value="新建选项" > 新建选项</label>
</td>
</tr>
<tr>
<td>
<label ><input class="ur_radio" type="radio" value="新建选项" > 新建选项</label>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>