导入的试卷进入查看页报500

This commit is contained in:
cxt 2016-12-16 14:05:14 +08:00
parent 710c06e41a
commit 6dfebd447c
2 changed files with 4 additions and 2 deletions

View File

@ -56,7 +56,7 @@ class ExerciseController < ApplicationController
end
end
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
exercise_end = @exercise.end_time > Time.now
exercise_end = @exercise.end_time.nil? ? false : @exercise.end_time > Time.now
if @exercise.time == -1
@can_edit_excercise = exercise_end
else

View File

@ -13,7 +13,9 @@
<% unless exercise.publish_time.nil? %>
<span class="mr100">发布时间:<%=Time.parse(h(exercise.publish_time)).strftime("%Y-%m-%d %H:%M:%S") %></span>
<% end %>
<span class="mr100">截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") %></span>
<% unless exercise.end_time.nil? %>
<span class="mr100">截止时间:<%=Time.parse(h(exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") %></span>
<% end %>
<% if exercise.time != -1 %>
<span class="fr">测验时长:<%=exercise.time %>分钟</span>
<% end %>