"If you get stuck at R S T A dunce's cap your lot will be"
Engraving of an American dame school, showing a child wearing a dunce's cap
Public DomainEngraving of an American dame school, showing a child wearing a dunce's cap (1713)- Credit: unknown

A dunce is a person who is slow to learn.

In the past, a dunce's cap/hat was used in the classroom.

It was a tall, pointed hat, sometimes marked with a 'D', which was put on the head of a child who misbehaved. Only occasionally was it put on the head of a child who was slow to learn.