diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 2fc586711..42ab98e10 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -187,7 +187,13 @@ class PollController < ApplicationController
@poll.polls_status = 2
@poll.published_at = Time.now
if @poll.save
- redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id)
+ if params[:is_remote]
+ redirect_to poll_index_url(:polls_type => "Course", :polls_group_id => @course.id)
+ else
+ respond_to do |format|
+ format.js
+ end
+ end
end
end
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb
index dea4e175b..cc7e88547 100644
--- a/app/views/poll/_poll.html.erb
+++ b/app/views/poll/_poll.html.erb
@@ -1,23 +1,44 @@
+<% has_commit = has_commit_poll?(poll.id ,User.current)%>
<% if @is_teacher %>
- <% if has_commit_poll?(poll.id ,User.current) %>
- <%= poll.polls_name %>
+ <% if has_commit %>
+
+ <%= poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name%>
+
<% else %>
- <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
+ <%= link_to (poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name), poll_path(poll.id), :class => "polls_title polls_title_w fl" %>
<% end %>
<% else %>
- <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %>
+ <% if has_commit && poll.polls_status == 2 %>
- <%= poll.polls_name %>
+ <%= poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name %>
- <% elsif (!has_commit_poll?(poll.id ,User.current)) && poll.polls_status == 2 %>
- <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
+ <% elsif !has_commit && poll.polls_status == 2 %>
+ <%= link_to (poll.polls_name.empty? ? l(:label_poll_new) : poll.polls_name), poll_path(poll.id), :class => "polls_title polls_title_w fl" %>
<% end %>
<% end %>
+<% if !@is_teacher && has_commit && poll.polls_status == 2%>
+ 已答
+<% end %>
+
+<%if @is_teacher%>
+ <% if poll.polls_status == 1 %>
+ 统计结果
+ <% elsif poll.polls_status == 2%>
+
+ <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
+
+ <% end%>
+<% end%>
+
- <%if @is_teacher && poll.polls_status == 2%>
- <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
+ <%if @is_teacher %>
+ <% if poll.polls_status == 1 %>
+ 发布问卷
+ <% elsif poll.polls_status == 2%>
+ 取消发布
+ <% end%>
<% end%>
@@ -28,18 +49,21 @@
<% end%>
- <% if @is_teacher && poll.polls_status == 1%>
-
- <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
+ <% if @is_teacher%>
+ <% if poll.polls_status == 1 %>
+ <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
+ <% elsif poll.polls_status == 2%>
+ 编辑
+ <% end%>
<% end%>
-
- <% if @is_teacher && poll.polls_status == 2%>
-
- 取消发布
-
- <% end %>
-
-
+
+
+
+
+
+
+
+
<%= format_time poll.created_at%>
\ No newline at end of file
diff --git a/app/views/poll/_poll_form.html.erb b/app/views/poll/_poll_form.html.erb
index bbf71e0ce..6ce4137a3 100644
--- a/app/views/poll/_poll_form.html.erb
+++ b/app/views/poll/_poll_form.html.erb
@@ -57,7 +57,7 @@
function poll_submit()
{
- $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { poll: @poll}) %>');
+ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'poll_submit', locals: { :poll => @poll},:is_remote => false) %>');
showModal('ajax-modal', '310px');
$('#ajax-modal').css('height','110px');
$('#ajax-modal').siblings().remove();
diff --git a/app/views/poll/_poll_republish.html.erb b/app/views/poll/_poll_republish.html.erb
index 3688ba883..3f93b6b3d 100644
--- a/app/views/poll/_poll_republish.html.erb
+++ b/app/views/poll/_poll_republish.html.erb
@@ -2,18 +2,6 @@
diff --git a/app/views/poll/_poll_submit.html.erb b/app/views/poll/_poll_submit.html.erb
index cdc41dd9d..af3ca2d42 100644
--- a/app/views/poll/_poll_submit.html.erb
+++ b/app/views/poll/_poll_submit.html.erb
@@ -2,18 +2,6 @@
@@ -27,16 +15,14 @@
是否确定发布该问卷?
- <%= link_to "确 定",publish_poll_poll_path(poll.id), :class => "upload_btn", :onclick => "clickCanel();" %>
+ <%= link_to "确 定",publish_poll_poll_path(poll.id,:is_remote => is_remote), :class => "upload_btn", :onclick => "clickCanel();" %>
取 消
-
-