This commit is contained in:
parent
b57c680afd
commit
c28014a4c5
|
@ -1320,7 +1320,7 @@ class StudentWorkController < ApplicationController
|
|||
# 申诉成功 重新计算申诉者的匿评分
|
||||
work = @student_work_score.student_work
|
||||
if work.student_works_scores.where("reviewer_role = 3 AND appeal_status != 3").count > 0
|
||||
stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@student_work_score.student_work_id} AND reviewer_role = 3 AND appeal_status != 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
|
||||
stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM student_works_scores where id in (select max(id) FROM student_works_scores WHERE student_work_id = #{@student_work_score.student_work_id} AND reviewer_role = 3 AND appeal_status != 3 GROUP BY user_id)")
|
||||
work.student_score = stu_score.first.score.try(:round, 2).to_f
|
||||
else
|
||||
work.student_score = nil
|
||||
|
|
Loading…
Reference in New Issue