Teacher Reference
This section describes the functions and tools available within Pedal for the benefit of an instructor authoring feedback. It does not attempt to exhaustively document all the features available - for that, you should refer to the Developer API.
- Core Commands
- Feedback Functions
- Formatter
- TIFA
- CAIT
- Source
- Sandbox
Sandbox
student
call()
run()
evaluate()
clear_input()
queue_input()
set_input()
get_input()
clear_output()
get_output()
get_raw_output()
get_exception()
get_python_errors()
clear_student_data()
get_student_data()
get_sandbox()
clear_sandbox()
get_trace()
get_call_arguments()
count_unique_calls()
start_trace()
stop_trace()
check_coverage()
clear_mocks()
mock_function()
allow_function()
block_function()
allow_module()
block_module()
mock_module()
get_module()
allow_real_io()
block_real_io()
CommandBlock
- Static Assertions
prevent_function_call()
ensure_function_call()
prevent_operation()
prevent_operator()
ensure_operation()
ensure_operator()
prevent_literal()
ensure_literal()
prevent_literal_type()
ensure_literal_type()
prevent_ast()
ensure_ast()
function_prints()
ensure_import()
prevent_import()
ensure_documented_functions()
ensure_function()
ensure_dataclass()
ensure_prints_exactly()
ensure_starting_code()
prevent_embedded_answer()
prevent_printing_functions()
ensure_functions_return()
only_printing_variables()
prevent_advanced_iteration()
files_not_handled_correctly()
- Runtime Assertions
unit_test()
check_dataclass_instance()
assert_equal()
assert_not_equal()
assert_less()
assert_less_equal()
assert_greater()
assert_greater_equal()
assert_in()
assert_not_in()
assert_contains_subset()
assert_not_contains_subset()
assert_is()
assert_is_not()
assert_is_none()
assert_is_not_none()
assert_is_dataclass()
assert_is_not_dataclass()
assert_true()
assert_false()
assert_length_equal()
assert_length_not_equal()
assert_length_less()
assert_length_less_equal()
assert_length_greater()
assert_length_greater_equal()
assert_is_instance()
assert_is_not_instance()
assert_type()
assert_not_type()
assert_regex()
assert_not_regex()
assert_output()
assert_not_output()
assert_output_contains()
assert_not_output_contains()
assert_has_attr()
assert_has_variable()
assert_has_function()
ensure_coverage()
ensure_called_uniquely()
ensure_function_callable()
- Equivalent Names
- Pedal’s Type System
tools/assertions