rstudio / gradethis

Tools for teachers to use with learnr
https://pkgs.rstudio.com/gradethis/
Other
161 stars 40 forks source link

Don't add parentheses to logical operators #326

Closed gadenbuie closed 1 year ago

gadenbuie commented 1 year ago

I'm not sure of the scope of this bug, but it at least happens for logical operators.

library(gradethis)

ex <- mock_this_exercise(
  .user_code = "TRUE | FALSE",
  .solution_code = "FALSE & FALSE"
) 

grade_this({
  fail_if_code_feedback()
  pass()
})(ex)
#> <gradethis_graded: [Incorrect]
#>   I expected you to call ``&`()` where you called ``|`()`.
#> >

The expected feedback message is

I expected you to call `&` where you called `|`.