挂起的作业编辑截止日期后报500

This commit is contained in:
cxt 2016-05-03 10:58:49 +08:00
parent 39c2365338
commit 6b1137980e
2 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ class HomeworkCommonController < ApplicationController
homework_detail_manual.comment_status = 1
end
eval_start = homework_detail_manual.evaluation_start
if eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1
if eval_start.nil? || (eval_start <= @homework.end_time && homework_detail_manual.comment_status <= 1)
homework_detail_manual.evaluation_start = @homework.end_time + 7
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
end

View File

@ -71,7 +71,7 @@
<%= user_for_homework_common homework_common,is_teacher %>
</div>
<% work = cur_user_works_for_homework homework_common %>
<% if homework_common.end_time < Date.today && !is_teacher && !work.nil? %>
<% if !is_teacher && !work.nil? && homework_common.end_time < Date.today %>
<div class="homepagePostSubmit">
<%=link_to "追加附件", student_work_index_url_in_org(homework_common.id, 1), :class => 'c_blue', :title => "可追加作品修订附件" %>
</div>