Skip to content

The self-assessment module ​

Basthon's Python kernel ships a basthon.autoeval module to test students' code automatically. For instance, ValidateFunction compares a function with a reference function on a series of values:

python
from basthon.autoeval import ValidateFunction

ValidateFunction("absolute_value", [-3, -1, 0, 2, 5], valid_function=abs)()

The module also offers ValidateVariables to check variables, and is the basis of the sequenced notebook.

Play with it!

Self-assessment