Check the result of a function call/operation

# S3 method for OperationState
check_result(state, error_msg = NULL,
  append = TRUE, ...)

# S3 method for FunctionState
check_result(state, error_msg = NULL,
  append = TRUE, ...)

# S3 method for FunctionResultState
check_equal(state,
  eq_condition = "equivalent", eq_fun = NULL, incorrect_msg = NULL,
  append = TRUE, ...)

# S3 method for OperationResultState
check_equal(state,
  eq_condition = "equivalent", eq_fun = NULL, incorrect_msg = NULL,
  append = TRUE, ...)

Arguments

state

the state to start from (for check_ functions)

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 is_equal.

eq_fun

optional argument to specify a custom equality function. The function should take two arguments and always return a single boolean value: TRUE or FALSE.

incorrect_msg

feedback message in case the evaluation was not the same as in the solution.

Examples

if (FALSE) { # Example 1 mean(1:3) # SCT ex() %>% check_function("mean") %>% check_result() %>% check_equal() }