Skip to content

Commit c35dbe0

Browse files
committed
Make submission optional
1 parent 73b482b commit c35dbe0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

ai_feedback/helpers/template_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ def gather_file_references(submission: Optional[Path], solution: Optional[Path],
8686

8787

8888
def gather_xml_file_contents(
89-
submission: Path, solution: Optional[Path] = None, test_output: Optional[Path] = None
89+
submission: Optional[Path], solution: Optional[Path] = None, test_output: Optional[Path] = None
9090
) -> str:
9191
"""Generate file contents with XML tags for prompt templates.
9292
9393
Args:
94-
submission (Path): Student's submission file path
94+
submission (Path, optional): Student's submission file path
9595
solution (Path, optional): Instructor's solution file path
9696
test_output (Path, optional): Student's test output file path
9797
@@ -100,7 +100,8 @@ def gather_xml_file_contents(
100100
"""
101101
file_contents = ""
102102

103-
file_contents += _format_file_with_xml_tag(submission, "submission")
103+
if submission:
104+
file_contents += _format_file_with_xml_tag(submission, "submission")
104105

105106
if solution:
106107
file_contents += _format_file_with_xml_tag(solution, "solution")

0 commit comments

Comments
 (0)