Return Values Tasks & Auto-marker
Downloaded: 1
Last edit: 02 June 2026
This is very much still a work in progress.
There is a slideshow with a visualisation to try and explain parameters and return values as 'data in' and 'data out' of subroutines. The idea is to start developing the idea of 'data flow' in a program. I plan to design writing activities to go with it, but there are none as yet.
There are also a couple of introductory examples of subroutine-writing tasks which use an autotest.py script.
The students would get an almost-empty template python file and a copy of autotest.py which has been customised to the task at hand. They write the subroutines and when they run their script, the autotest module will run the tests to check they have been programmed properly.
To set up autotest for a new task, the teacher would write the finished subroutines and call autotest.generateTestData() with the desired test data. This will output Python code which can be copy/pasted into the testDefList variable in autotest.py to set up the desired tests.