A single number rarely settles a comparison. To compare two data sets fairly, look at two things at once:
And always say what it means in context. Don't just report "A's median is higher and its IQR is smaller" — translate it: "Class A scored higher on average, and was more consistent, because its IQR was smaller."
Drawing both box plots on the same scale makes the comparison visual. Here Class A and Class B sit one above the other. Class B's box is shifted to the right of A's — so B scored higher on average — and B's box and whiskers are bunched tighter, so B was more consistent. Step through to reveal each one.
In context: Class B had the higher median, so it scored higher on average; and B's IQR and range were smaller, so its scores were more consistent than A's.