feat: hide empty comment

This commit is contained in:
张泊明518370910136 2024-10-09 05:13:54 -04:00
parent 311aff4d9c
commit e6c406d6b5
GPG Key ID: CA088E6D9284F870

View File

@ -203,11 +203,9 @@ def generate_title_and_comment(
comment += "\n" comment += "\n"
for i, result in enumerate(stage["results"]): for i, result in enumerate(stage["results"]):
comment += f"<summary>Case {i} - Score: {result['score']}</summary>\n" comment += f"<summary>Case {i} - Score: {result['score']}</summary>\n"
comment += "<details>\n\n"
if result["comment"].strip() != "": if result["comment"].strip() != "":
comment += f"{result['comment']}\n" comment += f"<details>\n\n{result['comment']}\n</details>\n\n"
total_score += result["score"] total_score += result["score"]
comment += "</details>\n\n"
comment += "\n" comment += "\n"
title = f"JOJ3 Result for {exercise_name} - Score: {total_score}" title = f"JOJ3 Result for {exercise_name} - Score: {total_score}"
return title, comment return title, comment