Hi Dominoes20
Sorry to hear about your situation. Do you think that you could learn the necessary mathematics and hard skills if you had more time? I think the best thing to do would be to speak to a few people so you get a balanced view and hopefully some support. Could you meet with the lecturer, and then maybe your personal tutor/academic advisor and just say what you've said here? You can then find out options (eg. Is there an option to redo coursework during the next summer if it fails), and you can make a plan of action.
Tudor