|
|
|
@ -34,7 +34,7 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="ur_inputs">
|
|
|
|
|
<%= form_tag(commit_answer_poll_path(@poll),:remote => true,:id => 'form_'+ pq.id.to_s) do %>
|
|
|
|
|
<form>
|
|
|
|
|
<table class="ur_table" >
|
|
|
|
|
<tbody>
|
|
|
|
|
<% pq.poll_answers.each do |pa| %>
|
|
|
|
@ -57,7 +57,7 @@
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<%= radio_button "poll_vote","poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;" %>
|
|
|
|
|
<%= radio_button "poll_vote","poll_answer_id",pa.id,:class=>"ur_radio",:onclick =>"click_#{pa.id}(this);return false;",:checked => answer_be_selected?(pa,User.current) %>
|
|
|
|
|
<%= pa.answer_text %>
|
|
|
|
|
</label>
|
|
|
|
|
</td>
|
|
|
|
@ -65,7 +65,7 @@
|
|
|
|
|
<% end %>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<% end %>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
<% elsif pq.question_type == 2 %>
|
|
|
|
@ -80,20 +80,45 @@
|
|
|
|
|
</div>
|
|
|
|
|
<div class="cl"></div>
|
|
|
|
|
<div class="ur_inputs">
|
|
|
|
|
<table class="ur_table" >
|
|
|
|
|
<tbody>
|
|
|
|
|
<% pq.poll_answers.each do |pa| %>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
|
|
|
|
<label >
|
|
|
|
|
<input class="ur_checkbox" type="checkbox" value="新建选项" >
|
|
|
|
|
<%= pa.answer_text %>
|
|
|
|
|
</label>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<% end %>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<form>
|
|
|
|
|
<table class="ur_table" >
|
|
|
|
|
<tbody>
|
|
|
|
|
<% pq.poll_answers.each do |pa| %>
|
|
|
|
|
<tr>
|
|
|
|
|
<td>
|
|
|
|
|
<label >
|
|
|
|
|
<script>
|
|
|
|
|
function click_<%= pa.id %>(obj)
|
|
|
|
|
{
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "post",
|
|
|
|
|
url: "<%= commit_answer_poll_path(@poll) %>",
|
|
|
|
|
data: {
|
|
|
|
|
poll_answer_id: <%= pa.id %>,
|
|
|
|
|
poll_question_id: <%= pq.id %>
|
|
|
|
|
},
|
|
|
|
|
success: function (data) {
|
|
|
|
|
if(data == "true")
|
|
|
|
|
{
|
|
|
|
|
obj.checked = true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
obj.checked = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<input class="ur_checkbox" type="checkbox" onclick="click_<%= pa.id %>(this);return false;" <%= answer_be_selected?(pa,User.current) ? "checked":"" %>>
|
|
|
|
|
<%= pa.answer_text %>
|
|
|
|
|
</label>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<% end %>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</li>
|
|
|
|
|
<% elsif pq.question_type == 3 %>
|
|
|
|
|