First focus would be to get the friend treated ASAP. (Till the time the help arrives will provide the first aid treatment, if required and if there's an AED device nearby then will use it too).
In the meantime or once he/she is out of immediate danger will try to have someone who can take care friends/family and then try to reach for the exam.
If it's way too beyond the exam start time then I would give another attempt at it.
If the exam was the last attempt due to age or total attempts allowed restriction then will give some other exam or do something else in life.