作业评分

This commit is contained in:
cxt 2017-11-08 16:14:12 +08:00
parent a2908e84f4
commit 14fd5eb113
2 changed files with 12 additions and 12 deletions

View File

@ -1966,6 +1966,7 @@ class StudentWorkController < ApplicationController
end
end
end
end
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty - student_work.appeal_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
@ -1974,6 +1975,5 @@ class StudentWorkController < ApplicationController
end
end
end
end
end

View File

@ -191,6 +191,7 @@ class StudentWork < ActiveRecord::Base
end
end
end
end
if student_work.final_score
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty - student_work.appeal_penalty
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
@ -199,7 +200,6 @@ class StudentWork < ActiveRecord::Base
end
end
end
end
#更新course_homework_statistics中的avg_score和total_score
def update_avg_sum_score