I'm not sure if this is literal or not, and I also don't see how it fits with your context!
I looked it up - the part before gave the context.
It is referring to punishment/teaching of children with learning difficulties. When the children were trying to do the embroidery, they would prick their fingers, and blood would be left on the cloth. The fact that they had tried to do the embroidery, and had pricked their fingers, and bled on the cloth, was considered to have taught them enough.