Female teachers in Scotland are far more likely to be attacked by pupils than their male counterparts, a survey has shown.