I would like to suggest one more tool.
Fine Code Coverage
Its small simple and 100% free.
Disclaimer : I'm the primary developer
The Jupyter project has the marvellous NB Grader sub-project which is documented here with a video here.
NB Grader allows you to:
Create assessments which are in the form of Jupyter notebooks.
These can obviously contain static text as instructional material.
Working code examples
Data or links to data sources
Code Entry cells (these can be marked ...