parent
0433f7c87f
commit
2a23eb8e17
|
@ -89,7 +89,8 @@ class PollController < ApplicationController
|
||||||
option = {
|
option = {
|
||||||
:is_necessary => params[:is_necessary] || true,
|
:is_necessary => params[:is_necessary] || true,
|
||||||
:question_title => question_title,
|
: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
|
@poll_questions = @poll.poll_questions.new option
|
||||||
if params[:question_answer]
|
if params[:question_answer]
|
||||||
|
|
|
@ -62,6 +62,11 @@
|
||||||
|
|
||||||
<%= render :partial => 'edit_head'%>
|
<%= 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">
|
<div id="poll_content">
|
||||||
<%#= render :partial => 'edit_MC'%>
|
<%#= render :partial => 'edit_MC'%>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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>
|
|
|
@ -1,10 +1,13 @@
|
||||||
<div class="ur_question_item radio ur_editor02">
|
<div class="ur_question_item radio ur_editor02">
|
||||||
<div class="ur_title">
|
<div class="ur_title">
|
||||||
<span class="title_index">
|
<span class="title_index">
|
||||||
第<%= question_index%>题:
|
第<%= poll_question.question_number%>题:
|
||||||
</span>
|
</span>
|
||||||
<%= poll_questions.question_title%>
|
<%= poll_question.question_title %>
|
||||||
|
<%if poll_question.is_necessary == 1%>
|
||||||
<span class="ur_required" title="必答">*</span>
|
<span class="ur_required" title="必答">*</span>
|
||||||
|
<%end%>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<a href="#" class="ur_icon_de" title="删除"></a>
|
<a href="#" class="ur_icon_de" title="删除"></a>
|
||||||
<a href="#" class="ur_icon_edit" title="编辑"></a>
|
<a href="#" class="ur_icon_edit" title="编辑"></a>
|
||||||
|
@ -12,24 +15,16 @@
|
||||||
<div class="ur_inputs">
|
<div class="ur_inputs">
|
||||||
<table class="ur_table" >
|
<table class="ur_table" >
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<% poll_question.poll_answers.reorder("answer_position").each do |poll_answer| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label>
|
<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>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr >
|
<% end %>
|
||||||
<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>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue