Pavlov-style training can make mice stay calm in the face of adversity. Karen Hopkin reports