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

Compare piped code at the same level #185

Open
gadenbuie opened this issue Dec 17, 2020 · 1 comment
Open

Compare piped code at the same level #185

gadenbuie opened this issue Dec 17, 2020 · 1 comment
Labels
grade code Related to automatic code grading

Comments

@gadenbuie
Copy link
Member

For exercises like

# user code
a %>% b()

# solution code
a %>% b() %>% c() %>% d()

the graded code that's compared is b(a) vs d(c(b(a)) and the outer calls of the user code are compared to the inner calls of the solution.

This results in

I expected d() where you wrote b()

which jumps the user to the end rather than providing feedback about their next step. I haven't explored how feasible it is, but it would be good to try to notice the extra levels of functions calls when comparing to be able to report

I expected you to call c()
@gadenbuie gadenbuie added the grade code Related to automatic code grading label Jan 11, 2021
@garrettgman
Copy link
Member

+ 1

It'd be great to also recast the message as a %>% hint if we spot that they are using %>%, e.g.

I expected you to add `%>% c()` after you called `b()`.

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