check_function_result | R Documentation |
Check the result of a function call/operation
## S3 method for class 'OperationState' check_result(state, error_msg = NULL, append = TRUE, ...) ## S3 method for class 'FunctionState' check_result(state, error_msg = NULL, append = TRUE, ...) ## S3 method for class 'FunctionResultState' check_equal(state, eq_condition = "equivalent", eq_fun = NULL, incorrect_msg = NULL, append = TRUE, ...) ## S3 method for class 'OperationResultState' check_equal(state, eq_condition = "equivalent", eq_fun = NULL, incorrect_msg = NULL, append = TRUE, ...)
state |
the state to start from (for |
error_msg |
feedback message in case the student function call at the mentioned index generated an error. |
append |
Whether or not to append the feedback to feedback built in previous states |
... |
S3 stuff |
eq_condition |
character string indicating how to compare. See
|
eq_fun |
optional argument to specify a custom equality function. The
function should take two arguments and always return a single boolean
value: |
incorrect_msg |
feedback message in case the evaluation was not the same as in the solution. |
## Not run: # Example 1 mean(1:3) # SCT ex() %>% check_function("mean") %>% check_result() %>% check_equal() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.