There's an internal function in exercise.R that is called when the exercise code produces an invisible result. I'm not sure why an invisible result is something you want to check for and why this feature is needed at all. @garrettgman
I think the warning being displayed will be unfriendly to most students. Might we either
Allow it to be configured/disabled as an option.
Set it to something more friendly, like: "Note: Using assignment in the last line means that no value will be printed." Of course, you also get the warning when the last line generates a side effect but no value, e.g. plot(1:10)
Leave it to the code checking. If last_value is NULL, that might suggest a helpful hint depending on the context, but only the author of the tutorial can decide what that should be.
invisible_feedback<-function() {
feedback_as_html(
feedback_validated(
list(
message="Last value being used to check answer is invisible. See `?invisible` for more information",
type="warning",
correct=FALSE,
location="append"
)
)
)
}
The text was updated successfully, but these errors were encountered:
There's an internal function in
exercise.Rthat is called when the exercise code produces an invisible result. I'm not sure why an invisible result is something you want to check for and why this feature is needed at all. @garrettgmanI think the warning being displayed will be unfriendly to most students. Might we either
plot(1:10)last_valueisNULL, that might suggest a helpful hint depending on the context, but only the author of the tutorial can decide what that should be.The text was updated successfully, but these errors were encountered: