From 4377fc1f9ee55a894be9e6a456b15f724eeaa560 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 4 Nov 2016 20:04:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E4=BD=9C=E4=B8=9A=EF=BC=9A?= =?UTF-8?q?=E8=AF=84=E5=88=86=E8=AE=BE=E7=BD=AE=E4=B8=AD=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E5=BE=97=E5=88=86=E2=80=9C=E6=95=99=E5=B8=88=E4=BC=98=E5=85=88?= =?UTF-8?q?=E2=80=9D=E3=80=81=E2=80=9C=E6=95=99=E8=BE=85=E4=BC=98=E5=85=88?= =?UTF-8?q?=E2=80=9D=E8=BD=AE=E6=B5=81=E5=88=87=E6=8D=A2=E5=A4=9A=E6=AC=A1?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=BE=97=E5=88=86=E8=AE=A1=E7=AE=97=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index ad22cb42c..fbbca9712 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -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