You need to assess your situation here carefully and ask yourself:
- Why do you lack the motivation? Since you say that you have been missing classes from the beginning, what has been the cause of this anxiety? You could really benefit from seeking advice from a counsellor at university like the above poster has mentioned through email or calling.
- Are you passionate about the course/its subject or were you ever? If your anxiety decreased do you believe you would still feel interest or motivation to continue with the course? If it's the course or university that is having an adverse effect on you i.e. you found the course too difficult or you don't enjoy your accommodation etc then I would suggest looking into changing courses or university. It might be too late to do for this year but you could always return next year.
In my honest opinion, you do not seem to be in the right frame of mind currently to undertake this course especially if the anxiety was there from the beginning and it's been a lot of missed classes and work. Whilst you may still be able to pick the work up, I believe you should properly evaluate your circumstances, speak to someone about it and think about what you could do as an alternative to the course. A gap year would be beneficial so you could seek help and work on the medical issues but also to assess whether university life is for you, like above poster mentioned. If you did wish to return to education, I think you would fare a lot better after some time out and returning with a positive mindset about your abilities and in an improved situation. Just please do not panic. You have a lot of options and there is always some way to make this better.
I myself dropped out of university because I was not motivated due to the fact that the course didn't interest me and I felt so homesick. I simply was not mentally prepared for university life and did not want to pursue a career in my chosen field at all. I used to cry every time my dad would drive me back to university during weekend visits back home. It wasn't an easy decision to drop out. I had to consider and plan my next steps: what will I do for the remaining year in terms of finance - how much do I owe student finance for my accommodation and the course so far; what field do I want to go into and what interests me, and considering these career options, will I return to university to undertake a degree or will it be an apprenticeship or will I try to get a job? It was two years until I returned to university and was in a better mind frame. I benefited so much from this time out.