%# 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%>
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_w fl c_dblue mw450", :title => "#{exercise_name}" %>
<% if exercise.exercise_status == 1 %>
<% elsif exercise.exercise_status == 2 %>
<% else %>
<% end%>
<% if exercise.exercise_status == 1 %>
<% end_time_status = exercise.end_time.nil? ? 1 : (exercise.end_time <= Time.now ? 2 : 3) %>
<% 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%>
测试时长:<%= exercise.time.nil? || exercise.time == -1 ? '不限' : exercise.time.to_s + "分钟" %>
截止时间:<%= exercise.end_time.nil? ? '未设置' : format_time(exercise.end_time) %>
发布时间:<%= exercise.publish_time.nil? ? '未设置' : format_time(exercise.publish_time) %>
<% if exercise.exercise_status > 1 %>
已提交:<%= exercise.exercise_users.where("commit_status = 1").count %>
未提交:<%= exercise.course.student.count - exercise.exercise_users.where("commit_status = 1").count %>
<% end %>
<% if exercise.exercise_status == 1 %>
<%= link_to '', edit_exercise_path(exercise.id), :title => "编辑试卷", :class => "ex_icon_edit mt0"%>
<% end%>
<% else%>
<% if exercise.exercise_status != 1%>
<% eu = ExerciseUser.where("exercise_id=? and user_id=? and status=?",exercise.id, User.current.id, true).first %>
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :title => "#{exercise_name}", :class => "polls_title polls_title_st fl c_dblue "%>
<% if exercise.exercise_status == 1 %>
<% elsif exercise.exercise_status == 2 %>
<% else %>
<% end%>
<% if eu && exercise.end_time >= eu.created_at %>
<% else %>
<% end %>
测试时长:<%= exercise.time.nil? || exercise.time == -1 ? '不限' : exercise.time.to_s + "分钟" %>
截止时间:<%= exercise.end_time.nil? ? '未设置' : format_time(exercise.end_time) %>
发布时间:<%= exercise.publish_time.nil? ? '未设置' : format_time(exercise.publish_time) %>
<% exercise_end = exercise.end_time > Time.now
if exercise.time == -1 || exercise.time.nil?
can_edit_excercise = exercise_end
else
can_edit_excercise = !has_commit_exercise?(exercise.id,User.current.id)&& exercise_end
end%>
<% if can_edit_excercise && eu %>
继续答题
<% elsif can_edit_excercise %>
开始答题
<% else %>
查看答题
<% end %>
<% 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%>
<% end%>