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

FEATURE REQUEST for grade_this_code() #251

Open
garrettgman opened this issue Aug 20, 2021 · 0 comments
Open

FEATURE REQUEST for grade_this_code() #251

garrettgman opened this issue Aug 20, 2021 · 0 comments
Labels
grade code Related to automatic code grading

Comments

@garrettgman
Copy link
Member

I'd like to screen for particular failure modes in grade_this_code() to provide custom messages.

For example, in the example below, I'd like to provide a custom message instead of code_feedback() when the user submits censored[2, 3, 6].

```{r censored}
censored <- c(TRUE, NA, NA, FALSE, FALSE, NA, TRUE)
censored
```

```{r ref.label = "censored"}

```

```{r ph, exercise = TRUE, exercise.setup = "censored"}
censored
```

```{r ph-solution}
censored[c(2, 3, 6)]
```

```{r ph-check}
grade_this_code(
   fail_if_code_is(
    "censored[2, 3, 6]", 
    message = "Did you forget `c()`?", 
    ignore_white_spaces = TRUE
  )
)
```

This may be quickly withdrawn because I bet we can do it with a specific incantation in grade_this(), but might it be more helpful in grade_this_code()?

@gadenbuie gadenbuie added the grade code Related to automatic code grading label Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grade code Related to automatic code grading
Projects
None yet
Development

No branches or pull requests

2 participants