Take another look at the sentence:
Emma Sue was delighted when Mr. Nguyen returned her perfect calculus test
with an ear-to-ear grin.
With an ear-to-ear grin, a prepositional phrase, is describing test when its target should be Mr. Nguyen. When a modifier is next to a word it doesn't logically describe, it is misplaced.
To fix the problem, you should organize the sentence like this: With an ear-to-ear grin, Mr. Nguyen returned the perfect calculus test, which delighted Emma Sue.