Skip to content

Conversation

@Rolland-He
Copy link
Collaborator

  • helpers/template_utils.py:
    === {filename} === -> <submission file="correct_submission.py">

Example:

Compare the student's code and solution code...

The student's submission file is correct_submission.py.
The instructor's solution file is solution.py.

Files to Reference:
<submission file="correct_submission.py">
(Line 1) def fizzbuzz(n: int) -> list:
...
</submission>

<solution file="solution.py">
(Line 1) def fizzbuzz(n: int) -> list:
...
</solution>

test_output is also included here.

  • integration_test.py: Update tests.

I have also cleaned the commit history.

@Rolland-He Rolland-He requested a review from wkukka1 July 8, 2025 21:15
@Rolland-He Rolland-He closed this Jul 9, 2025
@Rolland-He Rolland-He deleted the xml-tag-clean branch July 9, 2025 12:51
@Rolland-He Rolland-He restored the xml-tag-clean branch July 9, 2025 12:51
@Rolland-He Rolland-He reopened this Jul 9, 2025
Copy link
Collaborator

@wkukka1 wkukka1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, @Rolland-He! I’ve added a couple of minor suggestions around code style.

lines = text_content.split('\n')
for i, line in enumerate(lines, start=1):
stripped_line = line.rstrip('\n').rstrip()
stripped_line = line.rstrip()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated logic for wrapping lines with XML tags, both for PDFs and regular text files. Consider refactoring the repeated line formatting into a helper function—e.g., _wrap_lines_with_xml(lines, tag_name, filename)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was actually part of the original code, I’ve moved it into a helper function already. I’ll work on simplifying the logic further. Thanks for pointing that out!

Args:
assignment_files (list[str]): List of file paths to process
submission (Path): Student's submission file path
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be Optional[Path] for all these args

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@Rolland-He Rolland-He requested a review from wkukka1 July 9, 2025 14:19
Copy link
Collaborator

@wkukka1 wkukka1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good! @Rolland-He

@Rolland-He Rolland-He requested a review from david-yz-liu July 9, 2025 14:47
Returns:
str: Formatted content with XML tags and line numbers
"""
content = f"<{tag_name} file=\"{filename}\">\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the attribute name filename instead of file, here and throughout all XML tags that have to do with files

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

content = f"<{tag_name} file=\"{filename}\">\n"

for i, line in enumerate(lines, start=1):
if is_pdf:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay looking at this more carefully, I'm realizing that actually for text extracted from PDFs I don't think we need to do the line numbering (which was really to support precise annotations for code). I'm not sure we need to call this function at all when the given text is from a PDF, and instead we can just pass the raw text directly as the file contents to the LLM.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@Rolland-He Rolland-He requested a review from david-yz-liu July 10, 2025 13:58
@david-yz-liu david-yz-liu merged commit 67b089f into MarkUsProject:main Jul 10, 2025
2 checks passed
wkukka1 pushed a commit to wkukka1/ai-autograding-feedback that referenced this pull request Aug 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants