刚新建的班级作业,评分设置中最终得分“助教+匿评”的默认比例错了

This commit is contained in:
cxt 2017-02-24 17:42:15 +08:00
parent e658a5426d
commit 29e22f0c6c
1 changed files with 12 additions and 4 deletions

View File

@ -1317,12 +1317,20 @@ class StudentWorkController < ApplicationController
@homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0)
homework_detail_manual = @homework.homework_detail_manual
homework_detail_programing = @homework.homework_detail_programing
if homework_detail_programing
homework_detail_manual.update_column('ta_proportion', 0.4)
homework_detail_programing.update_column('ta_proportion', 0.6)
if @homework.anonymous_comment == 1
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.4 : 1.0
else
homework_detail_manual.update_column('ta_proportion', 1.0)
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.3 : 0.6
end
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
end
homework_detail_manual.save
homework_detail_programing.save if homework_detail_programing
@homework.student_works.each do |student_work|
set_final_score @homework,student_work
student_work.save