|
|
|
@ -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
|
|
|
|
|