Answer
Will you play a heart, or will you ruff? Perhaps because this is a quiz, probably you figured out that you need to ruff. To see why, have a look at this updated diagram, showing the position when West is about to lead the last spade (five cards remain, declarer has won four tricks and lost four):

Your nine of diamonds forces declarer to over-ruff with the Queen, and now your side gets two more trump tricks rather than one more (both partner’s Jack of trumps and your remaining ten of trumps are winners); EW finish with six tricks (declarer is down one in two diamonds).
Minus 90 scores 38%; plus 50 scores 88%. You did well to ruff; the textbooks call this play an ‘uppercut’.
The full deal appears on the next page.