Apply automatic grading to a problem object
Usage
tblcheck_grade(problem, max_diffs = 3, env = parent.frame(), ...)
# S3 method for default
tblcheck_grade(problem, max_diffs = 3, env = parent.frame(), ...)
# S3 method for list
tblcheck_grade(problem, max_diffs = 3, env = parent.frame(), ...)
# S3 method for tblcheck_problem
tblcheck_grade(problem, max_diffs = 3, env = parent.frame(), ...)
Arguments
- problem
A problem generated by a
tbl_check_*()
function.- max_diffs
[numeric(1)]
The maximum number of mismatched values to display in an informative failure message. Passed totbl_check_names()
to determine the number of mismatched column names to display and then_values
argument oftbl_check_column()
to determine the number of mismatched column values to display. Defaults to 3.- env
The environment used for grading.
- ...
Arguments passed on to
gradethis::fail
hint
Include a code feedback hint with the failing message? This argument only applies to
fail()
andfail_if_equal()
and the message is added using the default options ofgive_code_feedback()
andmaybe_code_feedback()
. The default value ofhint
can be set usinggradethis_setup()
or thegradethis.fail.hint
option.encourage
Include a random encouraging phrase with
random_encouragement()
? The default value ofencourage
can be set usinggradethis_setup()
or thegradethis.fail.encourage
option.
Value
A gradethis::fail()
message or NULL
invisibly.
Examples
.result <- 1:10
.solution <- letters[1:10]
problem <- vec_check()
tblcheck_grade(problem)
#> <gradethis_graded: [Incorrect]
#> Your result should be a vector of text (class `character`), but
#> it is a vector of integers (class `integer`).
#> >