From a83b4f13272ddbc02de50088bb496c798aa658e3 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 6 Jul 2019 16:54:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E5=88=86=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_works_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_works_controller.rb b/app/controllers/student_works_controller.rb index 309c8b379..92d146c82 100644 --- a/app/controllers/student_works_controller.rb +++ b/app/controllers/student_works_controller.rb @@ -334,6 +334,7 @@ class StudentWorksController < ApplicationController ActiveRecord::Base.transaction do begin # 没传score则取上次评分成绩 + reviewer_role = @user_course_identity == Course::STUDENT ? 3 : @user_course_identity == Course::ASSISTANT_PROFESSOR ? 2 : 1 new_score = StudentWorksScore.new score = StudentWorksScore.where(user_id: current_user.id, student_work_id: @work.id, reviewer_role: reviewer_role).last new_score.score = params[:score].blank? ? score.try(:score) : params[:score].to_f @@ -348,7 +349,6 @@ class StudentWorksController < ApplicationController @work.update_attributes(group_id: @homework.max_group_id) if @homework.homework_type == "group" end - reviewer_role = @user_course_identity == Course::STUDENT ? 3 : @user_course_identity == Course::ASSISTANT_PROFESSOR ? 2 : 1 new_score.reviewer_role = reviewer_role if new_score.save!