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

In R markdown exercises, allow checking of text where there is no header #226

Open
richierocks opened this issue Feb 11, 2019 · 0 comments

Comments

@richierocks
Copy link
Contributor

Inspired by ch1ex3 of Reporting with R Markdown.

The exercise asks students to change a line of text.

The old SCT was

test_rmd_group(1, {
  test_text("This is my first R Markdown document", not_called_msg = "Don't forget to change the first sentence to \"This is my first R Markdown document.\".")
})

There is no direct, "check" equivalent to test_rmd_group().

The best I could come up with is

ex() %>% check_rmd() %>% {
  check_code(., 'This is my first R Markdown document', fixed = TRUE, missing_msg = "Don't forget to change the first sentence to \"This is my first R Markdown document.\".")
}

The problem with this is that it doesn't pinpoint a region of text for the students to look at.

The closest test I can find is here, which uses check_header() to zoom in. Unfortunately, there is no header element in the document.

Is there a better solution than the one I found? Do we need a check_text_group() or check_paragraph() function? Or is this too niche to worry about?

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

No branches or pull requests

1 participant