socialforge/app/views/poll/create_poll_question.js.erb

27 lines
1.8 KiB
Plaintext

$("#new_poll_question").html("");
$("#poll_content").append("<div id='poll_questions_<%= @poll_questions.id%>'>" +
"<div id='show_poll_questions_<%= @poll_questions.id %>'>" +
"<% 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%>" +
"</div>" +
"<div id='edit_poll_questions_<%= @poll_questions.id %>' style='display: none;'>" +
"<% if @poll_questions.question_type == 1%>" +
"<%= escape_javascript(render :partial => 'edit_MC', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 2%>" +
"<%= escape_javascript(render :partial => 'edit_MCQ', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 3%>" +
"<%= escape_javascript(render :partial => 'edit_single', :locals => {:poll_question => @poll_questions}) %>" +
"<% elsif @poll_questions.question_type == 4%>" +
"<%= escape_javascript(render :partial => 'edit_mulit', :locals => {:poll_question => @poll_questions}) %>" +
"<% end%>" +
"</div>" +
"</div>");