From 1ed1957899ff2aac8d6ff572ea67bb0a51bd7cdd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 10:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E8=BE=85=E8=AF=84=E5=88=86=E3=80=81?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E8=AF=84=E5=88=86=E3=80=81=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=20=E6=AF=94=E4=BE=8B=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 1 - app/controllers/users_controller.rb | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index bab2cbf12..fa2ce04cf 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -156,7 +156,6 @@ class HomeworkCommonController < ApplicationController if @homework.homework_type == 2 @homework.homework_detail_programing ||= HomeworkDetailPrograming.new @homework_detail_programing = @homework.homework_detail_programing - @homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6 @homework_detail_programing.language = params[:language_type].to_i @homework.homework_tests.delete_all diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4796d0c0c..59a50a904 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -444,7 +444,7 @@ class UsersController < ApplicationController homework.end_time = params[:homework_common][:end_time] || Time.now homework.publish_time = Time.now homework.homework_type = params[:homework_type].to_i || 1 - homework.late_penalty = 2 + homework.late_penalty = 10 homework.user_id = User.current.id homework.course_id = params[:course_id] @@ -452,19 +452,19 @@ class UsersController < ApplicationController render_attachment_warning_if_needed(homework) homework_detail_manual = HomeworkDetailManual.new - homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 + homework_detail_manual.ta_proportion = homework.homework_type == 1 ? 0.6 : 0.2 homework_detail_manual.comment_status = 1 homework_detail_manual.evaluation_start = Time.now homework_detail_manual.evaluation_end = Time.now homework_detail_manual.evaluation_num = params[:evaluation_num] || 3 - homework_detail_manual.absence_penalty = 2 + homework_detail_manual.absence_penalty = 5 homework.homework_detail_manual = homework_detail_manual #编程作业相关属性 if homework.homework_type == 2 homework_detail_programing = HomeworkDetailPrograming.new homework.homework_detail_programing = homework_detail_programing - homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6 + homework_detail_programing.ta_proportion = 0.5 homework_detail_programing.language = params[:language_type].to_i inputs = params[:program][:input]