Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for qmd #816

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ttimbers
Copy link

First working on setting up tests for .qmd. I added a set of files under test/test_run/qmd_autograder, and started editing test/test_run/test_integration.py to test them. My initial step was to duplicate all the rmd functions and rename them qmd (easiest to do in first pass). But that was not possible for get_config_path and load_config.

@chrispyles - would love you to look at my logic for get_config_path and load_config. The original logic was if rmd was False then dirname = "autograder" but that doesn't allow for qmd. So I've tried to add a second argument qmd to allow to use the qmd config path.

@ttimbers
Copy link
Author

Other places I need to modify the tests are test/test_assign, otherwise all the tests are independent of .Rmd from what I can see, correct @chrispyles?

])
with FILE_MANAGER.open("autograder/source/otter_config.json", "w") as f:
f.write(cpy)
with FILE_MANAGER.open("rmd-autograder/source/otter_config.json", "w") as f:
f.write(crmd)
with FILE_MANAGER.open("qmd-autograder/source/otter_config.json", "w") as f:
f.write(cqmd)
Copy link
Member

Choose a reason for hiding this comment

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

make sure to read the contents of this file and create the cqmd variable before the yield statement above.

if rmd == True & qmd == False:
dirname = "rmd-autograder"
if rmd == False & qmd == True:
dirname = "rmd-autograder"
Copy link
Member

Choose a reason for hiding this comment

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

can this block of ifs to

prefix = ""
if rmd: prefix = "rmd-"
if qmd: prefix = "qmd-"
dirname = f"{prefix}autograder"

def load_config_file(rmd=False, qmd=False):
with open(get_config_path(rmd=rmd, qmd=False)) as f:
return json.load(f)
with open(get_config_path(rmd=False, qmd=qmd)) as f:
Copy link
Member

Choose a reason for hiding this comment

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

You don't need multiple with blocks; you can just do a single one with with open(get_config_path(rmd=rmd, qmd=qmd)) as f:

return json.load(f)
return load_config_file


Copy link
Member

Choose a reason for hiding this comment

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

please add this blank line back -- style guide is two blank lines between top level def statements

def test_qmd(load_config, expected_qmd_results):
name = "hw01"
config = load_config(qmd=True)
qmd_path = FILE_MANAGER.get_path("rmd-autograder/submission/hw01.qmd")
Copy link
Member

Choose a reason for hiding this comment

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

This path should start with qmd-autograder not rmd-autograder

@chrispyles
Copy link
Member

@ttimbers left some comments here.

If you'd like otter assign to be able to generate qmd files in addition to Rmd files, some updates to otter/assign and test/test_assign will also be required.

You will also need to add the qmd extension to this list so that it can be used with otter grade

Copy link
Member

@chrispyles chrispyles left a comment

Choose a reason for hiding this comment

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

Also please add an entry to CHANGELOG.md under v5.6.0. See the examples in that file for formatting and please link to the issue you opened.

@ttimbers
Copy link
Author

Thanks for this help @chrispyles . I have been traveling but am now back in office and will be diving back into this shortly.

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.

2 participants