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

code_feedback() should ignore argument names of anonymous functions #287

Open
rossellhayes opened this issue Feb 16, 2022 · 1 comment
Open
Assignees
Labels
grade code Related to automatic code grading

Comments

@rossellhayes
Copy link
Contributor

code_feedback() alerts the user to differences in the argument names of anonymous functions. Is it possible to ignore this?

library(gradethis)

.user_code     <- "map(data, function(x) is.na(x))"
.solution_code <- "map(data, function(y) is.na(y))"

code_feedback()
#> In `function(x)`, I expected argument `y` where you wrote argument `x`.

Created on 2022-02-16 by the reprex package (v2.0.1)

@rossellhayes rossellhayes added the grade code Related to automatic code grading label Feb 16, 2022
@gadenbuie
Copy link
Member

Even worse

.user_code     <- "map(data, function(x) is.na(x))"
.solution_code <- "map(data, ~ is.na(.x))"

code_feedback()
#> In `map(data, function(x) is.na(x))`, I expected you to call ``~`()` where you called `function() NULL`.

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