Conjunction "at", "that".
I'm not sure.
It's correct, but I don't feel comfortable.
In portuguese it would sound "foi uma pena que você não tenha...".
I think that what Casper means (and I agree with him) is that it should have said: "...it was pretty bad that you didn't do better on your sister's test"
(note that I - personally - would also have preferred "didn´t do better" as wkn also suggested in stead of "didn´t manage better" )