From 164c89d7b8122baa73e086c709465574d22f043e Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Fri, 16 Jan 2015 14:39:40 +0800
Subject: [PATCH] =?UTF-8?q?1.=E5=AE=9E=E7=8E=B0=E6=B7=BB=E5=8A=A0=E5=A4=9A?=
=?UTF-8?q?=E9=80=89=E9=A2=98=202.=E5=8D=95=E9=80=89=E9=A2=98=E3=80=81?=
=?UTF-8?q?=E5=A4=9A=E9=80=89=E9=A2=98=E5=90=8E=E9=9D=A2=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E6=8B=AC=E5=8F=B7=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/_edit_MCQ.html.erb | 41 +++++++++----------
app/views/poll/_new_MC.html.erb | 6 +--
app/views/poll/_new_MCQ.html.erb | 46 +++++++++++++---------
app/views/poll/_show_MC.html.erb | 2 +-
app/views/poll/_show_MCQ.html.erb | 39 +++++++++---------
app/views/poll/create_poll_question.js.erb | 16 ++++++++
6 files changed, 85 insertions(+), 65 deletions(-)
diff --git a/app/views/poll/_edit_MCQ.html.erb b/app/views/poll/_edit_MCQ.html.erb
index cf64e7f3e..f34319569 100644
--- a/app/views/poll/_edit_MCQ.html.erb
+++ b/app/views/poll/_edit_MCQ.html.erb
@@ -1,33 +1,28 @@
-
+<%= form_for("",:url => update_poll_question_poll_index_path(:poll_question => poll_question.id),:remote => true) do |f|%>
-
\ No newline at end of file
+
+<% end%>
\ No newline at end of file
diff --git a/app/views/poll/_new_MC.html.erb b/app/views/poll/_new_MC.html.erb
index 013bf0ed0..f4f1ef676 100644
--- a/app/views/poll/_new_MC.html.erb
+++ b/app/views/poll/_new_MC.html.erb
@@ -1,6 +1,5 @@
<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
-
+<%= form_for PollQuestion.new,:url =>create_poll_question_poll_path(@poll.id),:remote => true do |f|%>
-
\ No newline at end of file
+<% end%>
\ No newline at end of file
diff --git a/app/views/poll/_show_MC.html.erb b/app/views/poll/_show_MC.html.erb
index f3fc9c8b5..594baea9d 100644
--- a/app/views/poll/_show_MC.html.erb
+++ b/app/views/poll/_show_MC.html.erb
@@ -7,7 +7,7 @@
<%if poll_question.is_necessary == 1%>
- 第2题: 多选题 *
+
+ 第<%= poll_question.question_number%>题:
+
+ <%= poll_question.question_title %>
+ <%if poll_question.is_necessary == 1%>
+ *
+ <%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") %>
+
diff --git a/app/views/poll/create_poll_question.js.erb b/app/views/poll/create_poll_question.js.erb
index 18f999157..ac44ebb4c 100644
--- a/app/views/poll/create_poll_question.js.erb
+++ b/app/views/poll/create_poll_question.js.erb
@@ -1,10 +1,26 @@
$("#new_poll_question").html("");
$("#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%>" +
"
" +
"
" +
+ "<% 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%>" +
"
" +
"
");