They have special people who are trained in caning and the culprit will get their 30 lashes or whatever regardless of whether they pass out at lash 19 say. They'll heal you up and back you go for the next 11 lashes.
This is what they did in medieval times, not today. Singapore is barbaric in this aspect and this is enforced in middle schools as well. It turns kids into obedient robots.
Whatever solution is proposed, caning is not one of them.