修复老师第一次评分报错问题的BUG
This commit is contained in:
parent
16201f79cf
commit
9fc7ed8233
|
@ -439,8 +439,8 @@ class HomeworkAttachController < ApplicationController
|
|||
homework = @homework
|
||||
is_teacher = @is_teacher ? 1 : 0
|
||||
#保存评分@homework.rate(@m_score.to_i,User.current.id,:quality, (@is_teacher ? 1 : 0))
|
||||
rate = @homework.rates(:quality).where(:rater_id => User.current.id, :is_teacher_score => is_teacher).first
|
||||
if @m_score && rate.stars != @m_score
|
||||
if @m_score
|
||||
rate = @homework.rates(:quality).where(:rater_id => User.current.id, :is_teacher_score => is_teacher).first
|
||||
if rate
|
||||
rate.stars = @m_score
|
||||
rate.save!
|
||||
|
|
Loading…
Reference in New Issue