fix: penalty for negative score
All checks were successful
build / trigger-build-image (push) Successful in 13s

This commit is contained in:
张泊明518370910136 2025-06-30 08:09:07 -04:00
parent 9e31fc71be
commit 54a4f404fe
GPG Key ID: CA088E6D9284F870

View File

@ -258,7 +258,7 @@ def generate_title_and_comment(
total_score += result["score"]
comment += "\n"
if penalty_factor != 1.0:
total_score = round(total_score * penalty_factor)
total_score = round(total_score - abs(total_score) * (1 - penalty_factor))
title = get_title_prefix(exercise_name, submitter, submitter_in_title)
if max_total_score >= 0:
title += f"{total_score} / {max_total_score}"