I’m on my period and I’m really sick

I’ve been sick for the past week, tmi but I’ve been puking and I’ve had diarrhea basically everyday. I just started my period and everything is worse. Like I’m sitting on the bathroom floor of my dorm because it’s that bad And I don’t even want to risk getting up. I tried taking a hot bath, drinking hot tea with no sugar, and laying down with a heating pad. I also took some ibuprofen like 2 hours ago but nothing is working. I have a really big test in 2 hours that I can’t miss. I need to at least be able to sit for a couple hours without needing to run to the bathroom. Any tips? I really can not miss this test because theres no makeups. I know I should put my health first but I can’t right now. How do I get all of this to go away???