Commonly used functions

check_chunk()

Check markdown code chunk

check_code()

Test the student's code as text

check_if_else() check_while() check_for() check_cond() check_body(<ControlState>) check_if() check_else()

Check whether student coded a control statement correctly

check_equal(<MarkdownChunkOptionState>)

Check equality of markdown code chunk option

check_equal(<MarkdownYamlOptionState>)

Check equality of markdown YAML header option

check_error()

Explicitly check whether the student's submission threw an error.

check_fun_def() check_arguments() check_body(<FunDefState>) check_call()

Check whether the student defined a function correctly

check_function() check_operator() check_arg() check_equal(<ArgumentState>)

Check whether a student correctly called a function/operator

check_result(<OperationState>) check_result(<FunctionState>) check_equal(<FunctionResultState>) check_equal(<OperationResultState>)

Check the result of a function call/operation

check_header()

Check markdown header

check_library()

Check whether the library function was called correctly

check_correct() check_or()

Combine tests

check_mc()

Test a multiple choice exercise

check_option(<MarkdownChunkState>)

Check markdown code chunk option

check_option(<MarkdownYamlState>)

Check markdown YAML header option

check_output() check_output_expr()

Check whether the student printed something to the console

check_predefined_objects()

Test predefined R objects

check_rmd()

Check markdown file

check_that() test_what()

Expectation wrapper

check_title()

Check markdown header title

check_wd()

Check whether a file exists

check_yaml()

Check markdown YAML header

check_equal() check_result() check_body() check_option()

S3 definitions

check_expr() check_result(<ExprState>) check_output(<ExprState>) check_error(<ExprState>) check_equal(<ExprResultState>) check_equal(<ExprOutputState>) check_equal(<ExprErrorState>)

Check the result, output or errors thrown by an expression

check_object() check_column() check_element() check_equal(<ObjectState>) check_equal(<ObjectColumnState>) check_equal(<ObjectElementState>)

Check R object existence and value

success_msg()

Define the success message

override_solution() override_solution_code() override_solution_env()

Functions to override solution code (and parse data) and variables in the solution environment.

disable_highlighting()

Disable highlighting for any future checks in the chain

Checking markdown

check_rmd()

Check markdown file

check_header()

Check markdown header

check_chunk()

Check markdown code chunk

check_option(<MarkdownChunkState>)

Check markdown code chunk option

check_equal(<MarkdownChunkOptionState>)

Check equality of markdown code chunk option

check_yaml()

Check markdown YAML header

check_option(<MarkdownYamlState>)

Check markdown YAML header option

check_equal(<MarkdownYamlOptionState>)

Check equality of markdown YAML header option

Internals

build_pd()

Build ParseData from string representing code

is_true() is_false() is_gte() is_lt()

Check if object is true, false, >= or <.

ex()

Get the main state

get_num_hits()

Get the number of hits for a series of regexes

is_equal()

Check equality of two objects

run_until_fail()

Run SCT until it fails

setup_state()

Set up state for local experimentation.

State RootState ChildState

testwhat states.

test_exercise()

Run all tests for an exercise

tw

tw singleton object to access data across SCT chains.

testwhat_learnr()

A checker function to use with learnr