Thank you again Richard...
This seems to be what I was looking for:
{% if not IS_PRECHECK %}
{# include the student's code #}
{{ STUDENT_ANSWER | replace({'public class ': 'class '}) }}
{% endif %}
Happy days - on to the next problem :-)
Regards,
Anton