library(gradethis)
ex <- mock_this_exercise(.user_code = "sqrt(log(2))", .solution_code = "sqrt(log(1))")
gradethis_setup(fail.hint = FALSE)
grade_this({fail()})(ex)
#> <gradethis_graded: [Incorrect]
#> Incorrect. In `log(2)`, I expected `1` where you wrote `2`. That's
#> okay: you learn more from mistakes than successes. Let's do it one
#> more time.
#> >
gradethis_setup(fail.hint = TRUE)
grade_this({fail()})(ex)
#> <gradethis_graded: [Incorrect]
#> Incorrect. In `log(2)`, I expected `1` where you wrote `2`. That's
#> okay: you learn more from mistakes than successes. Let's do it one
#> more time.
#> >
Created on 2022-09-30 with reprex v2.0.2
Created on 2022-09-30 with reprex v2.0.2