testwhat (version 4.2.2)

test_call_result: Check the result of a function call/operation

Description

Check the result of a function call/operation

Usage

test_function_result(name = NULL, index = 1, eq_condition = "equivalent", not_called_msg = NULL, error_msg = NULL, incorrect_msg = NULL)
"check_result"(state, error_msg = NULL, append = TRUE, ...)
"check_result"(state, error_msg = NULL, append = TRUE, ...)
"check_equal"(state, eq_condition = "equivalent", incorrect_msg = NULL, append = TRUE, ...)
"check_equal"(state, eq_condition = "equivalent", incorrect_msg = NULL, append = TRUE, ...)

Arguments

name
name of the function whose output you would like to check.
index
Ordinal number of the call you want to check (both student and solution!).
eq_condition
how to compare student and solution.
not_called_msg
feedback message in case the function is not retrieved.
error_msg
feedback message in case the student function call at the mentioned index generated an error.
incorrect_msg
feedback message in case the evaluation was not the same as in the solution.
state
the state to start from (for check_ functions)
append
Whether or not to append the feedback to feedback built in previous states
...
S3 stuff

Examples

Run this code
## Not run: 
# # Example 1
# mean(1:3)
# 
# # SCT option 1
# test_function_result("mean")
# 
# # SCT option 2
# ex() %>% check_function("mean") %>% check_result() %>% check_equal()
# ## End(Not run)

Run the code above in your browser using DataLab