编程作业,最终评分的计算
This commit is contained in:
parent
8f3ac85fec
commit
eb1976efbb
|
@ -190,8 +190,10 @@ class StudentWorkController < ApplicationController
|
|||
if @work.student_score.nil?
|
||||
@work.final_score = @work.teaching_asistant_score
|
||||
else
|
||||
final_ta_score = BigDecimal.new("#{@work.teaching_asistant_score}") * BigDecimal.new("#{@homework.homework_detail_manual.ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{@work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{@homework.homework_detail_manual.ta_proportion}"))
|
||||
ta_proportion = @homework.homework_detail_manual.ta_proportion if @homework.homework_detail_manual
|
||||
ta_proportion = @homework.homework_detail_programing.ta_proportion if @homework.homework_detail_programing
|
||||
final_ta_score = BigDecimal.new("#{@work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{@work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
@work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue