%# has_commit = has_commit_poll?(poll.id ,User.current)%>
<% exercise_name = exercise.exercise_name.empty? ? l(:label_poll_new) : exercise.exercise_name%>
<% if @is_teacher%>
<%# if has_commit %>
<%#= link_to poll_name, poll_result_poll_path(poll.id), :class => "polls_title polls_title_w fl c_dblue"%>
<%# else %>
<%#= link_to poll_name, exercise_path(poll.id), :class => "polls_title polls_title_w fl c_dblue" %>
<%# end %>
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_w fl c_dblue" %>
<%# if exercise.exercise_status == 2 %>
<%# else %>
<%# end%>
<%# if exercise.exercise_status == 1%>
<%# elsif exercise.exercise_status == 2 || exercise.exercise_status == 3 %>
<%# end%>
<% if exercise.exercise_status == 1 %>
发布试卷
<% elsif exercise.exercise_status == 2%>
取消发布
<% else%>
发布试卷
<% end%>
<% if exercise.exercise_status == 1%>
统计结果
<% else %>
<%= link_to l(:label_statistical_results), student_exercise_list_exercise_path(exercise.id,:course_id => @course.id), :class => "pollsbtn fr mr10"%>
<% end%>
<%= link_to(l(:button_delete), exercise,:method => :delete, :confirm => l(:text_are_you_sure), :remote => true, :class => "polls_de fr ml5 mr10") %>
<% if exercise.exercise_status == 1 %>
<%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "polls_de fr ml10"%>
<%=exercise.publish_time.nil? ? "未发布" : "将于"+format_time(exercise.publish_time.to_s)+"发布"%>
<% elsif exercise.exercise_status == 2 %>
编辑
已发布
<% else %>
编辑
已截止
<% end%>
<% else%>
<% if exercise.exercise_status != 1%>
<%# if has_commit%>
<%#else%>
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%>
<% if exercise.end_time <= Time.now && has_commit_exercise?(exercise.id, User.current.id) %>
已答
<% end %>
<%#end%>
<% end%>
截止时间:<%= format_time(exercise.end_time.to_s)%>
<% if exercise.show_result == 1 %>
<% if exercise.end_time <= Time.now %>
<%= link_to l(:label_statistical_results), student_exercise_list_exercise_path(exercise.id,:course_id => @course.id), :class => "pollsbtn fr mr10"%>
<% else %>
统计结果
<%end%>
<% end %>
<% end%>