diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb
index 74ca9fb32..0a15143fb 100644
--- a/app/views/poll/_poll_form.html.erb
+++ b/app/views/poll/_poll_form.html.erb
@@ -6,23 +6,203 @@ function edit_head(){
$("#polls_description").val($("#polls_description_div").html());
}
- function add_MC(){
+function chooseQuestionType(quest_type,quest_id){
+ $("#div_"+quest_type+"_"+quest_id).css("position", "absolute");
+
+ $("#div_"+quest_type+"_"+quest_id).css("top", $("#add_"+quest_type+"_"+quest_id).offset().top+30);
+
+ $("#div_"+quest_type+"_"+quest_id).css("left", $("#add_"+quest_type+"_"+quest_id).offset().left-10);
+ if( $("#div_"+quest_type+"_"+quest_id).css('display') == 'block') {
+ $("#div_"+quest_type+"_"+quest_id).css('display', 'none');
+ }
+ else{
+ $("#div_"+quest_type+"_"+quest_id).css('display', 'block');
+ }
+}
+
+function add_MC(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC') %>");
$("#poll_questions_title").focus();
- }
- function add_MCQ(){
+}
+
+ function insert_MC(quest_type,quest_num,quest_id){
+ $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
+ '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
+ '
'+
+ '
'+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ '
'+
+ '<% end%>'
+ );
+ $("#poll_questions_title").focus();
+}
+
+function add_MCQ(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ') %>");
$("#poll_questions_title").focus();
+}
+
+function insert_MCQ(quest_type,quest_num,quest_id){
+ $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
+ '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
+ '
'+
+ '
'+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ '
'+
+ '<% end%>'
+ );
+ $("#poll_questions_title").focus();
}
+
function add_single(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single') %>");
$("#poll_questions_title").focus();
}
+
+ function insert_SINGLE(quest_type,quest_num,quest_id){
+ $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
+ '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
+ '
'+
+ '<% end%>'
+ );
+ $("#poll_questions_title").focus();
+ }
function add_mulit(){
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
$("#poll_questions_title").focus();
}
+ function insert_MULIT(quest_type,quest_num,quest_id){
+ $("#insert_new_poll_question_"+quest_type+"_"+quest_id).html(
+ '<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>'+
+ '
'+
+ '
'+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ ''+
+ '
'+
+ '
'+
+ '
'+
+ ''+
+ '
'+
+ '
'+
+ '<% end%>'
+ );
+ $("#poll_questions_title").focus();
+ }
+
//添加标题时确定按钮
function add_poll_question(doc)
{
diff --git a/app/views/poll/_show_MC.html.erb b/app/views/poll/_show_MC.html.erb
index ff8e52f25..9c47894dc 100644
--- a/app/views/poll/_show_MC.html.erb
+++ b/app/views/poll/_show_MC.html.erb
@@ -1,3 +1,6 @@
+
@@ -9,9 +12,11 @@
*
<%end%>
+
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/app/views/poll/_show_MCQ.html.erb b/app/views/poll/_show_MCQ.html.erb
index 63b9d1c1f..fb2c03080 100644
--- a/app/views/poll/_show_MCQ.html.erb
+++ b/app/views/poll/_show_MCQ.html.erb
@@ -12,6 +12,7 @@
<%= link_to("", delete_poll_question_poll_index_path(:poll_question => poll_question.id),
method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "ur_icon_de") %>