班级作业:评分设置中最终得分“教师优先”、“教辅优先”轮流切换多次后,得分计算错误

This commit is contained in:
cxt 2016-11-04 20:04:27 +08:00
parent 15a88b76c2
commit 4377fc1f9e
1 changed files with 4 additions and 2 deletions

View File

@ -975,9 +975,9 @@ class StudentWorkController < ApplicationController
homework_detail_programing = @homework.homework_detail_programing
unless @homework.late_penalty.to_s == params[:late_penalty].to_s
@homework.late_penalty = params[:late_penalty]
@homework.late_penalty = params[:late_penalty].to_s
@homework.student_works.where("commit_time > '#{@homework.end_time} 23:59:59'").each do |student_work|
student_work.late_penalty = @homework.late_penalty
student_work.late_penalty = params[:late_penalty].to_i
student_work.save
end
end
@ -1005,6 +1005,8 @@ class StudentWorkController < ApplicationController
homework_detail_manual.save if homework_detail_manual
homework_detail_programing.save if homework_detail_programing
@homework.save
@homework = HomeworkCommon.find @homework.id
@homework.student_works.each do |student_work|
set_final_score @homework,student_work
student_work.save