There are five parts (pre-flight, airwork, en-route, approach/landing and abnormal/emergency operations). I think that if you fail one and pass the rest you get a partial pass and only have to retake the failed section - obviously some parts (like pre-flight) will be retested too, even if you passed them first time out. If you fail a second time then you have to do the whole thing again, probably after 'suitable retraining'.
The details will be in LASORS, on the CAA website.