diff --git a/app/controllers/poll_controller.rb b/app/controllers/poll_controller.rb
index 6a4ba0cc5..ce031f586 100644
--- a/app/controllers/poll_controller.rb
+++ b/app/controllers/poll_controller.rb
@@ -7,7 +7,11 @@ class PollController < ApplicationController
def index
if @course
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
- polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
+ if @is_teacher
+ polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id}")
+ else
+ polls = Poll.where("polls_type = 'Course' and polls_group_id = #{@course.id} and polls_status = 2")
+ end
@polls = paginateHelper polls,10 #分页
respond_to do |format|
format.html{render :layout => 'base_courses'}
diff --git a/app/views/poll/index.html.erb b/app/views/poll/index.html.erb
index 0e5e956ca..e57674c7a 100644
--- a/app/views/poll/index.html.erb
+++ b/app/views/poll/index.html.erb
@@ -11,46 +11,46 @@
<% @polls.each do |poll|%>
-
- <% unless !@is_teacher && poll.polls_status != 2 %>
-
- -
- <% if @is_teacher %>
- <% if has_commit_poll?(poll.id ,User.current) %>
- <%= poll.polls_name %>
- <% else %>
- <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
- <% end %>
+
+ -
+ <% if @is_teacher %>
+ <% if has_commit_poll?(poll.id ,User.current) %>
+ <%= poll.polls_name %>
<% else %>
- <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %>
- <%= 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" %>
- <% end %>
+ <%= link_to poll.polls_name, poll_path(poll.id), :class => "polls_title fl" %>
<% end %>
-
- -
- <%if @is_teacher%>
- <%= link_to l(:label_statistical_results), statistics_result_poll_path(poll.id), :class => "pollsbtn fl ml10"%>
- <% end%>
-
- -
- <% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可删除%>
- <%= link_to(l(:button_delete), poll,
- method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
- <% end%>
-
- -
- <% if @is_teacher && poll.polls_status == 1 #新建状态的问卷可编辑%>
- <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
- <% end%>
-
- -
- <%= format_time poll.created_at%>
-
-
- <% end %>
-
+ <% else %>
+ <% if has_commit_poll?(poll.id ,User.current) && poll.polls_status == 2 %>
+
+ <%= 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" %>
+ <% 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"%>
+ <% end%>
+
+ -
+ <% if @is_teacher %>
+
+ <%= link_to(l(:button_delete), poll,
+ method: :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml20 mr10") %>
+ <% end%>
+
+ -
+ <% if @is_teacher && poll.polls_status == 1%>
+
+ <%= link_to l(:button_edit), edit_poll_path(poll.id), :class => "polls_de fr ml20"%>
+ <% end%>
+
+ -
+ <%= format_time poll.created_at%>
+
+
<% end%>
diff --git a/public/stylesheets/polls.css b/public/stylesheets/polls.css
index 5864a9801..324fb2bb9 100644
--- a/public/stylesheets/polls.css
+++ b/public/stylesheets/polls.css
@@ -26,7 +26,7 @@ div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span{ margi
a.newbtn{ float:right; display:block; width:80px; height:30px; background:#64bdd9; color:#fff; font-size:14px; margin:10px; text-align:center;}
a:hover.newbtn{ background:#55a1b9; text-decoration:none;}
.polls_list ul{ padding-left:10px; border-bottom:1px dashed #c9c9c9; height:32px; padding-top:8px;}
-a.polls_title{ font-weight:bold; color:#3e6d8e;}
+a.polls_title{ font-weight:bold; color:#3e6d8e;max-width: 350px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
.polls_title{ font-weight:bold; color:#3e6d8e;}
a.pollsbtn{ display:block; width:66px; height:22px; text-align:center; border:1px solid #64bdd9; color:#64bdd9;}
a:hover.pollsbtn{ background:#64bdd9; color:#fff; text-decoration:none;}