Exams week

I have exams this week and whenever I take a test my stomach always makes noises in the morning. I eat breakfast. And I'm fine til I get in class and it makes awful farting and diarrhea sounds. I'm not sure what it is? What can I do to stop that? I don't have to use the bathroom but it's only when I'm in class