<% if @is_insert %> $("#poll_content").html('<%= escape_javascript(render :partial => 'poll_content', :locals => {:poll => @poll})%>'); <% else %> $("#new_poll_question_new").html(""); <% if @last_question %> <% if @last_question.question_type == 1%> $("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @last_question}) %>"); <% elsif @last_question.question_type == 2%> $("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @last_question}) %>"); <% elsif @last_question.question_type == 3%> $("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @last_question}) %>"); <% elsif @last_question.question_type == 4%> $("#show_poll_questions_<%= @last_question.id %>").html("<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @last_question}) %>"); <% end%> <% end %> $("#poll_content").append("
" + "
" + "<% if @poll_questions.question_type == 1%>" + "<%= escape_javascript(render :partial => 'show_MC', :locals => {:poll_question => @poll_questions}) %>" + "<% elsif @poll_questions.question_type == 2%>" + "<%= escape_javascript(render :partial => 'show_MCQ', :locals => {:poll_question => @poll_questions}) %>" + "<% elsif @poll_questions.question_type == 3%>" + "<%= escape_javascript(render :partial => 'show_single', :locals => {:poll_question => @poll_questions}) %>" + "<% elsif @poll_questions.question_type == 4%>" + "<%= escape_javascript(render :partial => 'show_mulit', :locals => {:poll_question => @poll_questions}) %>" + "<% end%>" + "
" + "" + "
"); <% end %>