作业评分
This commit is contained in:
parent
a2908e84f4
commit
14fd5eb113
|
@ -1966,12 +1966,12 @@ class StudentWorkController < ApplicationController
|
|||
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
|
||||
else
|
||||
student_work.work_score = nil
|
||||
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
|
||||
else
|
||||
student_work.work_score = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -191,12 +191,12 @@ class StudentWork < ActiveRecord::Base
|
|||
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
|
||||
else
|
||||
student_work.work_score = nil
|
||||
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
|
||||
else
|
||||
student_work.work_score = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue