老师给未提交的作品评语时不应变为已提交

This commit is contained in:
cxt 2016-12-13 09:49:11 +08:00
parent 6903639699
commit eaaca22e4d
1 changed files with 1 additions and 1 deletions

View File

@ -811,7 +811,7 @@ class StudentWorkController < ApplicationController
@new_score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" @new_score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
@new_score.user_id = User.current.id @new_score.user_id = User.current.id
@new_score.student_work_id = @work.id @new_score.student_work_id = @work.id
if @is_teacher && @work.work_status == 0 if @is_teacher && !@new_score.score.nil? && @work.work_status == 0
@work.update_attributes(:work_status => 1, :commit_time => Time.now) @work.update_attributes(:work_status => 1, :commit_time => Time.now)
end end
if User.current.admin? if User.current.admin?