<% @all_exercises.each_with_index do |exercise,index |%> <% if exercise.id == @exercise.id %> <%="测验 #{@all_exercises.count - index}" %> <% end %> <% end%>
<% @all_exercises.each_with_index do |exercise,index |%>
<%= link_to "测验#{@all_exercises.count - index}:#{exercise.exercise_name}",student_exercise_list_exercise_path(exercise.id,:course_id => @course.id)%> <%#= link_to "第#{@homework_commons.count - index}次作业",student_work_index_path(:homework => homework_common.id)%>
<% end%>
<% if @is_teacher%>
<%= link_to "导出测验成绩", student_exercise_list_exercise_path(@exercise.id,:course_id => @course.id, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
<% end%>
<%= @exercise.exercise_name %>
<% if @exercise.exercise_status == 1 %>
未发布
<% elsif @exercise.exercise_status == 2 %>
已发布
<% elsif @exercise.exercise_status == 3 %>
已截止
<% end%>
[ 隐藏测验信息 ]
发布者:<%= @exercise.user.show_name %>
<%= @exercise.exercise_description.html_safe %>
[展开]
[收起]
截止时间:<%= format_time @exercise.end_time %>
<% if @exercise.exercise_status == 1 %>
发布时间:<%= format_time @exercise.publish_time %>
<% end %> <% end_time = @exercise.end_time.to_time.to_i %> <% if end_time > Time.now.to_i %>
提交剩余时间:
<%= (end_time - Time.now.to_i) / (24*60*60) %>
天
<%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%>
小时
<%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%>
分
<% else %>
提交已截止
<% end %>
<%= render :partial => "exercise/student_exercise"%>