Up to a certain point, it's not an issue. However, more than an inch of cleavage will draw the gaze of a 13+ year-old straight schoolboy as a magnet draws an iron filing. These are not grown men, and their minds have not yet learned how to counter the commands of their hormones.
Paying attention in class? They either will or won't, regardless of cleavage, leg or whatever. That involves an entirely different mechanism anyway.
So what remains is one key question. Does the teacher mind having her cleavage stared at? Decide, and dress accordingly!