diff --git a/joint_teapot/app.py b/joint_teapot/app.py index ab3e744..c7a2d29 100644 --- a/joint_teapot/app.py +++ b/joint_teapot/app.py @@ -349,6 +349,7 @@ def joj3_all_env( submitter_repo_name = env.github_repository.split("/")[-1] penalty_factor = joj3.get_penalty_factor(end_time, penalty_config) total_score = joj3.get_total_score(env.joj3_output_path) + total_score = round(total_score - abs(total_score) * (1 - penalty_factor)) res = { "totalScore": total_score, "cappedTotalScore": ( @@ -423,6 +424,7 @@ def joj3_all_env( os.path.join(repo_path, scoreboard_filename), exercise_name, submitter_repo_name, + total_score, ) tea.pot.git.add_commit( grading_repo_name, diff --git a/joint_teapot/utils/joj3.py b/joint_teapot/utils/joj3.py index 90d41ff..45eccfd 100644 --- a/joint_teapot/utils/joj3.py +++ b/joint_teapot/utils/joj3.py @@ -41,6 +41,7 @@ def generate_scoreboard( scoreboard_file_path: str, exercise_name: str, submitter_repo_name: str, + exercise_total_score: int, ) -> None: if not scoreboard_file_path.endswith(".csv"): logger.error( @@ -99,11 +100,6 @@ def generate_scoreboard( for row in data: 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) total = 0