Skip to content

Commit

Permalink
Add problem id to pdf and small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Matistjati committed Aug 18, 2024
1 parent d8a4c3e commit 7390fb8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
6 changes: 0 additions & 6 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,3 @@ more than one language.
This is an example of a *scoring* problem where submissions can get
different scores depending on which test groups they solve. It also demonstrates how an input validator might check different constraints for different test groups. The swedish statement showcases how to use images, footnotes
and tables in Markdown.

# bplusa

This is an example of a problem using an output validator, where there are multiple valid answers.
The output validator is written pretty generally, guarding against the most common mistakes when using
output validators. It also demonstrates using Markdown as a statement language.
6 changes: 3 additions & 3 deletions problemtools/md2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ def convert(problem: str, options: argparse.Namespace) -> bool:
statement_html = subprocess.run(command, capture_output=True, text=True,
shell=False, check=True).stdout

templatepaths = [os.path.join(os.path.dirname(__file__), 'templates/markdown'),
os.path.join(os.path.dirname(__file__), '../templates/markdown'),
'/usr/lib/problemtools/templates/markdown']
templatepaths = [os.path.join(os.path.dirname(__file__), 'templates/markdown_html'),
os.path.join(os.path.dirname(__file__), '../templates/markdown_html'),
'/usr/lib/problemtools/templates/markdown_html']
templatepath = next((p for p in templatepaths
if os.path.isdir(p) and os.path.isfile(os.path.join(p, "default-layout.html"))),
None)
Expand Down
2 changes: 2 additions & 0 deletions problemtools/problem2pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def md2pdf(options: argparse.Namespace) -> bool:

problem_name = statement_common.get_problem_name(problem_root, options.language)

problem_id = os.path.basename(problem_root)
# Add code that adds vertical and horizontal lines to all tables
statement_md = r'\centerline{\large %s}' % f"Problem id: {problem_id}" + statement_md
statement_md = r'\centerline{\huge %s}' % problem_name + statement_md
statement_md = table_fix + statement_md

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ td {
vertical-align:top;
}



div.sampleinteractionread {
border: 1px solid black;
width: 60%;
Expand Down

0 comments on commit 7390fb8

Please sign in to comment.