If the whole sentence was quoted but since it was just the word "Stupid", it's in the right place.
Or you could go by this:
Both. Sort of. It really depends on where you're from. Traditionally, English had it outside of the quotation marks. However, American English allows for it to be put inside. Either way is usually right, but you should at least be consistent. Also check with your publisher/teacher/editor/etc to see if they prefer one method over the other.