It denoted someone who worked hard and did well academically. It is a term of abuse. Swots were not popular.