启用/禁用匿评时评分设置的调整

This commit is contained in:
cxt 2017-04-25 10:53:28 +08:00
parent fd7300bcaf
commit 35a60d5c31
1 changed files with 4 additions and 7 deletions

View File

@ -1320,7 +1320,6 @@ class StudentWorkController < ApplicationController
@homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0)
homework_detail_programing = @homework.homework_detail_programing
if @homework.anonymous_comment == 1
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.4 : 1.0
@status = 1
else
if @homework.end_time < Time.now
@ -1332,14 +1331,12 @@ class StudentWorkController < ApplicationController
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
@status = 3
end
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.3 : 0.6
end
homework_detail_manual.te_proportion = 1.0
homework_detail_manual.ta_proportion = 0
if @homework.homework_type == 2 && homework_detail_programing
if @homework.anonymous_comment == 1
homework_detail_programing.ta_proportion = 0.6
else
homework_detail_programing.ta_proportion = 0.5
end
homework_detail_programing.ta_proportion = 0
end
homework_detail_manual.save
homework_detail_programing.save if homework_detail_programing