by Davo Smith.
In the get_content() function:
Check the capability of the user that you are interested in.
Return NULL if they do not have the capability that allows them to view the block.
(Note the block will still appear to teachers if they switch editing on, but it will be hidden when editing is off).