迟交扣分记录
This commit is contained in:
parent
08c9d5a498
commit
0d0e294c10
|
@ -161,6 +161,14 @@ class HomeworkCommonController < ApplicationController
|
||||||
#关闭匿评
|
#关闭匿评
|
||||||
def stop_anonymous_comment
|
def stop_anonymous_comment
|
||||||
@homework_detail_manual.update_column('comment_status', 3)
|
@homework_detail_manual.update_column('comment_status', 3)
|
||||||
|
|
||||||
|
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||||
|
@homework.student_works.each do |student_work|
|
||||||
|
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
|
||||||
|
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
|
||||||
|
student_work.save
|
||||||
|
end
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.js
|
format.js
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue