Apparently being sad is good for your memory.

People in a positive mood such as happiness were shown under experimental conditions to have relatively unreliable memories, and show poorer judgement and critical thinking skills.

By contrast, those who experienced a negative mood such as sadness were shown to provide more reliable eyewitnesses accounts and exercise superior thinking and communication skills.

One implication is that striving for a pleasant environment in schools is counterproductive; if you really want students to remember stuff you need to make them unhappy. Yes, my tongue was firmly in my cheek when I wrote that.