testwhat (version 4.2.2)

test_error: Check whether the student's submission threw an error.

Description

With information gathered from the R Backend, detect whether the student's submission generated an error. If this is the case a feedback message will be generated that contains the R error in a formatted style. You can use incorrect_msg to add a custom message to this error.

Usage

test_error(incorrect_msg = NULL)
"check_error"(state, incorrect_msg = NULL, ...)

Arguments

incorrect_msg
additional message that is appended to the automatically generated feedback message.
state
State to start from (for check_error)
...
S3 stuff

Examples

Run this code
## Not run: 
# # Example student code: x <- 4 + "a"
# 
# # SCT option 1
# test_error()
# 
# # SCT option 2
# ex() %>% check_error()
# ## End(Not run)

Run the code above in your browser using DataLab