From b70179d967f1ea40c98f91d7482289cc7545c662 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 5 Jul 2019 14:36:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=BB=84=E5=90=8C=E8=AF=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 5d14a43ea..ef12e5650 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -730,19 +730,19 @@ class StudentWorksController < ApplicationController student_works.each do |st_work| st_score = StudentWorksScore.new(user_id: new_score.user_id, score: new_score.score, reviewer_role: new_score.reviewer_role, comment: new_score.comment) - st_work.student_works_scores << st_score - score = StudentWorksScore.where(user_id: new_score.user_id, student_work_id: st_work.id).last + score = StudentWorksScore.where(user_id: new_score.user_id, student_work_id: st_work.id, reviewer_role: new_score.reviewer_role).last # 该用户的历史评阅无效 score.update_column('is_invalid', true) if score.present? && score.score.present? + st_work.student_works_scores << st_score if new_score.reviewer_role == 1 - st_work.teacher_score = new_score.score + st_work.teacher_score = new_score.score if new_score.score.present? elsif new_score.reviewer_role == 2 if homework.homework_detail_manual.ta_mode == 1 - st_work.teaching_asistant_score = new_score.ta_score st_work.id + st_work.teaching_asistant_score = new_score.ta_score st_work.id if new_score.score.present? else - st_work.teaching_asistant_score = new_score.score + st_work.teaching_asistant_score = new_score.score if new_score.score.present? end else st_work.student_score = student_work.student_score