All notable changes to the testwhat
project will be documented in this file. This project adheres to Semantic Versioning.
check_arg(n)
) and ...
element argument access (..n
)check_call
work with list argsdiagnose
tests in check_correct
.ex() %>% check_error()
check after an SCT finished successfully, unless allow_errors
is set to FALSE
by RBackend, which is the case if the exericse has allow_solution_error()
in the pre-exercise-codedisable_highlighting()
check_
function is not a state, which happens if you forget the .
.override_solution()
does not parse.check_object()
is not used on root state (and TESTWHAT_V2_ONLY
set)check_output_expr()
is not used on root statecheck_function()
called on check_object()
check_call()
not called on check_function_def()
check_arg()
not called on check_function()
check_mc()
to use instead of test_mc()
.TESTWHAT_V2_ONLY=1
the test_mc()
function will error out.test_correct()
, test_or()
will error out.TESTWHAT_V2_ONLY=1
, old skool usage of check_correct()
and check_or()
will error out.
You have to pipe in ex()
:R
ex() %>% check_correct(...)
ex() %>% check_or(...)
When executing old skool test_()
functions, testwhat
will now check the environment variable TESTWHAT_V2_ONLY
. If it is set to 1
, an error will be generated. This will effectively make test_()
functions unavailable for newer courses whose course image will have this environment variable baked in.
check_correct()
and check_or()
. These functions will then expose a special variable .
for the subtests to use:R
ex() %>% check_correct(
check_object(., 'x') %>% check_equal(),
check_function(., 'mean') %>% check_arg('x') %>% check_equal()
)
```R # solution x <- list(a = 1)
# sct ex() %>% check_object('x') %>% check_equal(eq_fun = function(x, y) { x$a == x$b })
# submissions that will pass x <- list(a = 1) x <- data.frame(a = 1) x <- list(a = 1, b = 2) ```
h1
-level tags (starting with #
or underlined with =====
)check_header()
does not use the h<num>
reference, instead uses level <num>
reference.MarkdownExercise
, such as check_rmd()
, check_yaml()
, check_header()
, check_chunk()
and check_option()
. Together, they allow for a gradual 'zooming in' on particular parts of the markdown file submitted by the student and the markdown file contained in the solution.disable_highlighting()
: when used in an %>%
-based SCT chain, this disables highlighting for any checking functions that follow. If there is highlighting information for before the disable_highlighting()
function, this will be used as a fallback.testwhat
as a grader into learnr
.allow_extra
argument in test_yaml_header()
and test_chunk_options()
, as they were used nowhere on the platform. These functions will soon be either removed or updated to depend on the new tidy markdown testing functions.check_library()
: check_
equivalent for test_library_function()
. Documentation has been udpated accordinglycheck_code()
now takes a drop_comments
argument. It defaults to FALSE
. If you set it to TRUE
, comments will be stripped from the student submission before the pattern you specified (fixed or not) is sought.check_library()
(and by extension test_library_function()
) now ignore library()
and require()
calls in comments.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.