学生匿评:第一次匿评,分数都不能自动刷新

This commit is contained in:
cxt 2017-02-10 17:57:30 +08:00
parent c0de119969
commit c3b237af67
1 changed files with 1 additions and 1 deletions

View File

@ -984,7 +984,7 @@ class StudentWorkController < ApplicationController
#更新CourseHomeworkStatistics中该学生的待匿评数, 只计算第一次评分
if User.current.student_works_scores.where(:student_work_id => @work.id, :reviewer_role => 3).count == 1
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, student_work.user_id)
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
course_statistics.update_attribute('un_evaluation_work_num', (course_statistics.un_evaluation_work_num - 1) < 0 ? 0 : (course_statistics.un_evaluation_work_num - 1)) if course_statistics
end
end