Teacher 'schools' student after Twitter rant