|
|
|
@ -791,7 +791,7 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
if homework_detail_manual.ta_proportion.to_s != params[:ta_proportion].to_s || @homework.teacher_priority.to_s != teacher_priority.to_s || (homework_detail_programing && homework_detail_programing.ta_proportion.to_s != params[:sy_proportion].to_s)
|
|
|
|
|
homework_detail_manual.ta_proportion = params[:ta_proportion]
|
|
|
|
|
homework_detail_programing.ta_proportion = params[:sy_proportion] if homework_detail_programing
|
|
|
|
|
@homework.teacher_priority = teacher_priority
|
|
|
|
|
@homework.update_column('teacher_priority', teacher_priority)
|
|
|
|
|
|
|
|
|
|
homework_detail_manual.save if homework_detail_manual
|
|
|
|
|
homework_detail_programing.save if homework_detail_programing
|
|
|
|
@ -1174,8 +1174,12 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
final_score = final_ta_score + final_s_score
|
|
|
|
|
student_work.final_score = format("%.2f",final_score.to_f)
|
|
|
|
|
end
|
|
|
|
|
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
|
|
|
|
|
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
|
|
|
|
|
if student_work.final_score
|
|
|
|
|
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
|
|
|
|
|
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
|
|
|
|
|
else
|
|
|
|
|
student_work.work_score = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else #不考虑教师评分
|
|
|
|
|
if student_work.teaching_asistant_score.nil?
|
|
|
|
@ -1189,8 +1193,12 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
final_score = final_ta_score + final_s_score
|
|
|
|
|
student_work.final_score = format("%.2f",final_score.to_f)
|
|
|
|
|
end
|
|
|
|
|
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
|
|
|
|
|
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
|
|
|
|
|
if student_work.final_score
|
|
|
|
|
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
|
|
|
|
|
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
|
|
|
|
|
else
|
|
|
|
|
student_work.work_score = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业-----设定:系统评分必定不为空
|
|
|
|
|
if homework.teacher_priority == 1 #教师优先
|
|
|
|
@ -1225,8 +1233,12 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
final_score = final_sy_score + final_ts_score + final_st_score
|
|
|
|
|
student_work.final_score = format("%.2f",final_score.to_f)
|
|
|
|
|
end
|
|
|
|
|
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
|
|
|
|
|
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
|
|
|
|
|
if student_work.final_score
|
|
|
|
|
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
|
|
|
|
|
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
|
|
|
|
|
else
|
|
|
|
|
student_work.work_score = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
else #不考虑教师评分
|
|
|
|
|
if student_work.teaching_asistant_score.nil? #教辅未评分
|
|
|
|
@ -1256,8 +1268,12 @@ class StudentWorkController < ApplicationController
|
|
|
|
|
final_score = final_sy_score + final_ts_score + final_st_score
|
|
|
|
|
student_work.final_score = format("%.2f",final_score.to_f)
|
|
|
|
|
end
|
|
|
|
|
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty if student_work.final_score
|
|
|
|
|
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
|
|
|
|
|
if student_work.final_score
|
|
|
|
|
score = student_work.final_score - student_work.absence_penalty - student_work.late_penalty
|
|
|
|
|
student_work.work_score = format("%.2f",(score < 0 ? 0 : score).to_f) if score
|
|
|
|
|
else
|
|
|
|
|
student_work.work_score = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|