Skip to content

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

Description

@richierocks

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions