Panic Attacks during an exam - Can the student be re-tested?
If you are in the US, your school is required by law (the Americans with Disabilities Act, often abbreviated ADA) to make reasonable academic accommodations for students with disabilities. This includes mental illness.

In the US, schools have a formal ADA policy that describes the procedure for requesting accommodations. This includes a description of who to contact to make these arrangements. This person is trained in dealing with these issues.

Your next step should be to contact this person, find out what can be done about this exam, and find out what accommodations they can offer for future exams. (For example, they may help you arrange to take future exams in a separate room with no other students and/or with extended time, which may help you stay calm.)