When you're under a lot of stress, your sympathetic nervous system (responsible for the 'fight or flight' mechanism) is active much more than the parasympathetic (which encourages the 'rest and digest' mechanisms). The sympathetic nervous system will encourage salivation, and as saliva is acidic, it can have an inflammatory effect on the soft tissues of your mouth. Combine this with the fact that sympathetically-produced saliva is much thicker and therefore any bacteria will be suspended in your mouth for longer, plus the fact that prolonged sympathetic stimulation can depress your immune system, and you've got pretty optimal conditions for ulcers to occur.
My advice would be to gargle a few times over the next week or so with hydrogen peroxide to kill off any of the crap living in the back of your throat, use a normal antibacterial mouthwash twice a day when you brush your teeth and avoid acidic foods like fruit juice. Cheese is alkaline so may help to neutralise some of the acid. You can also suck antibacterial throat lozenges, some of which have local anaesthetic in and will help with the pain. If you're still having problems, don't hesitate to see your doctor for a course of antibiotics or anti-inflammatories. Alternatively (or additionally) you can see your dentist to see if they have any recommendations. Try and get plenty of sleep, make sure your intake of fruit and veg is up to scratch and do some exercise when you can, as these things will all boost your immune system. Lastly, try and relax whenever you can. I know it's tough in your final year but I'm sure you're going to do really well and you don't need to make yourself ill over your work. Even if it's only a couple of hours a week where you can just forget about work and do something completely unrelated, it'll be worth it.