Run an expression in student and solution environment and compare the result, output or error that is thrown by it.
check_expr(state, expr) # S3 method for ExprState check_result(state, error_msg = NULL, append = TRUE, ...) # S3 method for ExprState check_output(state, error_msg = NULL, append = TRUE, ...) # S3 method for ExprState check_error(state, no_error_msg = NULL, append = TRUE, ...) # S3 method for ExprResultState check_equal(state, eq_condition = "equivalent", eq_fun = NULL, incorrect_msg = NULL, append = TRUE, ...) # S3 method for ExprOutputState check_equal(state, eq_fun = NULL, incorrect_msg = NULL, append = TRUE, ...) # S3 method for ExprErrorState check_equal(state, eq_fun = NULL, incorrect_msg = NULL, append = TRUE, ...)
| state | state to start from (only for |
|---|---|
| expr | the expression to run |
| error_msg | custom message in case the expression throws an error while it shouldn't |
| append | Whether or not to append the feedback to feedback built in previous states |
| ... | S3 stuff |
| no_error_msg | custom message in case the expression doesn't throw an error while it should |
| 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 | custom message in case the result, output or error of the expression does not correspond with the solution |