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

Provide better messages for code involving infix operators #332

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rossellhayes
Copy link
Contributor

@rossellhayes rossellhayes commented Feb 16, 2023

  • When only one of solution or submitted is an infix, provide the whole context,
    • e.g. "I expected you to call mean() where you called (x + y)/2."
  • When both solution and submitted are infixes, provide jus the operator,
    • e.g. "I expected you to call + where you called *."

Closes #84.

TODO

user <- "sqrt(1 + 2)"
solution <- "sqrt(1 + 2 + 3)"
code_feedback(user, solution)
#> In `1 + 2`, I expected `1 + 2` where you wrote `1`.
  • Don't reveal the contents of functions that are infix arguments
user <- "b(1)"
solution <- "b(1) + 2"
code_feedback(user, solution)
#> I expected you to call `b(1) + 2` where you called `b()`.
  • Investigate how we give feedback on the base pipe (|>)
  • Improve handling of repeated operators (e.g. !!, !!! and {{ }})

Created on 2023-02-16 with reprex v2.0.2

…ix operators

* When only one of `solution` or `submitted` is an infix, provide the whole context,
e.g. "I expected you to call `mean()` where you called `(x + y)/2`."
* When both `solution` and `submitted` are infixes, provide jus the operator,
e.g. "I expected you to call `+` where you called `*`."
@rossellhayes rossellhayes added the grade code Related to automatic code grading label Feb 16, 2023
@rossellhayes rossellhayes self-assigned this Feb 16, 2023
@CLAassistant
Copy link

CLAassistant commented Jul 3, 2024

CLA assistant check
All committers have signed the CLA.

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

Successfully merging this pull request may close these issues.

Better handling of infix operators
2 participants