first of all, if it IS for attention, that doesn't mean it should be dismissed or isn't valid, she may just feel she has no other way to get help/communicate how she's feeling, and the flippancy might be a sort of warped response because she's struggling with the serious conversations...
as for yourself, you sound lovely but you need to look after you as well, it is not your responsibility to stop her and you wont be able to unless she chooses to, draw your own boundaries and don't feel guilty for it, your degree will affect the rest of your life and it is important, if that means telling her you don't want to see fresh cuts or give first aid, that's okay, if you don't mind talking about actually what's upsetting her but not self harm that's okay
as for why, people will give a million and one reasons why they self harm, I think even for those experiencing it's hard to explain properly, it does have physiological effects (i.e. if you're bleeding your blood pressure falls and attention becomes concentrated on your injury so it both distracts and reduces high emotional states) and people use it as a tool for a variety of reasons, what it comes down to at the end of the day is forcing yourself to stop and eventually you will find a new way to acheive whatever you need to