-
答题列表
<% if @is_teacher || (@poll.show_result == 1 && @poll.polls_status == 3) %>
- -
- 统计结果
-
+ -
+ 统计结果
+
<% end %>
<% if @is_teacher %>
- -
- 问卷内容
-
- -
- 设置
-
- <% if @poll.polls_status > 1 %>
- <%= link_to "导出统计", export_poll_poll_path(@poll, :course_id => @course.id, :format => 'xls'), :id => "export_poll_work", :class => "fr white-btn orange-btn mt10 ml15" %>
- <% end %>
- <% if @poll.polls_status < 3 %>
- <%= link_to "编辑问卷", edit_poll_path(@poll, :course_id => @course.id), :class => "fr white-btn orange-btn mt10 ml15" %>
- <% end %>
- <% if @poll.polls_status == 1 || @poll.poll_group_settings.where("publish_time is null or publish_time > '#{Time.now}'").count > 0 %>
- <%= link_to '立即发布', publish_notice_poll_path(@poll), :remote => true, :class => "white-btn orange-btn fr ml15 mt10" %>
- <% end %>
- <% if (@poll.polls_status == 2 && @poll.end_time > Time.now) || @poll.poll_group_settings.where("publish_time < '#{Time.now}' and end_time > '#{Time.now}'").count > 0 %>
- <%= link_to '立即截止', end_notice_poll_path(@poll), :remote => true, :class => "white-btn orange-btn fr ml15 mt10" %>
- <% end %>
- <% if @poll.polls_status == 2 %>
- 撤销发布
- <% end %>
+ -
+ 问卷内容
+
+ -
+ 设置
+
+ <% if @poll.polls_status > 1 %>
+ <%= link_to "导出统计", export_poll_poll_path(@poll, :course_id => @course.id, :format => 'xls'), :id => "export_poll_work", :class => "fr white-btn orange-btn mt10 ml15" %>
+ <% end %>
+ <% if @poll.polls_status < 3 %>
+ <%= link_to "编辑问卷", edit_poll_path(@poll, :course_id => @course.id), :class => "fr white-btn orange-btn mt10 ml15" %>
+ <% end %>
+ <% if @poll.polls_status == 1 || @poll.poll_group_settings.where("publish_time is null or publish_time > '#{Time.now}'").count > 0 %>
+ <%= link_to '立即发布', publish_notice_poll_path(@poll), :remote => true, :class => "white-btn orange-btn fr ml15 mt10" %>
+ <% end %>
+ <% if (@poll.polls_status == 2 && @poll.end_time > Time.now) || @poll.poll_group_settings.where("publish_time < '#{Time.now}' and end_time > '#{Time.now}'").count > 0 %>
+ <%= link_to '立即截止', end_notice_poll_path(@poll), :remote => true, :class => "white-btn orange-btn fr ml15 mt10" %>
+ <% end %>
+ <% if @poll.polls_status == 2 %>
+ 撤销发布
+ <% end %>
<% else %>
- -
- 查看设置
-
- <% if User.current.member_of_course?(@poll.course) %>
-
- <% poll_user = @poll.poll_users.where(:user_id => User.current).first %>
- <% member = @poll.course.members.where(:user_id => User.current.id).first %>
- <% setting_time = poll_group_setting @poll, member.try(:course_group) %>
- <% if poll_user %>
- <% if poll_user.commit_status > 0 %>
- <%= link_to '查看答题', poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
- <% elsif setting_time.publish_time < Time.now && setting_time.end_time > Time.now %>
- <%= link_to (poll_user.start_at.nil? ? "开始答题" : "继续答题"), poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
- <% end %>
- <% elsif setting_time.publish_time < Time.now && setting_time.end_time > Time.now %>
- <%= link_to "开始答题", poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
- <% end %>
-
- <% end %>
+ -
+ 查看设置
+
+ <% if User.current.member_of_course?(@poll.course) %>
+
+ <% poll_user = @poll.poll_users.where(:user_id => User.current).first %>
+ <% member = @poll.course.members.where(:user_id => User.current.id).first %>
+ <% setting_time = poll_group_setting @poll, member.try(:course_group) %>
+ <% if poll_user %>
+ <% if poll_user.commit_status > 0 %>
+ <%= link_to '查看答题', poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
+ <% elsif setting_time.publish_time < Time.now && setting_time.end_time > Time.now %>
+ <%= link_to (poll_user.start_at.nil? ? "开始答题" : "继续答题"), poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
+ <% end %>
+ <% elsif setting_time.publish_time < Time.now && setting_time.end_time > Time.now %>
+ <%= link_to "开始答题", poll_path(@poll, :user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
+ <% end %>
+
+ <% end %>
<% end %>