A former head teacher has appeared in court where he denied sexual activity with a pupil.