You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
grade_this_code() failing to return code feedback #230
In the tutorial below, I expected grade_this_code()to add a code suggestion to the incorrect message. Instead, it appears that the incorrect message has supplanted the code suggestion.
I glued the "gradethis.code.feedback" option into the incorrect message to ensure that fail_code_feedback was set to TRUE
If I remove the incorrect argument, the code suggestion reappears in my feedback.
One (less than ideal) way to accomplish this is to paste a custom message with the default, to create the glue template string (rather than finding the option inside the glue template).
paste("Oops!", getOption("gradethis.code_incorrect"))
#> [1] "Oops! {pipe_warning()}{code_feedback()} {random_encouragement()}"submission<-list(
.user_code="a + b",
.solution_code="a + c"
)
grade_this_code(
incorrect= paste("Oops!", getOption("gradethis.code_incorrect"))
)(submission)
#> <gradethis_graded_this_code: [Incorrect]#> Oops! In `a + b`, I expected `c` where you wrote `b`. Please try#> again.#> >
For completeness in the most recent versions of gradethis, gradethis.code_incorrect is the option name (was previously gradethis.code.incorrect).
Activity
gadenbuie commentedon Mar 5, 2021
One (less than ideal) way to accomplish this is to paste a custom message with the default, to create the glue template string (rather than finding the option inside the glue template).
For completeness in the most recent versions of gradethis,
gradethis.code_incorrectis the option name (was previouslygradethis.code.incorrect).