Skip to content

Commit

Permalink
fix render
Browse files Browse the repository at this point in the history
  • Loading branch information
BTWS2 committed Oct 9, 2024
1 parent e8ba9b7 commit 39bd9cf
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions turtle_judge.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,20 @@

correct_pixels, total_pixels, expected_total = diff_images(png_submission, png_solution)

base64_submission = base64.b64encode(svg_submission).decode("utf-8")
base64_solution = base64.b64encode(svg_solution).decode("utf-8")
# base64_submission = base64.b64encode(svg_submission).decode("utf-8")
# base64_solution = base64.b64encode(svg_solution).decode("utf-8")

svg_submission_str = svg_submission.decode("utf-8")
svg_solution_str = svg_solution.decode("utf-8")

html = f"""
<div style="display:inline-block;width:50%;">
<p style="padding:10px">{config.translator.translate(Translator.Text.SUBMISSION_TITLE)}</p>
<img
alt="submission result"
style="width:98%;background-color:#fff"
src="data:image/svg+xml;base64,{base64_submission}" />
<div style="width:98%;background-color:#fff">{svg_submission_str}</div>
</div>
<div style="display:inline-block;float:right;width:50%;">
<p style="padding:10px">{config.translator.translate(Translator.Text.SOLUTION_TITLE)}</p>
<img
alt="solution result"
style="width:98%;background-color:#fff"
src="data:image/svg+xml;base64,{base64_solution}" />
<div style="width:98%;background-color:#fff">{svg_solution_str}</div>
</div>
"""

Expand Down

0 comments on commit 39bd9cf

Please sign in to comment.