fix: use penalized total score
All checks were successful
build / trigger-build-image (push) Successful in 24s

This commit is contained in:
张泊明518370910136 2025-11-07 16:35:46 -08:00
parent 77064ac37c
commit a901c2bbde
No known key found for this signature in database
GPG Key ID: 134DACA8458EB0E3
2 changed files with 3 additions and 5 deletions

View File

@ -349,6 +349,7 @@ def joj3_all_env(
submitter_repo_name = env.github_repository.split("/")[-1] submitter_repo_name = env.github_repository.split("/")[-1]
penalty_factor = joj3.get_penalty_factor(end_time, penalty_config) penalty_factor = joj3.get_penalty_factor(end_time, penalty_config)
total_score = joj3.get_total_score(env.joj3_output_path) total_score = joj3.get_total_score(env.joj3_output_path)
total_score = round(total_score - abs(total_score) * (1 - penalty_factor))
res = { res = {
"totalScore": total_score, "totalScore": total_score,
"cappedTotalScore": ( "cappedTotalScore": (
@ -423,6 +424,7 @@ def joj3_all_env(
os.path.join(repo_path, scoreboard_filename), os.path.join(repo_path, scoreboard_filename),
exercise_name, exercise_name,
submitter_repo_name, submitter_repo_name,
total_score,
) )
tea.pot.git.add_commit( tea.pot.git.add_commit(
grading_repo_name, grading_repo_name,

View File

@ -41,6 +41,7 @@ def generate_scoreboard(
scoreboard_file_path: str, scoreboard_file_path: str,
exercise_name: str, exercise_name: str,
submitter_repo_name: str, submitter_repo_name: str,
exercise_total_score: int,
) -> None: ) -> None:
if not scoreboard_file_path.endswith(".csv"): if not scoreboard_file_path.endswith(".csv"):
logger.error( logger.error(
@ -99,11 +100,6 @@ def generate_scoreboard(
for row in data: for row in data:
row.insert(index, "") row.insert(index, "")
exercise_total_score = 0
for stage in stages:
for result in stage["results"]:
exercise_total_score += result["score"]
exercise_total_score = exercise_total_score
submitter_row[columns.index(exercise_name)] = str(exercise_total_score) submitter_row[columns.index(exercise_name)] = str(exercise_total_score)
total = 0 total = 0